Community project - SX Stepper Controller
PLJack
Posts: 398
I've been meaning to work this project for some time now. Can't think of a better time to start than the first day of the new year.
Goal:
Create a highly versatile easy to use 4 axis high amp stepper controller.
There are easy to use stepper controller IC's but they are not intended for large motors.
There are controllers for large motors but they are expensive and often proprietary.
None that I know of are programmable.
Concept:
Create high amp stepper controller circuity that is driven by an on board SX chip.
The SX software will allow for at least three modes.
1) Autonomous mode:
Set it and forget it. Speed, direction, etc.
2) Manual mode:
Emulate an UCN 5804 chip or similar.
3) Pass through:
Allow full control via an outside pulse source. Such as parallel or serial applications.
Project Phase Overview:
1) Develop a very robust four coil stepper driver circuit. (Current phase)
2) Use the above circuit to create a four stepper motor controller circuit.
3) Start work on the SX software.
4) Develop the PCB layout.
5) Built one of many prototypes.
Unipolar vs. Bipolar?
I would like this controller to handle both types of motors.
I only have experience with Unipolar circuity. If anyone wants to work the bipolar side please jump in.
Community project.
I would love it if everyone worked together on this project to make the controller as robust and versatile as possible. Having said that, open projects scare me a little. They seem to spiral out of control allot. To prevent that from happening here I have to insist that I drive the project. (a bit terse in retrospect, just work together) I'm happy to do the leg work, build prototypes, and take suggestions.
This will be a completely open project. You are all welcome to the code and circuits.
If you don't like any of my decisions I encourage you to take any part of the project and start your own thread. (There it is again[noparse]:)[/noparse]
Enough of the disclaimers. Let's dig in.
This is what I have so far.
This shows a one coil circuit. It is repeated three more times for each stepper coil.
The test bed.
The stepper controller board.
An 8mb movie of the controller working.
MP4 Movie
This controller works very well.
It has about eight hours run time and so far no heat issues.
I would really like your input and suggestions on this coil circuit before I move on.
Can I make it better, safer, more robust?
.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
Post Edited (PLJack) : 1/4/2008 1:37:06 AM GMT
Goal:
Create a highly versatile easy to use 4 axis high amp stepper controller.
There are easy to use stepper controller IC's but they are not intended for large motors.
There are controllers for large motors but they are expensive and often proprietary.
None that I know of are programmable.
Concept:
Create high amp stepper controller circuity that is driven by an on board SX chip.
The SX software will allow for at least three modes.
1) Autonomous mode:
Set it and forget it. Speed, direction, etc.
2) Manual mode:
Emulate an UCN 5804 chip or similar.
3) Pass through:
Allow full control via an outside pulse source. Such as parallel or serial applications.
Project Phase Overview:
1) Develop a very robust four coil stepper driver circuit. (Current phase)
2) Use the above circuit to create a four stepper motor controller circuit.
3) Start work on the SX software.
4) Develop the PCB layout.
5) Built one of many prototypes.
Unipolar vs. Bipolar?
I would like this controller to handle both types of motors.
I only have experience with Unipolar circuity. If anyone wants to work the bipolar side please jump in.
Community project.
I would love it if everyone worked together on this project to make the controller as robust and versatile as possible. Having said that, open projects scare me a little. They seem to spiral out of control allot. To prevent that from happening here I have to insist that I drive the project. (a bit terse in retrospect, just work together) I'm happy to do the leg work, build prototypes, and take suggestions.
This will be a completely open project. You are all welcome to the code and circuits.
If you don't like any of my decisions I encourage you to take any part of the project and start your own thread. (There it is again[noparse]:)[/noparse]
Enough of the disclaimers. Let's dig in.
This is what I have so far.
This shows a one coil circuit. It is repeated three more times for each stepper coil.
The test bed.
The stepper controller board.
An 8mb movie of the controller working.
MP4 Movie
This controller works very well.
It has about eight hours run time and so far no heat issues.
I would really like your input and suggestions on this coil circuit before I move on.
Can I make it better, safer, more robust?
.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
Post Edited (PLJack) : 1/4/2008 1:37:06 AM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
The more refined the specs, the more control you will have for a community project. Anything left undefined is bound to be created exactly the way you DIDN'T want.
I'm up for the sx code. Do you want all for axises to move at the same time ?
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
·
I hear you Bean.
I can only spec out so far at the moment.
We don't have the hardware completed yet.
In this phase I only want to focus on the driver circuitry.
I was hoping the forums could help design a robust driver for one stepper.
Then we can simply multiply that by four to get our four axis controller.
The controller should handle up to 24 volts and 5 amps per motor.
I think the schematic I attached should work.
But it's my first attempt and I'm not really sure.
When we complete the driver schematic that should tell us what SX chip to use.
This will almost certainly be a SX48. If only for the advanced features.
That is wonderful news.
As in simultaneously?
If the controller is used on a CNC machine it would be used in pass through mode so the cnc software would take care of that.
If the controller is configured in autonomous mode I would think that simultaneous movement would be more precise.
So I would say yes.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
Post Edited (PLJack) : 1/2/2008 8:52:57 PM GMT
As an open project I think that releasing it in a variant of Basic would reach a larger audience than Assembly.
SX/B cranks along pretty fast at 50Mhz.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
-Phil
So, should I go ahead and physically replicate the coil circuit listed above?
This will require that I solder up 16 TIP120G's. I was hoping for some feedback on that circuit before I do that but it does seem to work pretty well.
As for the resistor on the SX I/O pins. I always like to see a resistor between it and the rest of the circuit.
Technically , with a diode right next to it, the pin should never see any incoming voltage.
But I like them there in case a bare wire or other VCC source brushes near the SX.
Right now I'm using 1K's.
Should I be using something larger?
Thanks.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
Currently working on the schematic and PCB design
I really like the PCB Artist software but I am having an issue routing for a QFP package (sx48).
I have an email in to the 4PCB tech support.
Anyone ever use this software before?
I'm trying to form a business relationship with a PCB fab company and have chosen 4PCB.
The PCB Artist software even does live quotes.
Here is hoping that the issue is between the keyboard and the chair and not with the software.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
are you going to use a current sensor/ chopper circut like Pminmo's or the more inefficent current limiting resistor.
i dont see either in your schematic. of course its just starting but thats one thing i would be looking at due to the fact you can burn up a stepper with too large a current flow, but in the cnc world its common to run steppers with up to 20 ( i think ) times the voltage they are rated for, just keep the amps to the rated max. ( i have used pminmo open source boards for both of the cnc routers i have built)
however his driver board, using the A3977 chopper is only rated for 32 volts/2.5A i think ( bipolar)
dan
That is just the kind of help I need.
After some research the chopper circuit seems like the obvious choice.
I recognized Pminmo's website. Been there before in my travels.
Integrating the chopper is next on my list now.
Am I right that if we use a POT for the current sensing resistor that we can easily adjust the current ceiling?
Found a nice PDF on chopper use here:
Drive.PDF
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
·a multi turn potentiometer that you adjust to a certain voltage value, depending on your motor max amps
dan
Current Control of Stepper Motors
Hope to make some progress tonight integrating the chopper.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
sounds like a lil experimentation is in order. but 20 Khz is pretty fast, do you think the sx can sense it and send the signal, or are you going to offload some of the tasks ?
dan
OK, you just confused me.
Granted I've never used a chopper but here is what I took away from that article.
I connect my sx pin (Activate Signal) to the AND gate.
Then connect the AND gate to the power transistor and the OR gate to the AND gate.
With the rest of the circuit in place I could keep an SX pin high a long as I wanted because the chopper would fire as needed to control the current.
The 20Khz is what a typical 5 volt stepper powered at 24 volts will chop at (20,000 times a second.)
So if I pulse (turn on) a coil on the above stepper for 2 milliseconds the chopper would fire roughly 40 times. With no need for interaction from the SX.
Is this not the case?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
Post Edited (PLJack) : 1/11/2008 11:59:18 PM GMT
looking at that diagram, i was wondering if you were going to sense the voltage above the sensing resistor ,which tells what the current is , with the sx
or use a different chip to do the comparison between the rising voltage and the ref voltage .
i figure you could use a chip ( no idea which one ) to do the comparison, then put the yes/no signal into the sx, and then fire off a activate signal, thus using the sx as both a control and a and circut.
but you prolly cant do compare,and activate both in the sx at 20khz.
however i am in noway a expert/elect enginneer.
i just play with cnc stuff
just a quick browse around and it looks like the traingle thing in the diagram...
is a comparator circut, and we prolly need make it a schmitt trigger type
dan
Post Edited (Sawmiller) : 1/12/2008 2:06:06 AM GMT
Dan:
When I was reading that article it did occur to me that the entire circuit could be reproduced via SX software.
The SX48 is a pretty powerful chip.
But there is no point in that until I fully understand what I am reproducing.
My first thought is to use a adjustable voltage regulator for the VREF and individual gates from an IC for the logic components.
Now you have me wondering what that "triangle thing" is.
Seems to me there should be a + and - symbol on that chip if it was something other than a simple gate.
Either way I have some time set aside this evening to work it.
If I see any magic smoke I'll know that I don't understand what I am doing.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
Post Edited (PLJack) : 1/12/2008 6:44:26 PM GMT
That is quite a chip.
Microstepping Driver with Translator
$3.00 on Digikey.
3/4 amp 24 pin IC per stepper.
In a round about way this is what I am trying to make.
Only higher amps.
In then end I want the SX to have a setting to emulate just such a chip.
I know, big plans. But even if I don't achieve this goal there is bound to be lots of good things to come from this project.
Like me understanding how the heck a chopper circuit works. [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
A couple of LM339 or similar IC's will give me 8 of them.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
heres a web page showing that circut i think
http://www.ecircuitcenter.com/Circuits/curr_src1/curr_src1.htm
just need to put the sx between the opamp and the mosfet
james the problem with those all in one chips, like A3977 and such is that they are limited to 2.5 amps or so, and they are comparativly expensive to a sx, opamp and some mosfets
thanks for starting this thread, im learnin stuff, pl
I'm using one quarter of a LM399 for my breadboard.
I could not get more than .6 volts to the TIP120 base.
I'll try again tomorrow and post some pics of the test bed and any questions I might have.
I'm not using a stepper for this test. Just working a one coil circuit for now.
My first problem was finding something that pulled some amps.
I think tomorrow I just use a resistor to ground for the amp load.
I had the AND gate in the circuit at first, but pulled it when the OP-AMP circuit did not work.
I'll start with a clean breadboard and try again.
The lowest resistor I could find is a 10ohm.
I'll have to look through my pile for something smaller.
NOTE:
I went to Radio Shack for the LM399, and guess what else was in stock.
Parallax PIR sensor's! I'm wrapping up my bench time tonight with the PIR so the night won't seem like a complete loss. [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
Post Edited (PLJack) : 1/13/2008 10:20:36 PM GMT
My goal tonight was to get one of the comparators of the LM339 to behave the way it should in the chopper circuit.
I started here:
Voltage Comparator Information And Circuits
That site states:
Basic Comparator Operation
Input Vs. Output Results
1. Current WILL flow through the open collector when the voltage at the PLUS input is lower than the voltage at the MINUS input.
2. Current WILL NOT flow through the open collector when the voltage at the PLUS input is higher than the voltage at the MINUS input.
Very simple indeed.
I did not have 5V and 6V available so I used 5V for the L [noparse][[/noparse]+] and 12V for the H [noparse][[/noparse]-] inputs.
I was unable to generate any voltage from the output pin.
I tried all four comparators on the LM339 with the same results.
Is this because of the 7V difference between the two inputs? (don't see how)
Did I fry my LM339 last night? [noparse]:)[/noparse]
I did learn a few thing today though.
One being that an OP-AMP is a bad choice for a chopper circuit. Apparently they are too generic and slow for this application.
That is one reason why they make dedicated comparators in the first place.
Also why the REF voltage on a chopper is so low. 1 volt or so. It's because you are measuring up from ground.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
Post Edited (PLJack) : 1/15/2008 1:50:51 AM GMT
I know this is already discussed:
After many variations of chopper experiments, a dedicated driver turned out to be the ultimate solution, although takes a lot of fun out of figuring the stuff out.
Allegro's A3986 is what I use on various bipolar projects, plug in your own mosfets with up to 50V, amps are a concern of the mosfets, so there is a lot of flexibility there.
The input are step and dir, with whole, half, 1/4 and 1/16 options, plus options for decay.
I have working boards in Eagle if anyone wanted to give it a go, all SMT except for the mosfets.
All good ideas.
Offloading the work to the SX has occurred to me.
And is still on the table.
Another great idea. I don't think I've ever seen that arrangement in a circuit before.
That would be a great technique for a low cost easy to build controller.
The one thing that keeps me working on the chopper is that I really like the idea of current control being built into the circuit with discrete components.
To that end I stopped at RatShack today and picked up another comparator.
We will see how far I get tonight.
Thanks for the input TChapman.
.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
That would be a very quick and easy project if he has those done.
I spent countless hours going down this chopper method road, the mostfet driver [noparse][[/noparse]of any sort that suits the app] is the way to go imo.
There is a huge write up about that chip on the CNCZone.
14 pages of board design only to find out that the 3986 is flawed.
You can get an idea of the flaw on the last page.
Unlike me who spent 40 minutes reading the whole thread only to find out the chip is not suited for DIY'ers.
I do like PMinMo's modular designs though.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
I have the 3986 running on 3 machines working stainless and aluminum with no issues, I never did phase error tests, as friction on a machine never allows for a perfectly linear motor-to-travel factor anyway. It is always "averaged" to some extent due to play in the table, energy transfer etc. I even have one machine which has dual X motors that operate in parallel off the same control signal, the system operates fine with Nema23's at 36 volts cutting precise parts and fine engraving tools. In my opinion, I have more than sufficient evidence for home DIY use, with the only exception being the soldering learning curve.
I suggest using some type of mosfet driver at least, IR2184 has been a very popular tried and true driver, there may be newer versions of the part or better versions from competitors. There needs to be some type of built in dead band protection, which the driver like 2184 will provide.
Well there you go, I stand corrected. Thanks for the correction.
If I am unable to design and build an easy way to adjust current load then I will start looking at dedicated stepper IC's.
It may be that my entire premise is wrong and there is no need for another stepper controller constructed of basic components.
But with a SX chip at it's heart, I somehow doubt that is true.
If so, it will be documented here.
If I do pull it off it could be an incredibly versatile board.
Sounds like you have been down this road before.
Please chime in when ever you can.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
Taking Step and Direction from a software like Mach3 or other is a useful role for the SX to convert it to 4 control signals per motor [noparse][[/noparse]assuming bipolar]. The Prop is better suited in my opinion since you can drive probably 4 bipolars easily, but certainly it is just a pref which processor. Either is easy in Spin or SXB, unless you really need high speeds at 1/16 res, then you may get a little bogged down. But on a home type system, this is not important, most cutting is slow speeds.
The I spent a lot of time on designing some CNC controllers, and finally ended up using the Prop as a sort of master that reads the Step and Dir input from 4 channels off Mach 3, then have the Prop read the encoders as well while comparing actual motor steps with the incoming steps, and stopping the system on some threshold of error. Real time error correction was not a desire of mine, since I want the machine to stop dead if there is an error, in case something has been hit by the tool or the tool has binded up in a part.
I think you really have to first identify what the end goal is, then make a plan. If it is a simple 3 axis machine that does not require encoders, then any PC CNC app plus your choice of SX or Prop Step and Dir to 4 channel decoding is very easy. Just set up some shunt off the low side of the fets, use a comparator, use a shift register for setting a fixed off time, use a latch to trip on over current, I may have some earlier drawings I can post, I just need to look back through my files.
Like I said, the main thing is first establish the ultimate goal. I would stay away from Gcode decoding, it's too cheap and easy to use software.
I like Mach3, and there is a free demo that is fully functional for smaller projects, I think 1000 lines of code which is ok for getting started. It is hard to beat this software.
From the PC, just make a board that accepts the various pairs of Step and Dir[noparse][[/noparse]DIN25], put in a PS, run the sequence in the SX/Prop, use an IR2184 for highside fet driver, some chopping, and there you go.
I'll look for the old files when I was working with chopping.