×

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

Bi-monthly release with minor bug fixes and improvements

Driver for GoTo and Guide through Arduino & ST4

  • Posts: 26
  • Thank you received: 1
There is a lot of not needed stuff in this code. It is my first try in prgramming, so apologies for such a mess.
You can delete all references to ardust4driver, it is leftover from my first try to make it connect to arduino, If i have some time, I will try to clean code. and add comments.
I also added lot of buttons to change speed, stepping modes etc. during guiding.
There is something wrong (maybe It is changed by other function in indi?) with PortFD variable, so I created PortFD2 to wich I have access.
Libnova is needed only for parking.
3 years 9 months ago #55251

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

  • Posts: 25
  • Thank you received: 1
Hello Topaz,
thanks again for your source code. I have gone through it and with the help of google translate, I was able to understand your variable names and comments. I got to the point that it is working for me and I removed a lot of specific code that you needed, but is not necessary for me. It runs now in KSTARS as device - client. However, if I want to use it with EKOS, it crashes when I want to goto. Not sure why....
I think I have more work to do, but thanks again for the kick-start you gave me.
Stephan
3 years 9 months ago #55504

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

  • Posts: 26
  • Thank you received: 1
I also use it in device - client mode in Kstars and PHD2 for guiding. I start server with drivers from command line and then connect KStars fot GOTO then disconnect and connect PHD2 for guiding.
I tried EKOS (driver crashed from time to time) but PHD2 works better for my setup.
3 years 9 months ago #55571

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

  • Posts: 25
  • Thank you received: 1
Hello Topaz,
I just wanted to let you know, that I am now successfully using the Arduino to control my telescope through ST4 - thanks to your code. Guiding also works very well.
Since I am not an experienced C++ programmer, I am still not quite sure what exactly I am doing in the source code, but I got it to work - even in kstars and ekos!
Now I am fighting with the focuser module of ekos, but this is another story...
Thanks again
Stephan
3 years 9 months ago #56077

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

  • Posts: 26
  • Thank you received: 1
Hi Stephen,
Happy to learn that it works for you. Clear skies.
3 years 9 months ago #56093

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

  • Posts: 4
  • Thank you received: 0
Hi, thanks for the goto code, I can now compile it and make it work on Kstars and CDC .... for the goto commands, that are sent to arduino, I only can manage RA+#, DEC+# types of commands, because I am using the arduinoST4 ino code.... As I see you send codes for your goto, you send a bunch of other commands that are used with you arduino code in the github repo too.
All for your encoders, is it?
Do you have more info on your hardware setup?

Miguel.
2 years 9 months ago #71787

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

  • Posts: 26
  • Thank you received: 1
Hi Miguel,
I am using stepper motors which are run by Arduino+drivers (A4988 for DEC and old motor shield for RA), no encoders.  I chose to send number of steps instead of time (I can change goto speed on fly). I think you can modify your INO and/or driver file to make Arduino start movement and stop it after some time. You would need to calculate how much time is needed to move and maybe change driver code to send time required instead of steps (basically you can make Arduino translate number of steps to time if you don't want to modify driver file) .Hope it helps.

Regards
Topaz
2 years 9 months ago #71791

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

  • Posts: 4
  • Thank you received: 0
Excellent, thank you very much. Good idea to transform steps into time in the Arduino Code... :-) //
2 years 9 months ago #71815

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

  • Posts: 1
  • Thank you received: 0
Hi Tomasz,
I am reading your code and I cannot understand a lot of things... In particular I cannot understand how you manage the two motors. If I'm not wrong you are using a shift register which is sending the HIGH/LOW levels to the A4988 drivers.
I suppose the 74HC595 shift register is connected to two A4988 drivers, but I cannot understand how the things are connected. I am referring to the following:
<code>#define MOTOR1_A 2
#define MOTOR1_B 3
#define MOTOR2_A 1
#define MOTOR2_B 4
#define MOTOR3_A 5 // TERAZ ENABLE A4988
#define MOTOR3_B 7 // MS
#define MOTOR4_A 0 // MS
#define MOTOR4_B 6 // MS

// Arduino pins for the PWM signals.
#define MOTOR1_PWM 11
#define MOTOR2_PWM 3
#define MOTOR3_PWM 5
#define MOTOR4_PWM 6</code>
The MOTORn_A and MOTORn_B are the output pins of the shift register but I cannot understand to which A4988 inputs are connected to. Which pin is connected to the RA motor? And which one to the DEC motor? I suppose you connected per each driver at least the `EN, MS1, MS2, MS3, STEP` and `DIR` inputs. Can you please help me?

Thank you.
Last edit: 1 year 11 months ago by StefanoF.
1 year 11 months ago #82463

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

  • Posts: 26
  • Thank you received: 1
Hi,
It was very complicated, because one of the motors was drawing to much current it heated original driver chip on motor shield very hot, so I removed it (chip) and conected A4988 by wires to shield (to some holes were chip was) to be able to control it from Arduino by programming shift register. I had only one A4988 avaiable and I wanted to use mout very badly and it worked, so it stayed that way for 2 years. ;)
Now I am using Onstep with ESP32 and 2x TMC2290 drivers, It' works like a charm.
1 year 11 months ago #82476

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

  • Posts: 6
  • Thank you received: 0
Then why, when I install indi-full, does that driver not get installed? That is supposed to install all third party drivers.
1 year 1 month ago #90093

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

Time to create page: 1.193 seconds