Stepper motor control

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
Well after a small hiatus I ve returned to this project

I'd use a 100uF 35V electrolytiv for C5. The other caps aren't polarised types.
I ve just found a 100μF 35V in the parts storing room... well then I guess I will use that;)

Although some resources on the web recommend 1000μF. 50V. Is that really necessary?

I am wondering, this 35V has to be greater than the voltage I am using to power the motor, right?
I mention this because in one datasheet that used 20V they used a capacitor with 25V. In other that used a motor of 35V they used a capacitor of 50V (and 1000μF) 
In my case I will use a 24V motor so I think 35V would be safe.
EDIT: I just read and it seems so
The working voltage of a capacitor is the highest voltage that can be applied across it without undue risk of breaking down the dielectric layer.


What for exactly is this capacitor for? I am guessing to stabilize the voltage that powers the motors...
 
Last edited:

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
And talking about PWM for stepper motors (Sorry, I still don't understand why is it needed for :()
I found this manual:
http://www.robotshop.com/media/files/pdf/stepping-motor-control-module-1-ck-sm-004.pdf

and in the schematic in page 4 you can see they use a PWM signal applied to the REFA and REFB pins of the SLA7024 controller. I dont understand very well how those switches work there (can both be ON?) and why they put the possibility to exclude the voltage divider there, but at least it is a start.

Any comment on this please, would be really very much appreciated.
 

Alec_t

Joined Sep 17, 2013
14,333
Although some resources on the web recommend 1000μF. 50V. Is that really necessary?
The purpose of C5 is a charge reservoir to allow very brief high current pulses to be conducted along the 24V supply rail (if necessary) without the 24V supply voltage being significantly affected, which might upset parts of the circuit. Depending on your motor and any switching transients, 100uF may suffice or you may find you need a higher value.
they use a PWM signal applied to the REFA and REFB pins of the SLA7024 controller. I dont understand very well how those switches work there (can both be ON?)
The PWM signal is smoothed by the 2.2k resistor and 2200p cap to give a DC reference voltage REFA/B which is compared to the voltage developed across a current-sense resistor, for current-limit control. REFA and REFB are not switching signals, but both are needed at the same time.
 
Last edited:

Søren

Joined Sep 2, 2006
472
A couple of docs on the subject:

The most important - Jones on Stepping motors: http://homepage.cs.uiowa.edu/~jones/step/

Perhaps an easier read, but not as authorative: http://www.imagesco.com/articles/picstepper/01.html

Driving a stepper with PWM (Microchip): http://ww1.microchip.com/downloads/en/AppNotes/1307A.pdf

A very readable doc from Solarbotics: http://www.solarbotics.net/library/pdflib/pdf/motorbas.pdf

A few other reads on steppers
http://ww1.microchip.com/downloads/en/AppNotes/00907a.pdf
http://ww1.microchip.com/downloads/en/AppNotes/00906B.pdf
http://www.freescale.com/files/microcontrollers/doc/app_note/AN2974.pdf

That should keep you busy for a while ;)
 

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
Thank you I will start reading this now.
EDIT: Wow, I ve just started the first link but it is really good! Wish I would have had this when I started my study!
EDIT2 : Wow the microchip one is even better!! (and some parts are very similar)


Perusing the site that I put in my previous post, it says that the variable resistor in the voltage divider is to adjust torque and that the PWM is also to adjust torque.

That is news to me!... not to adjust speed but torque! wow

--------------
The PWM signal is smoothed by the 2.2k resistor and 2200p cap to give a DC reference voltage REFA/B which is compared to the voltage developed across a current-sense resistor, for current-limit control. REFA and REFB are not switching signals, but both are needed at the same time.
Difficult as it sounds, I kinda understood this now, thanks.
Reading the datasheet of the SLA7024M it says the maximum allowable VREF input voltage is 2.0V
Seeing this, putting the PWM as it says in the circuit of the previous post is wrong, isnt it?? It needs a voltage divider it seems.

On the other hand the datasheet talks about PWM output current! so it is not a voltage that is being PWMed as input, but the current of the motor!... and I suppose this changes torques???
 
Last edited:

Søren

Joined Sep 2, 2006
472
You wanna limit the current in 2 situations: To avoid saturating the coils and under locked rotor conditions (to keep the coils from overheating/burning). At all other times, you want hard control (=max current), just like you want a hard "grip" on a the voice coil of a hifi speaker.
Ramping should be done with a hard grip as well.

If you plan to use PWM, you need the controller to check the current feedback constantly (when a motor is running) and you need to find a function that suits your particular motor, to keep the coils from saturating and to avoid damage when an obstacle is held back - Probably just as easy to use a chopper (again tailored to your particular motors).
The higher the voltage, the more current can be poured into the coils in a short time and this matters if you want it to deliver the fastest performance.

You might consider distributed control, using a small controller for each motor (or two in one go) and just communicate the parameters back and forth. This makes it much easier to work with (programming as well as trouble shooting and keeping extra modules makes a pit stop childs play), as each module can be dealt with alone and your master controller will have less of a workload.
 

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
I am still reading the literature provided but I have a (important) question, that came to me while reading:
Take a look at the schematic



This plus reading the SLA7024M datasheet where it says:

Iout is set to meet the specified running current for the motor and is determined by:

Iout= (R2/(R1+R2)) * (Vb/Rs)
Now, in the circuit R1= 510, R2=100, Vb=5V and Rs <=1
so for these values Iout=(100/610)*(5V/1)= 0.819A right?

My motor though, says: Driving circuit: current 0.7A/Phase

so I am thinking that I should actually use a sense resistor not of <=1 (as the datasheet says) but >1.17Ω to achieve 0.7 A...

or change somehow the relationship of the resistors in the voltage divider...

Is my analysis correct?
 

Sensacell

Joined Jun 19, 2012
3,453
PWM comes into play in the realm of stepper motors when you entertain "Microstepping" which is where you vary the coil currents in-between steps to create a motor position resolution higher than the motor's inherent mechanical steps/revolution.


Google "Microstepping"
 

MaxHeadRoom

Joined Jul 18, 2013
28,699
My motor though, says: Driving circuit: current 0.7A/Phase
Is my analysis correct?
The correct continuous operating current is the value stated on the plate or manuf. spec, this value ideally is a constant from zero rpm through the rpm range , the problem is that as the rpm increases, this causes a increase in inductive reactance and tends to cause a decrease in current, and hence torque, a DC supply voltage is used that is this much larger than required to supply the rated current at zero rpm, however PWM control is used in order to maintain a Mean current at the spec rated value.
IOW, the ideal is a motor rated current through the entire rpm range.
Max.
 

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
I re-read Microchip's Stepping Motor Fundamentals and finally! I started to understand the whole "using PWM to limit current". :rolleyes:

So, it seems that to limit current in the coils I have to generate a PWM signal and this signal can be generated either by hardware or by software. Now, checking the datasheet of the SLA7024M it seems this PWM is already being generated by hardware , so I dont need to generate this from my PIC, cause software PWM is only needed when the circuitry of refrence and sense is not implemented.! Wow.

I would like someone to answer me this question: When documents say: "Stepping motors are often run at voltages higher than their rated voltage" , and if my motor specs say: ON DRIVE at DC 24V, does this mean that I have to use a power supply of more than 24 V?????

EDIT: Reading the datasheet of my motor for the n-time I finally understood! The rated voltage of my motor is not 24V but 5.95V with a resistance of 8.5Ω and a max current Imax of 0.7 A. The fact that I have to use 24V means that I am running this at a voltage higher than the rated voltage and therefore the PWM implemented by hardware (or if not by software) is needed.
That is why the voltage divider is needed, to provide a Vcontrol that in my case would be 0.7V (and the duty cycle of the pWM is 0.247)

I see!

Now I am guessing I can put a variable resistor there to experiment the influence of this on the performance of the motor. Is this a good idea???

what I dont understand yet is (looking at the datasheet page 9)
http://www.futurebots.com/7024.pdf

it says determing the PWM frequency with the resistor R3 and capacitor C1... I thought that this was done already by the reference and sense circuitry... I dont understand very well that Figure 7)....



(Also I dont understand quite well micro stepping yet... I get the concepts but not much else. Pluse PWM current control is not always connected to microstepping is it?)
 
Last edited:

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
What for is the RC timing network put in pins 2 and 11 in the SLA7024M??

I don't understand this part. I mean isnt the Off and on time defined by just comparing the V control with the V sense inside the driver? And that figure, I understand less.... :(

choppertimeoff.jpg
 
Last edited:

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
The RC components are the PWM frequency generating circuit. They set the PWM frequency.
But I thought the PWM (which is just a series of ONs and OFFs) is generated automatically (by hardware) by comparing the sense voltage (which is almost equal to the current) to the voltage of control given by the voltage divider??!!

Am i understanding it wrong??:confused:
 

Alec_t

Joined Sep 17, 2013
14,333
As I understand the circuit operation there are two PWM systems involved. The user's speed-control value sets the duty cycle of the first one. That PWM waveform gets smoothed out by an RC circuit to give an essentially DC signal REFA/B. The IC then compares REFA/B with the current-sense voltage and adjuststhe pulse widths of the motor coil drivers accordingly (i.e provides the second PWM), to control/limit coil current.
 

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
I would like for someone to explain me what does this circuit mean: (I have a general idea)
circuit4.jpg ]

I am referring to the part circled in red. The part I dont understand the most is the part circled in blue. I mean, to the left the Vref -Vsense is being calculated right? then this result goes out and what does that part in blue mean? current is coming in? out? I know it is supposed to give a "delay" but I have no idea how.

Is this an op amp? because in op amps there is feedback but this doesnt seem to be the case.
 

MaxHeadRoom

Joined Jul 18, 2013
28,699
The part circled appear to be the current feedback limit sense from monitoring the current through the 1Ω resistor.
The blue circle is a circuit wire connection point?
Max.
 

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
The part circled appear to be the current feedback limit sense from monitoring the current through the 1Ω resistor.
The blue circle is a circuit wire connection point?
Max.
Exactly!, a wire connection point. But this is connecting the output of the monitoring part with the output of the RC part, right??? How does these two combine?! I ve never seen something like this... usually there is some AND or OR os some other connection between two outputs but just connecting them raw??? what does this mean?
 

Alec_t

Joined Sep 17, 2013
14,333
As I read it the 'opamp' is a comparator with an open-collector output. The output is normally held high via R3 (and stabilised by C1), but is pulled low when the current-sense voltage exceeds Vref.
 

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
Ok, I implemented the circuit. Half (5V part) in a breadboard. the rest on a perfboard.

Results: nothing burned yet. :)
I can see something happening in the motor ... but the motion is strange. in the final act it rotated some, but between steps it seemed to be going forward and backward...

hummmmm

EDIT:Strange...I changed the program and now it does not move. Then loaded the first program (that made it move in the beginning) and no, it doesnt move anymore. I can hear the "hmmmmm" of the motor though... sigh...

Guess, maybe I can debug it with the pickit 3.. I hope...

Steppers don't get broken... do they??
 
Last edited:
Top