Shop OBEX P1 Docs P2 Docs Learn Events
DC Servo position control — Parallax Forums

DC Servo position control

KenBashKenBash Posts: 68
edited 2007-07-09 20:55 in Propeller 1
I've managed to combine the HB-25 control and·the encoder feedback·programs to get a workable but still somewhat crude positioning function for a DC motor.· I know there are several downloads available for speed control but I'm not familiar with any that let you do accurate·positioning with a DC motor.·· I doubt that I am the first to need or do this. ··If so, I'd be happy to share the code·but like I said it's still pretty crude.

The optimum would be an assembly program that gets passed a position value where you want the motor (or two ) to be and it does the rest.· Does anyone know of a program that already does this?·

I'm replacing some Stepper motors with DC motors to take advantage of the extra speed. ·I don't mind spending the time, but I'd hate to be re-inventing the wheel if it's already been done.

Anyone know of anything already out there?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
" Anything worth doing... is worth overdoing. "

··············································· ( R.A.H. )
····································

Comments

  • RinksCustomsRinksCustoms Posts: 531
    edited 2007-07-09 19:32
    I'm not sure your going to be able to achieve what it is your looking to do. DC motors aren't that easy to position.· Why not just short the motors leads? Shorting the leads will only act as an effective brake, a short high current reversed polarity pulse will get the motor to act more like a stepper but the mechanical design allows for the motor to be turned slowly with little effort, ie, if you have this motor as a direct drive in a small robot and it's on a hill, once the reverse "burst" is done exeuting there is little to keep the robot from rolling down the hill. You would then have to provide for some kind of hold pattern consisting of quickly alternating switching from foward to reverse at a relatively low power level. Additionally, these techniques aren't recomended for a DC motor because the exess reversed current will likely damage the motor - brushed or brushless. EE theory dictates using components spec'd for twice the current and/or voltage the design calls for, otherwise a phenomenon known as thermal runaway may occur. aka the famous wikipedicrap definition of "magic smoke"rolleyes.gif

    If your motor control supports reverse, and i susspect it does, you might want to try a "burst" pulse of the reverse direction. Beware that trying to reverse a motor that is in motion presents extra load to the switching elements and may overload them! If MOSFET's are used, make sure they are rated for at least double the current the design calls for. At minimal, closely monitor the temperature of the MOSFETS and motor and if the temerature climbs above 130F/50C, stop and disconnect power immediately!

    Caution: The above information is given with a disclaimer that equiptment damage may occur, use this info at your own risk!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    E3 = Thought

    http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! The average PC while browsing the internet typically uses less than 30% of it's potential, why not donate a portion of the rest for cancer resaerch?
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-07-09 20:08
    Rinks,

    Its called a servo. DC motors are routinely combined with quadrature encoders to replace stepper motors in automation and CNC systems.

    Ken, check out microchips application notes, they have serveral descriptions of servo systems using encoders and PID control. As far as I know no one has implemented a servo drive on the propeller and if they have they are doing so for commercial reasons.

    Cheers,

    Graham
  • KenBashKenBash Posts: 68
    edited 2007-07-09 20:55
    Thanks guys.

    The HB-25 seems to be able to handle the power ( including reversing the motor when in motion ) just fine. I would like a bit more voltage than the 12 volts the HB-25 uses.. but as an inexpensive servo drive package, the HB-25 combined with the proto board should be hard to beat. Like I said, I've got it working but it's a bit clunky, I haven't really written it as a PID function and the pulse-width speed/direction control is a bit akward in a servo drive function. I was hoping someone else might have done it better. Guess I'll have to keep going.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    " Anything worth doing... is worth overdoing. "

    ··············································· ( R.A.H. )
    ····································
Sign In or Register to comment.