Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: izua on April 25, 2008, 10:50:36 AM
-
I'm trying to build an efficient stepper controller (with microstep capability).
Since chopper drivers are not exactly easy to make, I'm planning to control the current inside a winding via PWM.
The problem is - overvoltage is good for steppers, you get higher speed and torque, plus the ability to do microstep.So I'll want overvoltage. But kicking in more voltage will suck up more current, which has to be limited.
Building a presetable current source for this task might be overkill (and expensive, too), so I'm thinking that the microcontroller can pulse current instead.
Consider we have a motor rated at 5V, .5 Amps, so it will likely do good at 9V, ~1Amp. Say I'll push in 25Volts, the motor will require 2.5-3 Amps, and will likely burn. But pulsing 25Volts for a very short period of time won't give it enough time to overheat.
So, at 100% duty cycle I'll have 3Amps for sure (after the coil charges). At 33% duty cycle I'll have in theory 3Amps for 1/3 the time, but since coils don't charge (and discharge) instantly, I'll have somewhere under 3 Amps. We can say we have a RMS lower than 1 Amp.
I can vary this duty cycle between 0% and 33% and obtain substep accuracy without a hardware current limit. In my belief, anyway.
So, is this feasible? Will it work or I'll just end up blowing transistors and steppers?
I'd like some feedback and some more feedback if anyone has any experience in this direction.
-izua
-
If you are going to use a microcontroller and PWM, you could just have it calculate the power going to the motor using a current sensor:
voltage * PWM % * current = power
Then use the current reading for feedback - if power gets too high, reduce the PWM rate to compensate automatically.
-
So it can't be done in software alone, as an open-loop system.
Is there an IC for hardware limiting the current? In a chopper kind-of-way..
-
So it can't be done in software alone, as an open-loop system.
It wouldn't be open-loop, the current sensor makes it closed loop.
Is there an IC for hardware limiting the current?
Its called a current regulator. But you'd need to factor in voltage and PWM % as well to calculate power . . .
-
The problem is, the PWM also gives me substeps for the microstepping.
-
Anyway, my question is: how reliable is it if commanded only as an open-loop?
I'll do before some calculations, so I'll know what is my maximum pwm for a given motor and voltage (going overvoltaged). Then, the uc will just output the signals into H-bridges.
-
how reliable is it if commanded only as an open-loop?
Depends on the stepper and what the stepper is doing. If you build the whole system, then you can determine how reliable it is . . . you can always add trimming pots or ways to tweak it in software so that it works open-loop.
-
Well, what are the worst cases?
I'm building this as a universal stepper driver (geckos are expensive, everything else lacks either power or the easy-to-solder quality. as in bga).
Consider I have a stepper rated at 1Amp@5V (5W). I overvoltage it at 20volts.
power will be 20x4, 80. So my pwm will be limited to 5 x 100 / 80, ie 6.25%. (Yes, i just noticed that in my initial calculations, pwm shouldn't drop half when voltage doubles, since current doubles too. It should be quarter)
Now let's consider no microstepping, only full stepping.
What's the worst that could happen?
-
The worst that could happen? Since its open loop, some positive feedback could loop into it and cause it to constantly gain. Sorta like a microphone next to a speaker - high squelch and all. An uncontrolled gain would cause heating/melting, etc.
You'd have to calculate if the worst case scenario would cause thermal damage to your stuff . . . you could always use the thermister that comes with multimeters (at least with mine) to measure heating rates. There is a chance that the inside of the stepper would heat up much faster than the outside (where the thermister is located).
I suggest the tweaking method, you can experimentally ramp up your gain/voltage until you think its going to break. If you use a power supply, you can measure current and voltage real easy to determine power draw.
-
I don't think an open loop system can actually gain, since the gain has to be computed somehow from the current data.. And I don't have any data coming from the motor.
Another way I thought of - simply having a constant voltage (say, 30Vcc) and via a pot, let the user adjust manually the current through the stepper, which will, in turn, adjust the pwm rate. This way, no complex calculations would be done.
About the chip in the link you specified, Admin, (and other chips, too), do they react only in accordance with the current? Or will the voltage influence the output, too?
-
I don't think an open loop system can actually gain, since the gain has to be computed somehow from the current data.. And I don't have any data coming from the motor.
oops yea you are right, wasn't thinking on the 3rd . . . lol . . .
Another way I thought of - simply having a constant voltage (say, 30Vcc) and via a pot, let the user adjust manually the current through the stepper, which will, in turn, adjust the pwm rate. This way, no complex calculations would be done.
yeap, thats exactly what i meant in my previous posts! i recommend this path.
About the chip in the link you specified, Admin, (and other chips, too), do they react only in accordance with the current? Or will the voltage influence the output, too?
V=IR, and datasheets will mention tolerances :P
(I only use those chips for lab experiments, so I keep the voltages constant at all times, sorry for not being more helpful!)
-
So basically, every current monitor isn't a 'true' current monitor (detecting current from power and voltage), but merely a nice IC with a way of converting I * V to V.
But if I want to use variable voltage, I must measure that voltage, and calculate current from it, right? There isn't any way I can get how much current goes through something regardless of voltage, is it?
edit after some more experimenting: what exactly does the pwm reduce? For example, take 5V, 1Amp through a perfect wire, grounded via a perfect transistor (no rise/fall, no resistance, no losses). I'll send a perfectly square signal of 20khz with 50% fill rate. So half of the period I'll have 5V, 1Amp, the other half, 0V, 0Amps. That means I have an average of 2.5V, 0.5 Amps, which is half the initial power.
Is this correct?
-
There isn't any way I can get how much current goes through something regardless of voltage, is it?
V=IR
Can't really change that :P
For example, take 5V, 1Amp through a perfect wire, grounded via a perfect transistor (no rise/fall, no resistance, no losses). I'll send a perfectly square signal of 20khz with 50% fill rate. So half of the period I'll have 5V, 1Amp, the other half, 0V, 0Amps. That means I have an average of 2.5V, 0.5 Amps, which is half the initial power.
Is this correct?
Its not instant, but at steady-state, yes. 50% PWM is 50% current. Look up inductance to understand it better.