Hi, I am facing some problems with my own motor controller, I wrote this firmware to be compatible with a SynScan HC and I'm trying to interfacing it with indi_eqmod.
The board works perfectly with my SynScan, but the INDI driver stops immediately after a track command.
If you check out the log attached, you'll see that it's waiting for a reply from the SetStepPeriod command ":I".
I checked for timing issues, put a small delay after the reception of this command, tried also to avoid setting the stepperiod variable in firmware, no luck.
I also think it may happen in set commands.
Do I miss anything? Does eqmod expect anything when issuing SetStepPeriod?
Thanks all,
Ilias.
Last edit: 6 years 8 months ago by Ilia. Reason: added attachment: code
Hi Ilia,
I think that the '=' answer is not sent because the StepPeriod is too short (000006) for your firmware.
The pic processor may be almost always in the timer interrupt routine, hence no time for send_string().
I would suggest to apply a min when setting stepperiod[axis] in the SetStepPeriod case, as the indi driver has no way to know this minimum.
Hi Jean-Luc, and thanks for your reply.
I will try to do like you said (setting the minimum at command reception), but if you see into SetMicrostep() (called after a StartMotion) the step period is set to a minimum of 30. Also gotos are not limited in speed and this applies in both motion mode cases SetMicrostep sets the stepperiod only in slewmode, and goto stepperiod is always set to this minimum (30). When I issue a goto from the SynScan, speed is set automatically at maximum, and I got no timing problem.
I tried also to check if there is any issue with signed types in my code, with no luck.
Last edit: 6 years 8 months ago by Ilia. Reason: clarification about minimum step period
I solved by now by commenting out any read_eqmod after all SetXXX commands. It can now track and goto. I found some other bugs in my firmware but at least I can continue developing.
I didn't see your max(30, stepperiod...) on first reading.
Now I wonder why there is no answer from your firmware. Moreover it is ok when you start tracking:
To be honest I don't know if there's no reading. I don't think so however. Maybe it's a timing issue. Could a separate thread for reading from the MC help?
I don't know where the indi driver runs but I don"t think another thread for reading from the MC would help.
Maybe you could first try to check if there is an answer directly with picocom or microcom (or putty...).
Another solution is to debug the firmware, I use gpsim but your processor is not supported so that would need some tweakings to run it. I think you use xc microchip compiler (#include <xc.h>), I know the microchip IDE has a debugger but it does not support RS232 on Linux. Maybe on Windows but I've never tried that.
Hi Jean-Luc
I made some progress:
You were right, the interrupt routine was continuosly called by the timer, and it couldn't end its cycle, so I disabled interrupts into the isr, and re-enabled them at the end of the call.
It's now working! Tracking, gotos are doing what expected.
There is another problem now: when I try to abort, it starts StopWaitMotor and it can't end, my firmware is always telling that the motors are running. I should investigate about this.
By the way, thanks for your help, and if you have any other suggestion.. you're welcome!
Ilias