Shop OBEX P1 Docs P2 Docs Learn Events
Stepper Controller - Page 2 — Parallax Forums

Stepper Controller

2»

Comments

  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-02-10 19:19
    Sorry about the vague reply. What I was thinking about, was to make a circuit that would drive the maximum current through the coils, no matter how fast they are moving. I understand that the shorter the power pulse to a coil, the less time the current has to reach a maximum. This is why you need to increase the voltage at higher speeds. If you increase the voltage, dI/dt increases. I think that if you can discharge a higher voltage capacitor into the coil when you START to turn it on, you can overcome the inductance, then let your normal voltage carry the normal current. Now, matching these dynamic factors is where it seems tricky. That's what I meant by using PWM so that you effectively have a DAC as a voltage source to charge a capacitor each cycle.
  • JoergJoerg Posts: 91
    edited 2008-02-10 19:30
    And what i meant is that you need to regulate the coils current -> sophisticated interface do that!
    With a PWM control without feedback you will risk over current if not carefully handled.

    Saluti Joerg
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-02-10 19:36
    You say sophisticated interface... Wouldn't a simple shunt resistor in series with the coil, and an op-amp measuring the voltage across the resistor work? I mean, the op-amp can be configured so that it is a voltage follower, so that if the drop across the resistor is low(coil JUST turned on), then it boosts the voltage until the drop across the resistor(I*R) is where it should be? I hope you get the gist of what I just said... I'm not at my computer and cannot draw a schematic right now [noparse]:([/noparse]
  • JoergJoerg Posts: 91
    edited 2008-02-10 19:51
    That is more or less what's in a LM298! or in other stepper controller.

    Have a look at those integrated circuits. (Allegro (www.allegromicro.com) has them also.

    Saluti Joerg
  • Chuck McManisChuck McManis Posts: 65
    edited 2008-02-10 20:39
    Phildapil said...

    I've seen many power mosfets using a series resistor. However, I have never understood WHY. It seems that the resistor limits the amount of current going into the gate, thereby increasing the transistion time between off and fully on. The only thing I can think of is to reduce any resonance between the capacitance of the gate and stray inductance in the wire?
    Generally the resistor provides two functions, one is to limit inrush current and the other is lower the Q of what is effectively an RLC tank circuit to prevent oscillation. By their nature the gate of a MOSFET is a fairly delicate thing and exceeding the dielectric strength of the gate insulator for even a femtosecond can (and often does) destroy the device. International Rectifier has a number of good app notes talking about MOSFET driving circuits and their limitations but the best reference (in my opinion) is "Power MOSFETS" by Grant and Gowar especially chapter 8 which discusses gate drive circuits and the tradeoffs one must make. In general you want the lowest inductance and highest possible resistance to your gate to meet the minimum gate switching time. If you don't account for that, the 'ring' (which is the step response of an RLC circuit) can go over the max gate input voltage spec for your FET and toast it.

    That being said a chopper driver is not as hugely complex as some people have made them out to be, basically you put a shunt resistor in series with the coil if you're working with 1 - 5 amps it can be 1 ohm (note that for 5A you'd want a 25W power resistor to deal with that), and you connect it to a comparator with a voltage reference which is voltage you expect to see at the desired current. So putting some random numbers in, if you want a 2A current, the voltage is 2V across the shunt so you want a 2V voltage reference. When the voltage reaches 2 volts, the comparator goes high, you feed the output of the converter into an inhibit on the drive logic (or you simply invert and tie it to the FETs gate. It switches the drive circuit off, which causes current to go down, and the converter then turns off which enables the drive to go back on again. It provides a sort of "automatic" PWM to maintain the current at nearly exactly 2A. If you drive the comparator with the output of a D/A converter you set two currents, a "drive" current which can be high for moving the steppers and a "hold" current which can be lower as the steppers aren't accelerating anything.

    Note this works for DC motors as well because their torque is proportional to the current through them.

    As has been mentioned the reason you use a higher voltage is because it offers steeper current ramp making your motors more efficient. Since the motors are rated by the amount of current they can sustain through their coils, if you have a chopper you could drive them with 100v input supplies and they wouldn't care. If you can't modulate the current then you are stuck limiting the input voltage to something that, when you take into consideration the resistance of the motor's coils, won't exceed the current ratings. That will be a much less efficient way to drive your motors.

    --Chuck
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2008-02-10 21:35
    It's a shame there is so much time spent reinventing the stepper driver and not more on motion control, that's where the fun is [noparse]:)[/noparse]

    Graham
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-02-10 21:41
    Graham, what do you mean by motion control? Software, or eliminating backlash and other hysterysis type errors? I haven't written a single line of code yet, but have been thinking of how I would go about the motion itself and software to do it.
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2008-02-11 09:58
    Things like trapezoidal motion profiles with smooth acceleration and deceleration, then there are things like constant contouring and parallel kinematics and well there is lots of interesting stuff. I'm not saying you should be worrying about it but it can be really interesting.

    Software elimination of backlash it really only useful for positioning and machining in a single direction, in 2-axis contouring for example the machining forces can completely ignore your attempts [noparse]:)[/noparse] For robots of course things are different.

    Cheers,

    Graham
  • rjo_rjo_ Posts: 1,825
    edited 2008-02-11 15:07
    This discussion is perfect. Should be sticky!!!

    It would be nice to have a really smart universal stepper motor controller... plug the motor in, the controller tells you what it is and spits out the code you need to control it!!!

    Sorry... just dreaming[noparse]:)[/noparse]
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-02-11 15:23
    Ha! Actually, rjo, I've been thinking about JUST that! I'm always thinking up ways to make money, whether it's something I make, or do to sell. My idea is making a universal stepper controller using a single prop that is devoted to a tv output, a keyboard input, and the rest of the i/o pins used for controlling steppers. I'd program the prop so that you can use the keyboard and tv as a sort of setup. This way, you can tell it how many phases each stepper has, and what coil order to excite. Also, it would be used as a slave to another uC(maybe another prop?) in which it would commicate which stepper to turn, what direction, etc. via I2C. Again, just a dream, but maybe one day I'll do it!(or you)
  • JoergJoerg Posts: 91
    edited 2008-02-11 15:53
    Carissimi!

    This is exactly what MoCo should able to do!

    http://forums.parallax.com/showthread.php?p=705384

    The prototype is running, some simple stepper interfaces to, the stepper software module allmost finished!

    All the stuff can be put into DIN cases; there is no drilling etc. because the RAILTEC cases are build up like LEGO
    (at least somewhat like LEGO).

    The next step would be to build a software module where you can control up to four steppers (or DC-Motors) via your PC's
    USB interface!

    Saluti Joerg
  • rjo_rjo_ Posts: 1,825
    edited 2008-02-11 21:27
    Phil...and Joerg...

    I'm thinking that it would be good for the classroom... so you can throw everything into it, smart power etc[noparse]:)[/noparse]

    The Prop definitely has room for everything...

    Phil... there is no chance that I will do this... too many things on my list already and too little capacity(when I post my reed relaty controlled stepper you'll get a real clear picture of some of my limitations[noparse]:)[/noparse].



    Rich
  • Chuck McManisChuck McManis Posts: 65
    edited 2008-02-11 23:35
    I just want an Electric Etch-a-Sketch. I've got a small etch-a-sketch that was a giveaway at some trade show and the steppers but haven't had the time to put them together yet. Saw several at the Maker's Faire and figured it would be fun to build one.

    What I really like the Prop for however is as a potential stimulous generator for my workbench. I often need a variable width wave, or a series of pulses, or a serial bit stream, or a set of events to occur when some other event occurs and the propeller with a suitably flexible I/O infrastructure seems like a good place to start.

    --Chuck
  • bot-manbot-man Posts: 22
    edited 2008-02-12 00:31
    Yes, I am in Austin, TX. Sorry for the delayed response. It was a busy weekend.

    I think I looked at the same or similar batch of motors and decided my wife wouldn't appreciate me buying the entire lot.

    I would be interested in buying a few matching motors, if they are available.

    Paul
    PS-I used Austex because I figured a local would recognize it, didn't mean to be so vague...
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-02-12 02:19
    Paul,
    I kinda figured it was austin, tx, but wasn't sure. That sure would have been nice to stop by, show you the merchandise out of my trunk and truly be a traveling salesman for once... Well, I'd be happy to sell you as many as you want from the lot. I have 107 Nema 23, 4 phase, ~100-150oz/in torque motors. I also have 12VDC gear drives (about 1.25" type), and just about anything in between. This was a hell of a deal if I've ever seen one. Oh, the guy actually threw in 2 6N/m servos that weigh about 10-15lbs each, and a linear screw drive that is fantastic, especially for my CNC mill I'm going to make. I think I have about 4 or 5 ~200oz/in torque Nema 23 steppers too and some Nema 34's. Let me know what you want. I don't have many specs at all though. Visit the ebay auction page I posted to see the motors.

    Rich,
    Yeah, I'd love to make this universal stepper controller too, but I'm a college student and it seems any time I do have is study time. My first set of midterms will be over this friday, so maybe I'll use this weekend for the prop.
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-02-12 02:21
    By the way, I was fiddling with my stepper last night, and a power wire came loose, touched another one, and instead of a big flash-bang(I was using a 12V deep cycle directly), the motor spun continuously like a DC motor, but slower. This is a 4 phase motor, with 2 sets of series connected phases, so basically used as 2 phase. Any ideas???
  • bot-manbot-man Posts: 22
    edited 2008-02-12 18:49
    Was the stepper running at the time this happened? I wouldn't think it is possible for it to keep moving due to the way a stepper works, but if it was spinning at the time and had some mass on the shaft, it might run like a 1-cycle engine. (Probably not the right technical description. Thinking of an engine that fires once per revolution and sounds like it's always on the verge of stalling.)

    Post Edited (bot-man) : 2/12/2008 6:55:17 PM GMT
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-02-12 19:27
    Botman,
    Unlikely. To make it even more odd, the motor had MORE torque than when it was being "phased through" with the prop. The motor was, however, connected to the dual H bridge as normal, but the power was disconnected. In addition, the motor was stopped, and when power applied to the accidental wire, it would start in a random direction each time, much like an AC motor if power is applied when moving. I swear I'm not making this up! LOL
  • bot-manbot-man Posts: 22
    edited 2008-02-12 19:29
    I'd file for a patent, quick! Oh, wait, they don't let you patent perpetual motion & zero energy devices any more. smile.gif
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-02-12 19:33
    LOL, no the motor doesn't keep turning when power is disconnected! It runs like a DC motor when power is crossed with one of the leads.
Sign In or Register to comment.