Shop OBEX P1 Docs P2 Docs Learn Events
Is the power supply big enough? — Parallax Forums

Is the power supply big enough?

big_markbig_mark Posts: 49
edited 2006-11-05 23:16 in Propeller 1
Hi

I want to use my Propellor dev. board to drive a bipolar stepper motor. I'm going to use an L293D motor driver and some simple logic to drive it in full step mode to start with (circuit on page 8 here, not sure why it needs two NOT gates on each input though : focus.ti.com/lit/ds/symlink/l293.pdf ). Since the chip runs on 5 volts and is TTL compatible I am assuming after reading the sticky that the Propellor can drive it ok?

The motor I am using is only rated at 4.25 volts, 0.425A per coil. First of all, will driving it at 5 volts do any damage (it must be driven at 5 volts as the motor power supply cannot be lower than the logic power supply)? Is the 5 volt supply on the dev. board able to deliver that much current? And is it a good idea to run the logic and motor from the same power supply? I only intend to use my dev. board to prototype my control software and hardware and will be building my own circuit when testing is complete, so finding space for additional components won't be a problem.

Thanks

Comments

  • Graham StablerGraham Stabler Posts: 2,507
    edited 2006-11-04 11:26
    The ratings can be confusing, they tell you that when run at 4.25v the motor will draw 0.425A, this means that if you drive circuit can stand 0.425 amps you don't need to current limit if you drive the motor at 4.25v. It also tells you that the maximum current that should be put through the motor is 0.425A.

    What is is not saying is that no voltages higher than 4.25v can be used in fact steppers are very often driven at much higher voltages(up to 20X) to get more speed. HOWEVER if running at higher than the rated voltage the current should be limited. This is often done with PWM or in some cases resisters.

    So to answer the question more directly, if you drive the motor at 5v it will draw more than the rated current which is bad for the motor. What's more that is 0.425A per phase so the total load on the supply will be 0.85A. I think the regulator is fine with that, I'm not sure about the wallwart.

    Graham
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2006-11-04 12:32
    I think that you will find that even if the regulators did handle that kind of current (they don't) or that kind of power dissipation of (Vin-5V)*(0.85A+devboard) which they don't, that you just would not want to power a heavy inductive load off the same regulator as the processor. Doing so is a guarantee that the spikes from the heavy current switching and the inductive load will play havoc with the processor.

    Graham is right though when he says that steppers are usually powered from a much high supply voltage and usually pulse-width modulated. My advice would be to run it off an unregulated DC supply in the 12 to 24V range that can handle the high-current peaks and to tie the ground of the logic back to the motor supply ground. That really depends on the wiring but you want to avoid "ground bounce" etc.

    The 293 has a minimum high-level input threshold of 2.3V so it is quite ok to drive it from the propeller directly. The four inverter gates that are shown on page 7 of the datasheet are really there to allow the 293 to be driven with 2 inputs rather than 4. Of course it would only need 2 inverters anyway but there is no problem in driving all 4 inputs directly without inverters. It isn't all that hard if you are doing PWM to do half-step or even micro-step if you want, the propeller is more than up to it.

    BTW, my experience with TI brand 293's was that they just do not handle inital peak currents as well as some other brands even though the spec sheet looks good (smoke).

    *Peter*
  • big_markbig_mark Posts: 49
    edited 2006-11-04 14:30
    Thanks for the info. guys. I am very much a newbie when it comes to electronics, so any help you give is very much appreciated.
    Graham Stabler said...
    What is is not saying is that no voltages higher than 4.25v can be used in fact steppers are very often driven at much higher voltages(up to 20X) to get more speed.

    Really? I'll add this to the things I wish I'd known earlier! And there was me getting worried about supplying an extra 0.75 volts. Doh!! I've been looking at chips to drive my motors, but rejected most of them because they specified a minimum motor supply voltage of 10 volts.
    Peter Jakacki said...
    ...you just would not want to power a heavy inductive load off the same regulator as the processor. Doing so is a guarantee that the spikes from the heavy current switching and the inductive load will play havoc with the processor.

    I am using the L293D which has diodes built in. Won't they send any harmful back-emf to ground?
    Peter Jakacki said...
    Graham is right though when he says that steppers are usually powered from a much high supply voltage and usually pulse-width modulated. My advice would be to run it off an unregulated DC supply in the 12 to 24V range that can handle the high-current peaks and to tie the ground of the logic back to the motor supply ground. That really depends on the wiring but you want to avoid "ground bounce" etc.

    I am planning on building a DMX-controlled two-axis moving-mirror for use in the theatre where I work. My setup will be powered by a dmx/power distribution unit which we already own. It sends out DMX and 48 volts DC, so the propellor, logic chips, and motors will all get their power from the same place. Obviously each part will need its own regulator to step the voltage down, but they will all be sharing the same ground. Also, since I'm using bipolar motors, the only motor-ground is whatever comes off the L293D. What do you mean by "ground-bounce"?
    Peter Jakacki said...
    BTW, my experience with TI brand 293's was that they just do not handle inital peak currents as well as some other brands even though the spec sheet looks good (smoke).

    I'm actually using the L293D from ST Microelectronics (www.st.com/stonline/products/literature/ds/1330.pdf). Its functionally the same as the TI part, but ST's spec sheet did not include a circuit diagram.

    Many thanks
  • Mike GreenMike Green Posts: 23,101
    edited 2006-11-04 16:14
    "ground bounce" is when a motor or other high current load is switched on suddenly and the high current through the ground wiring causes enough voltage drop so that the "ground" at one point in the logic circuitry is different from that at another point. You have to run the grounds (logic and motor) separately to avoid this (and also be careful not to create "ground loops").

    The back EMF diodes don't protect you from a power supply "sag". Most power supplies don't respond that quickly to sudden high current loads and their output voltage will drop for a short time until the regulator can adjust. There's a lot of "room" to sag from a 48V power supply, so, as long as you have separate regulators for the logic and motors, you should be fine. I assume that, with the high voltage drop (48 to 5), you're using switching regulators. If not, most of that voltage drop will go up in heat ... not good for the regulators.
  • big_markbig_mark Posts: 49
    edited 2006-11-04 16:48
    Mike Green said...
    You have to run the grounds (logic and motor) separately to avoid this (and also be careful not to create "ground loops").

    How will this be possible if I only have one ground for everything? (DMX, Propellor power, logic power, motor power, etc) Also the L293D chip has 4 ground pins, which I assume are all connected to each other. How do I separate logic and motor ground if they are connected internally? Do you mean that I should use some sort of star-grounding setup where logic grounds go to one point, motor grounds go to another, and both points get connected to the power supply ground? This setup is often used in diy audio amplifiers.
    Mike Green said...
    The back EMF diodes don't protect you from a power supply "sag". Most power supplies don't respond that quickly to sudden high current loads and their output voltage will drop for a short time until the regulator can adjust.

    Will a capacitor between ground and the regulator output go some way to compensate for this voltage sag? If so, how big does it need to be? Failing that, can regulators be connected in parallel to boost current output?
    Mike Green said...
    I assume that, with the high voltage drop (48 to 5), you're using switching regulators.

    I haven't actually got that far in the design yet. I am just in the process of getting the software written and the motors spinning, but if switching regulators are what I need then that is what I will get.

    Once again, many thanks for the advice.

    Mark
  • Mike GreenMike Green Posts: 23,101
    edited 2006-11-04 18:38
    Ground current problems with logic are not that different than those with audio. You need one central ground point with a heavy wire/ribbon/strap to the motor ground point on the H-bridge "board" or first the power supply board for the motors. You then need a separate logic ground that goes to the logic supply, then out to the various logic boards or board areas. As much as possible, avoid ground loops. You may have one anyway given that the H-bridges don't have isolated logic pins. That's not a big problem because: 1) You're using a low resistance connection for the motor current. 2) You're not separating the circuits by more than a few inches or maybe a foot. 3) The voltages involved are way higher than the audio where you're concerned about millivolts of induced ground loop voltage.

    You will definitely need to use switching regulators because of the high voltage drop. Say you really do run the motor off 5V and it draws 4A. Peak draw will be higher, but lets just look at the average current. You need to dissipate 43V x 4A = 172W. Even if you run the motor off 24V and use PWM (pulse width modulation) to keep the average current to 4A, you're still dissipating 24V x 4A = 92W in heat in the voltage regulator. A switching regulator gets around this, but still has the problem of response time. With most modern high speed (100KHz+) switching regulators, there'll be a couple of cycle lag, but with a motor that shouldn't be much of a problem.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2006-11-04 18:56
    Mark,

    When computing the motor voltage supply (assuming you won't be doing any current regulation), be sure to consider the drive transistors' saturation voltage at the chosen current. For ST's L293, this is about 1V at 0.5A for each transistor, or 2V total. (The L293D's datasheet doesn't show a saturation curve, but it's probably the same.) So to get the 4.25V you need for each motor, you'll have to have closer to 6V for the supply. The high saturation voltage also means these chips will dissipate about 2W (2V * 0.5A * 2 sections) of power. That's a lot for a 0.3" DIP, so a good heatsink will be mandatory.

    If you want to use a higher voltage with PWM current regulation, use the L293E. This device brings the drive transistor ground connections out separately, so you can attach a current sense resistor. This will not only give you faster response, but will also facilitate more precise microstepping than a simple PWM on the enable inputs can. (Microstepping may be necessary in your app, since discrete steps will get magnified between the mirror and the stage. If you want smooth motion, microstepping would be the way to go.) Of course, this adds a bit of complication to the circuitry, as the L293E datasheet suggests.

    But I wonder if all this might be overkill for your app. You didn't say how big your mirror is. But a couple hobby servos would have plenty of torque for driving a small mirror. Plus you don't have to worry about position feedback, since that's built in to the servo. Just a thought...

    -Phil
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2006-11-05 13:22
    Each coil has a power rating of 4.25V @0.425A = 1.8VA. Even if you energize both coils at full power continuously that means your power-supply only needs to be rated at a minimum of 4W or so. At 24V that means less than 200ma average and even though you could regulate this fairly easily IMO I find this redundant as the PWM effectively does this for you. The peak current is supplied by a suitable electrolytic capacitor across the supply rails. Of course if you use the 293E as mentioned then you can also sense the current and then you can regulate it precisely. When the stepper is not moving you can reduce the "current" to a much lower level to hold the motor in that indent so really your long-term average power requirements are very low.

    At these high voltages the peak currents can be very high if you do not PWM at a high enough frequency. When voltage is applied to an inductor the current lags behind the voltage which in simple terms means that initially it does not draw any current and over a short period of time the current will increase to a point which matches the DC resistance. If you applied 24V to the coil without PWM then you would have I = V/R = 24/10 = 2.4A flowing within milliseconds or less and eventually cooking the coil (don't do it). If you are worried about this then you can place a polyfuse or some suitable current limiter (even a lamp) in the supply lines to protect the motor while you are doing your testing. However, seeing this is all new to you I would suggest working with a low-voltage initially until you get it fairly right. Using a higher supply later allows more torque at faster stepping speeds etc.

    Ground problems are things to watch out for when mixing logic and power devices. The ground or common is not a perfect conductor and exhibits some resistance and inductance. At low freqencies and low currents you will probably never know about it but it's there and it certainly shows up while switching high-current loads. But to try and explain even 1% would take too long and it would be more beneficial if you look-up the relevant info yourself or just stumble about and make a few mistakes. The latter method tends to make a deeper and more lasting impression and besides, making mistakes is definitely part of the learning process, just ask me [noparse]:)[/noparse]

    *Peter*
  • big_markbig_mark Posts: 49
    edited 2006-11-05 23:16
    Phil Pilgrim (PhiPi) said...
    Microstepping may be necessary in your app, since discrete steps will get magnified between the mirror and the stage. If you want smooth motion, microstepping would be the way to go.

    I'm hoping that micro stepping won't be necessary, at least to begin with. The motors I've got do 400 steps per revolution in full-step mode, and 800 in half-step mode! My mirror will be panning 115.2 degrees (256 steps * 0.45 degrees per step). and tilting 57.6 degrees (128 steps * 0.45 degrees per step). It only needs to tilt that far because 1 degree of mirror tilt equals 2 degrees of beam movement. When I've finished building it I'll post some pictures, but until then here's where I got my inspiration from : www.rosco.com/us/lightingequipment/icue.asp

    If I do need to use microstepping to smooth things out, I'll most likely use one of the chips from Allegro. They do microstepping, PWM current control, and they even have a translator built in. All I'll need to give them is a direction and step and they do all the hard work for me. This one seems most promising : www.allegromicro.com/sf/3987/ The only downside is I'll need to learn to solder surface mount components first!
    Peter Jakacki said...
    But to try and explain even 1% would take too long and it would be more beneficial if you look-up the relevant info yourself or just stumble about and make a few mistakes. The latter method tends to make a deeper and more lasting impression and besides, making mistakes is definitely part of the learning process, just ask me

    Absolutely! Thats the main reason I'm doing this. I mean, I could have gone out and spent less on buying a couple of the iCue systems mentioned above than I will do building my own version, but I would not be learning nearly as much. I see this whole process as being as much about learning more about electronics and software as it is about producing a working moving mirror. I've already learned quite a bit about serial comms from my earlier thread about my DMX software, and all the information in this thread has been extremely helpful as well. Many thanks to you all.

    Once all the hardware and software is complete, I will be posting all the source code and circuit diagrams here in the hope that some of you find it useful for your own projects. I feel it would be unfair to all of you who have so willingly given me help and advice if I didn't, and more than a little ungrateful.

    Mark
Sign In or Register to comment.