×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Issues with indi_eqmod and custom MC

  • Posts: 57
  • Thank you received: 28
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
6 years 8 months ago #17908
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 226
  • Thank you received: 88
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.

Jean-Luc.
The following user(s) said Thank You: Ilia
6 years 8 months ago #17915

Please Log in or Create an account to join the conversation.

  • Posts: 57
  • Thank you received: 28
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
6 years 8 months ago #17916

Please Log in or Create an account to join the conversation.

  • Posts: 57
  • Thank you received: 28
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.
6 years 8 months ago #17923

Please Log in or Create an account to join the conversation.

  • Posts: 226
  • Thank you received: 88
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:
2016-07-26T09:29:29: StartMotor() : Axis = 1 
2016-07-26T09:29:29: read_eqmod: "=", 2 bytes read 
2016-07-26T09:29:29: dispatch_command: ":I1560200", 10 bytes written 
2016-07-26T09:29:29: read_eqmod: "=101", 5 bytes read 
2016-07-26T09:29:29: dispatch_command: ":f1", 4 bytes written 
2016-07-26T09:29:29: SetSpeed() : Axis = 1 -- period=598 
Another point is the behavior of the hand controller: do you think there are no readings of the motor firmware answers ?
6 years 8 months ago #17926

Please Log in or Create an account to join the conversation.

  • Posts: 57
  • Thank you received: 28
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?

Ilias.
6 years 8 months ago #17935

Please Log in or Create an account to join the conversation.

  • Posts: 226
  • Thank you received: 88
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.
6 years 8 months ago #17941

Please Log in or Create an account to join the conversation.

  • Posts: 57
  • Thank you received: 28
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
6 years 8 months ago #17997

Please Log in or Create an account to join the conversation.

Time to create page: 0.723 seconds