OnStep to Servo or External Step/Dir drive


Jerry
 

Im putting together a little board that will allow you to easily hook up external stepper or servo drives with Step/Dir inputs. This sits in the same spot as one of the standard stepper drives and has a line driver that is connected to the pins that would be the connections to the windings. This gives differential signaling to external drives and can be used directly with drives that have differential input or optoisolator input, for drive with ttl input you could use a line receiver to get the TTL signal back. The board also has three optoisolated outputs that are driven from the Enable, M0, and M1 signals. 

I am using these with Mitsubishi servo drives on my mount. Enable will trigger the Servo On signal and M0 and M1 can control the built in electronic gearing function. It allows you to select up to 4 different ratios set in the drive parameters on the Mitsubishi drives that do the same thing as the Mode Switching used on the stepper drives. 

You could also use these with these little DC brushed servo drives: https://www.crowdsupply.com/citrus-cnc/tarocco These would be great for retrofitting and old meade mount so you dont have to try and scab in steppers. 

Link to oshpark here for the boards, ill make up a BOM once I have the component values verified.   https://oshpark.com/shared_projects/VFXztZs8

I have extras of the MaxPCB in black if anyone needs any. I am ordering boards for the smart hand control as well.

-Jerry


--Oz--
 

Very interesting, will look more into this later today. 


Butchf
 

This could be fun :)


Howard Dutton
 

On Sat, Jan 4, 2020 at 03:27 AM, Jerry wrote:
I am using these with Mitsubishi servo drives on my mount. Enable will trigger the Servo On signal and M0 and M1 can control the built in electronic gearing function. It allows you to select up to 4 different ratios set in the drive parameters on the Mitsubishi drives that do the same thing as the Mode Switching used on the stepper drives. 
The latest OnStep (master branch) has the SERVO driver type just for this kind of thing:

#define SERVO    16 // alias for SERVO1
#define SERVO1   17 // step/dir servo   driver with EN LOW,  allows M0 bit pattern for LOW = native mode & goto HIGH = 2x,4x,8x,16x,32x,64x, or 128x *larger* steps


Howard Dutton
 

On Sat, Jan 4, 2020 at 03:27 AM, Jerry wrote:
Im putting together a little board that will allow you to easily hook up external stepper or servo drives with Step/Dir inputs. This sits in the same spot as one of the standard stepper drives and has a line driver that is connected to the pins that would be the connections to the windings. This gives differential signaling to external drives and can be used directly with drives that have differential input or optoisolator input, for drive with ttl input you could use a line receiver to get the TTL signal back. The board also has three optoisolated outputs that are driven from the Enable, M0, and M1 signals. 
This will be nice to have.  Shame there is no easy way to rig a MaxPCB2 so all 8 RJ45 lines are available.  It should be possible though... a dremel to cut the traces between the RJ pins that tie pairs together for better stepper driver output current handling.  Then small gauge wires soldered into JS1 and JS2 (option intended to be used for the optional screw terminals) go to the En and M0 signals.  All before soldering down the RJ45 jacks of course.  Not sure why M1 would really be needed.


Howard Dutton
 

On Sun, Jan 5, 2020 at 04:21 AM, Howard Dutton wrote:
Then small gauge wires soldered into JS1 and JS2 (option intended to be used for the optional screw terminals) go to the En and M0 signals.  All before soldering down the RJ45 jacks of course.
... then make your own cables up to get the twisted pairs right.


Jerry
 


#define SERVO 16 // alias for SERVO1
#define SERVO1 17 // step/dir servo driver with EN LOW, allows M0 bit pattern for LOW = native mode & goto HIGH = 2x,4x,8x,16x,32x,64x, or 128x *larger* steps
Ahh, nice.


This will be nice to have. Shame there is no easy way to rig a MaxPCB2 so all 8 RJ45 lines are available. It should be possible though... a dremel to cut the traces between the RJ pins that tie pairs together for better stepper driver output current handling. Then small gauge wires soldered into JS1 and JS2 (option intended to be used for the optional screw terminals) go to the En and M0 signals. All before soldering down the RJ45 jacks of course. Not sure why M1 would really be needed.
Yeah, thats my plan, Cut the traces and run some wire wrap wire from the board to the freed up pins on the RJ45. Then make up a cable that has the twisted pars matched up for the differential lines. I just ran M1 to use up the rest of the RJ45 pins.

I ordered 6 boards from OSHpark if anyone else wants to play with this.

-Jerry



Jerry
 

Components are ordered. As soon as I get the boards I will put a couple together, I should have my MaxPCB together at that point to try it out. 


Jerry
 

The boards showed up from Oshpark today and i put them together. Took me a bit because I didn’t have a the board layout with me. 

I don’t recommend these for anyone else. I really need to combine the two boards into one because of the spacing between boards. I had to file the ends and bend the pins to get them to fit into the sockets. 

Got the jumper wires in place and cut the traces with an x-acto. Next I need to check for any shorts and program the teensy and check the outputs with the scope. 


On Jan 6, 2020, at 5:31 PM, Jerry via Groups.Io <jerry.biehler@...> wrote:

Components are ordered. As soon as I get the boards I will put a couple together, I should have my MaxPCB together at that point to try it out. 


Jerry
 

So far so good, I downloaded the onstep-master off github and got the teensy programmed and running. Looks like my little board works, at least with the step channel, I have not tried the other channels yet. 

I also tried pulse mode and it will probably work, the pulse on the teensy 3.5 is 1us which will work with a lot of stepper drives like the Gecko 203, 213, and a few others, it should work with the A4988 as well. 

Im also using the SERVO option. Howard, would it be possible to add an option to change the polarity of the enable signal, typically servo drives are enable high. Attaching some pics of the waveforms from the differential drivers. 


Khalid Baheyeldin
 

On Tue, Jan 21, 2020 at 02:05 PM, Jerry wrote:
So far so good, I downloaded the onstep-master off github and got the teensy programmed and running. Looks like my little board works, at least with the step channel, I have not tried the other channels yet. 

I also tried pulse mode and it will probably work, the pulse on the teensy 3.5 is 1us which will work with a lot of stepper drives like the Gecko 203, 213, and a few others, it should work with the A4988 as well. 

Im also using the SERVO option. Howard, would it be possible to add an option to change the polarity of the enable signal, typically servo drives are enable high. Attaching some pics of the waveforms from the differential drivers. 
Yes, you can change the polarity by selecting a different driver model.

Look at this file, lines 21 to 34, they have what you need.


Jerry
 

Ah. I did not see the servo2 option. 

-Jerry

On Jan 21, 2020, at 12:30 PM, Khalid Baheyeldin <kbahey@...> wrote:

On Tue, Jan 21, 2020 at 02:05 PM, Jerry wrote:
So far so good, I downloaded the onstep-master off github and got the teensy programmed and running. Looks like my little board works, at least with the step channel, I have not tried the other channels yet. 

I also tried pulse mode and it will probably work, the pulse on the teensy 3.5 is 1us which will work with a lot of stepper drives like the Gecko 203, 213, and a few others, it should work with the A4988 as well. 

Im also using the SERVO option. Howard, would it be possible to add an option to change the polarity of the enable signal, typically servo drives are enable high. Attaching some pics of the waveforms from the differential drivers. 
Yes, you can change the polarity by selecting a different driver model.

Look at this file, lines 21 to 34, they have what you need.


Howard Dutton
 
Edited

Note that for GENERIC and SERVO types the minimum pulse width is a recommendation and OnStep will only warn if your MCU is below that (where for other stepper drivers it won't let you compile.) 

For the T3.5 I measured 500ns pulse width, not sure why there's a discrepancy but I probably compiled for fastest code where you might not have?  I shaved a little off of my values to be on the safe side too so probably measured 600ns or so.


Jerry
 

I had just left it at default settings so that might be the difference but with overclock. I can check tonight and see if that makes a difference. 


Jerry
 

Tried doing the fastest compile option and the pulse dropped down to 870ns. 

Also checked the other axis and direction outputs and everything seems happy. Now I need to make up some cables to connect to the servo drives. 

-Jerry

On Jan 21, 2020, at 1:21 PM, Jerry via Groups.Io <jerry.biehler@...> wrote:

I had just left it at default settings so that might be the difference but with overclock. I can check tonight and see if that makes a difference. 


Howard Dutton
 

Thanks, I'll update the Teensy HAL with a slightly less constraining pulse width value for this T3.5 case.


Jerry
 

OK, I got off my lazy butt and connected the controller to the scope servo drives. it works, woo. It does not mind the sub-us pulses one bit.

I swapped the motors on the axises which brought them both too about the same resolution and with a 63/64 electronic gear ratio it makes a nice even 93392 steps/deg on RA and 86016 on Dec.

I did find a little bug with the boards I made, the 5v regulator I am using is going into thermal shutdown after they have been on for a while. I am guessing the high switch rate of the driver is drawn more current than it can put out, so I just tied into the OnStep 5v in parallel and it seems to be happy.

It moves pretty fast with the 3.5 even without the pulse multiplier, I am probably just going to stick with that for now. I do need the drop the acceleration down a bit, it travels further than it needs to.

Ill take some video later.

-Jerry

On Jan 22, 2020, at 6:26 AM, Howard Dutton <hjd1964@...> wrote:

Thanks, I'll update the Teensy HAL with a slightly less constraining pulse width value for this T3.5 case.


Ant No
 

Cool.

Ant👣


On 26 Jan 2020 22:03, "Jerry" <jerry.biehler@...> wrote:
OK, I got off my lazy butt and connected the controller to the scope servo drives. it works, woo. It does not mind the sub-us pulses one bit.

I swapped the motors on the axises which brought them both too about the same resolution and with a 63/64 electronic gear ratio it makes a nice even 93392 steps/deg on RA and 86016 on Dec.

I did find a little bug with the boards I made, the 5v regulator I am using is going into thermal shutdown after they have been on for a while. I am guessing the high switch rate of the driver is drawn more current than it can put out, so I just tied into the OnStep 5v in parallel and it seems to be happy.

It moves pretty fast with the 3.5 even without the pulse multiplier, I am probably just going to stick with that for now. I do need the drop the acceleration down a bit, it travels further than it needs to.

Ill take some video later.

-Jerry

> On Jan 22, 2020, at 6:26 AM, Howard Dutton <hjd1964@...> wrote:
>
> Thanks, I'll update the Teensy HAL with a slightly less constraining pulse width value for this T3.5 case.
>





Jerry
 

I ordered a Teensy 3.6 Tuesday and gave that a whack. I am getting pulses around 360-500ns depending on jitter. The drives still work fine at that pulse length. 

I goofed on the speed, I had the optocoupler hooked to the drive backwards and it was stuck in gear mode so it was moving way too fast oops!

Is there a way to slew at faster speeds from the phone/tablet apps?

Here is a terrible video of it doing it's thing. 

https://www.youtube.com/watch?v=JUkVx3zlYxs


Howard Dutton
 

On Thu, Jan 30, 2020 at 06:07 PM, Jerry wrote:
Is there a way to slew at faster speeds from the phone/tablet apps?
The primary slew speed setting is in OnStep's Config.h file... from there the Apps, etc. allow 1/2x to 2x that speed.