Jump to content

SkySurveyBanner.jpg.21855908fce40597655603b6c9af720d.jpg

RA Autoguiding Help


kman42

Recommended Posts

Hi, I am trying to build a circuit that autoguides the RA axis of my EQ5 mount. My mount is already modified with a bipolar stepper motor on the RA axis. I only want RA guiding, not DEC control.

I have bought a guide camera with a USB and ST4 output and have successfully connected it to my laptop, and have gotten an image on PHD2. 

I have an Arduino nano, and an A4988 stepper motor driver. I will use the arduino to receive signals from the laptop and control the stepper motor with RA+ or RA- signals.

I have been searching for some missing pieces to a puzzle I have but can't find good answers so I'll ask.

- how, specifically, does my laptop connect to my arduino? I have read about ASCOM drivers, but what role do they play, and what's the physical connection between laptop and arduino?

- many auto-guiding circuits use an optocoupler. Why do I need one, and where does it go in the circuit?

- Depending on the above answers I may have follow-up questions about the arduino code.

  • Like 1
Link to comment
Share on other sites

11 hours ago, kman42 said:

how, specifically, does my laptop connect to my arduino? I have read about ASCOM drivers, but what role do they play, and what's the physical connection between laptop and arduino?

You connect the arduino via usb. It's easiest if your arduino already has a usb port, like the Uno.

Forget about ascom for the time being, because it would involve writing your own driver. The st4 port of your camera will provide electrical signals from guiding software like PHD or Lin-guider. (In PHD you set mount type as "on camera".) The duration of these signals will determine directly for how long the mount will correct the tracking. That correction is added at guiding rate to the tracking. This is the easiest to program.

while (RA+ == 1) {Track-rate = sidereal-rate + guide-rate}

while (RA- == 1) {Track-rate = sidereal-rate - guide-rate}

Here's a link to common st4 pinout.

 

Is your mount stepper motor an upgrade or a diy solution, meaning, did it come with a motor control board? If it's diy, you are using the arduino as hardware controller. Ascom is the driver that will send commands to the hardware controller. The hardware controller then translates these commands into motor movements. In essence you have to program your arduino to become ascom compatible. But this assumes that you want to control your mount from a computer through some sort of planetarium package, for example.

12 hours ago, kman42 said:

many auto-guiding circuits use an optocoupler. Why do I need one, and where does it go in the circuit?

If the mount already has a hardware controller, any other hardware that connects to the st4 port will use an optocoupler. This is just a safety precaution, so you don't need to worry about providing the right voltage and current. Or frying the mounts microcontroller.

Assuming that at the moment your arduino only supplies sidereal tracking in RA, the ST4 based solution is easiest to implement.

You should have a look here

 

Link to comment
Share on other sites

My Arduino does indeed have a USB port. I thought it was only for uploading code,  I didn't know it could accept live signals. 

Can you elaborate on the use of the ST4 port?  Are you saying I connect my camera to the laptop via ST4 rather than USB? 

The stepper motor was a DIY solution. It is controlled with an A4988 driver. I was planning to control the guiding of the mount using PHD2. Are you suggesting the use of a laptop isn't necessary for sidereal guided movement? 

Link to comment
Share on other sites

 

46 minutes ago, kman42 said:

Can you elaborate on the use of the ST4 port?  Are you saying I connect my camera to the laptop via ST4 rather than USB?

Most guide cameras have an ST4 port. This can be connected to the ST4 port of a mount, if it has one. The guiding software (PHD2) is connected to the guide camera via usb. It will send guide commands back to the camera, via usb. The guide camera will then send these signals through its ST4 port to the mount. PHD2 still has to run on a laptop.

If you already have your arduino set up to provide sidereal tracking, adding ra guiding isn't that difficult. Just use the two wires from an RJ12 (ST4) cable that is connected to the cameras ST4 port (the RA+ and RA- wires) plus the ground wire. Connect the RA+/- wires to two arduino inputs, and the ground wire to arduino ground. If you don't know which voltage the ST4 port provides, you either use a series resistor, or an optocoupler, to protect the arduino inputs.

46 minutes ago, kman42 said:

My Arduino does indeed have a USB port. I thought it was only for uploading code,  I didn't know it could accept live signals

The usb port of an arduino can be used for serial write and serial read. You may need an appropriate library for this. Serial write is standard arduino functionality. Serial read is a little more difficult to implement.

  • Like 1
Link to comment
Share on other sites

2 hours ago, kens said:

You still need a way to power the Arduino.

Yes, but you don't need a computer for that. The nano has a supply voltage pin that accepts 7 - 12V. You can power it from the same source as the stepper motor.

Link to comment
Share on other sites

  • 5 months later...

Reviving an old thread, because I've hit some roadblocks.

I have managed to get my computer to communicate with my guide camera - its a Daytson T7M. I can see an image in PHD2. However, I can't get my camera to send signals to my Arduino. I have the ST4 cable from the camera going through an optocoupler (one cable for each optocoupler channel, with the common wire acting as ground). But my Arduino doesn't detect anything. What kind of signal should I be looking for from the ST4 when I press the manual guide buttons in PHD2? A 5V source, something else?? At this point I'm struggling to understand what my Arduino code should look like - if I knew what kind of signal the ST4 was sending, that would help. I tried hooking up my multimeter to the ST4 and manual guiding but I didn't know what kind of multimeter reading I should be looking for.

Link to comment
Share on other sites

Measure continuity between ground and each optocoupler. When you press RA- or RA+ in PHD, it should close the signal between the relevant optocoupler output and ground. ST4 is rock bottom basics equivalent of 4 push switches.

Link to comment
Share on other sites

20 minutes ago, wimvb said:

If the output of the optocoupler is connected to an arduino input, you also need a pullup resistor cpnnected to 5 v. 

Arduino inputs can be defined to enable an internal pullup resistor  pinMode(pin, INPUT_PULLUP)

  • Like 1
Link to comment
Share on other sites

7 hours ago, Marci said:

Measure continuity between ground and each optocoupler. When you press RA- or RA+ in PHD, it should close the signal between the relevant optocoupler output and ground. ST4 is rock bottom basics equivalent of 4 push switches.

Should the common output of the ST4 be connected to ground?  If so, what provides the energy for the optocoupler? 

Link to comment
Share on other sites

50 minutes ago, kman42 said:

Should the common output of the ST4 be connected to ground?  If so, what provides the energy for the optocoupler? 

Yes. Power comes through the pull up resistor, either internally ( @pete_l's response)  or externally connected to 5 v. 

Link to comment
Share on other sites

1 hour ago, wimvb said:

Yes. Power comes through the pull up resistor, either internally ( @pete_l's response)  or externally connected to 5 v. 

This is where I get stuck - I'm struggling to understand how to wire the optocoupler. Is the below wiring diagram correct?

If it is, I also don't understand the coding. I thought I would need pins 2-5 (referencing below circuit) on the Arduino to be defined as INPUT in the arduino sketch, so that the Arduino can read the input signal from pins 2-5 and, in response, send a command to the stepper motor driver. But how do pins 2-5 act as inputs if they also need to output 5V to the optocoupler?

 diagram.png

Link to comment
Share on other sites

Ok now I'm really confused. I feel like I'm missing a key piece of information...

The circuit I posted above is one I found here https://github.com/kevinferrare/arduino-st4 

I am now realising it may not be the circuit that I need. Am I correct that the above circuit is for using an Arduino to send commands to a mount via ST4. Whereas I am trying to send commands from my camera, via ST4, into an Arduino. 

Quote

 If you don't know which voltage the ST4 port provides, you either use a series resistor, or an optocoupler, to protect the arduino inputs.

how do I wire the optocoupler if I'm sending commands to the Arduino?

Link to comment
Share on other sites

The circuit you have is indeed for sending data ('move' signals) to the mount from an arduino. AfaIk, historically ST4 consisted of relays, just on/off switches. I think that you should connect a voltmeter to your cameras ST4 port and read the voltages for signal /no signal. Eg connect the camera to phd2 and use manual guiding. Then issue guide commands of at least 1 s while measuring the ST4 output. If the voltage is only 5v, you can safely connect the cameras ST4 port to arduino inputs. Otherwise you can use opto couplers. Basically as in your current circuit but with the optocouplers pointing in the opposite direction. 

Link to comment
Share on other sites

On a VERY simplistic level, what I think you are trying to achieve is as below, i.e. the ST4 output camera is fed through an Optocoupler, for protection of the Motor Drive Control components, which themselves could comprise an Arduino Nano & DRV8825 drive board, which in turn drive the RA stepper motor....

Simple_Control.png.6066e2a96ff939790d1fe9608e188a14.png

Link to comment
Share on other sites

Disregard my previous post. I've been doing a little more thinking on this.

The problem with ST4 is that it's not a well defined standard. The ST4 port on a mount has 4 pins plus ground. As far as I understand it, a pin (RA+, RA-, DEC+, DEC-) is activated when it gets connected to ground ("short circuited"). This will in turn activate the RA/DEC motors.

A few years ago I designed a ditherbox that connected to my EQ3 mount in the same way as in @kman42's circuit a few posts back.

The transistors in the output of the optocoupler close the circuit for each ST4 pin.

A camera can have the same configuration internally. Again, as I understand it, it is the mount that provides the voltage/current on its ST4 port. Therefore, the ST4 port in a camera will most likely also have an internal optocoupler, where the transistor is the output pin. If so, you can just connect the camera directly to the Arduino, which has its pins defined as INPUT with the pull up resistors activated.

This link may be relevant:

https://www.cloudynights.com/topic/445303-anyone-ever-make-an-st-4-port/

If this is correct, the diagram that @Dr_Ju_ju posted shouldn't work. The ST4 port of the camera has no voltage on its output to drive the LED in the safety optocoupler, and the transistor in the optocoupler will always be in its off state.

Personally, I would just test it with the Arduino. Ie, I would connect one camera ST4 port pin to an arduino input. Activate the internal pull up resistor and blink the built in led whenever a guide pulse is received.

DISCLAIMER:

There is a small risk involved of course, which you may not be willing to take. Worst case: the ST4 port of your camera may die. 2nd worst case: an arduino input may die. Best case: it will just work. So, proceed at your own risk.

Link to comment
Share on other sites

I did say it was very simplistic, I was just trying to point out the control signal direction.

Personally, I wouldn't bother with ST4.  If there's a computer around that will be running PHD2 and storing pictures, then its a very small step to setup a complete system to drive\guide mount etc. using readily available free software....

  • Like 1
Link to comment
Share on other sites

4 hours ago, Dr_Ju_ju said:

I did say it was very simplistic, I was just trying to point out the control signal direction.

Personally, I wouldn't bother with ST4.  If there's a computer around that will be running PHD2 and storing pictures, then its a very small step to setup a complete system to drive\guide mount etc. using readily available free software....

What system are you talking about?

 The trouble is that I have heard about a few different systems that people have developed for autoguiding which sound great, but once I dig into the specifics it is very hard to understand them and/or get complete information, as most of the instructions I have found either assume way too much prior knowledge about coding/arduinos/RPi etc, or require you to use the exact same setup for anything to work, unless you modify the coding/software etc, which requires the previously mentioned prior knowledge which I don't have. 

I have come across ASTROEQ, which may be exactly what I'm looking for, but I figure I'm this close with the ST4 setup so I may as well see it through.  

Link to comment
Share on other sites

As long as you follow the simple picture I posted above (with or without the optocoupler) i.e. the ST4 output from the camera feeding into the Arduino, which in turn drives the stepper motor..... 

But you will still need some form of control via the Arduino, such that the mount is pointing at the correct place in the sky that you want to image, this will entail not only driving RA but DEC as well, that's why I suggested AstroEQ, as it turns a manual non-goto mount into a fully driven software controllable mount, but you lose any manual control .....

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.