Shop OBEX P1 Docs P2 Docs Learn Events
[Solved] Motor Control Guidance — Parallax Forums

[Solved] Motor Control Guidance

bdjbdj Posts: 5
edited 2010-04-14 19:24 in Propeller 1
Hi there,

Long time lurker, first time poster.

I'm hoping I can get some quick guidance on motor control using the Propeller chip. I have this motor ( sine.ni.com/nips/cds/view/p/lang/en/nid/203937 ) in a prototype system I'm currently controlling with LabView (giant computer, ridiculous USB connections, etc.). I've transitioned all of the other pieces of the prototype over to Prop control, but the motor part still escapes me.

Any direction on motor control basics would be much appreciated. I'm sure I can figure it out if I have a decent example or even knew which motors work well with the Prop.

I'm thinking I can use this ( www.parallax.com/Store/Accessories/MotorServoControllers/tabid/160/ProductID/491/List/1/Default.aspx?SortField=ProductName,ProductName ) to control the motor, but I'm really not certain at all.

Thanks!

Ben

Post Edited (bdj) : 4/14/2010 7:24:25 PM GMT

Comments

  • kwinnkwinn Posts: 8,697
    edited 2010-04-06 13:13
    bdj, that Pololu controller is for DC motor control. What you have is a stepper motor, which uses a different controller. In many ways a stepper motor is easier to control than a DC motor. The prop should have no problem controlling that motor.

    The simplest would be to reuse the existing stepper driver if possible. If you have schematics of the motor and drive circuit post them so we have enough information to make suggestions.
  • bdjbdj Posts: 5
    edited 2010-04-06 14:11
    Kwinn, thanks!

    The motor (linked above) is connected the existing driver, a Danaher P70360 (Quick Start: www.kollmorgen.com/website/com/eng/download/document/200606231504340.P7000ACQS.pdf or Manual: www.kollmorgen.com/website/com/eng/download/document/P7000AC___Revision_F.pdf ). The driver is connected via the Command I/O (rather than the serial connection shown in the quick start guide) to a National Instruments Universal Motion Controller (UMI-7772) which is in turn connected to a board in the computer. You can see why I'd rather use a micro controller.

    My limited understanding of the motor is that it requires a certain series of pulses on the four wires to drive it. I'd be totally fine programming one myself if I could figure out what was required. We are using the Prop Demo Board for the other pieces so I have no shortage of connectors. Also, I don't really require the full functionality of the driver. We need single axis motion (either forward or backward or alternating between the two) and it is slow enough that acceleration isn't a huge issue.

    Any direction would be much appreciated.

    Ben
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2010-04-06 14:56
    Those drives can be driven with step and direction pulses, one input sets the direction and the other makes the motor step. It is as simple as providing the motor with a pulse train, the frequency dictates the speed. You can do proper acceleration profiles on the propeller so the motor accelerates to a maximum speed and then decelerates to reach its destination.

    So keep the drives but loose the NI motion controller, you only need the two signals to make the motor move.

    If the driver is really a problem you can by them very cheaply these days on ebay and the like.

    Graham
  • bdjbdj Posts: 5
    edited 2010-04-06 15:26
    Graham, that sounds good to me.

    But, being a relative novice with micro controller motor control, an example would be really helpful. Or a favorite Object. Or a crude diagram on the back of a napkin. I guess I'm not even sure where to start with generating a pulse train for this motor.
  • KenBashKenBash Posts: 68
    edited 2010-04-06 15:28
    hi Ben,

    If this motor has 5 or six wires coming out of it, then the control for it should be really simple, you provide power to the centertap wires for the coils then hook up 4 darlingtons as pull-downs to the other four phase wires. The sequence of turning these phases on or off will step the motor forward or backward. The easiest way to sequence the phases is to set up a look-up chart having the correct phase stepping with the desired direction used to pull the next phase sequence out of the table. 4 phase combinations for full step 8 phase combinations for half-step drive.

    If you only have 4 wires it gets a bit more tricky, you have to provide something similar to an H-bridge drive for each of the phases giving you 8 transistors and a bit more complex lookup chart. You also have to be careful never to have the "Wrong" outputs turned on at the same time or you will rapidly enjoy the smell of freshly smoked transistors. I suggest hooking up a cheap used stepper first and playing with it before going on to your "Work" system.

    Ken B.

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

    ··············································· ( R.A.H. )
    ····································
  • bdjbdj Posts: 5
    edited 2010-04-06 19:21
    Thanks, Ken.

    The motor is indeed a 4 wire job (well, actually, 5 wires, but one is ground).

    In the absence of a straight forward solution for what I've got on hand (and if I have to buy something anyway), does anyone have a recommendation for a simple drive system for use with the Prop? The stepper motor was convenient for tracking position, but there are obviously ways around that, so I'm open to anything at this point.

    Thanks all.

    Ben
  • Christof Eb.Christof Eb. Posts: 1,377
    edited 2010-04-06 21:04
    Hi Ben,
    if you want to know the exact position and/or exact speed of the motor, then a stepper motor is a very good choice.
    Stepper motor drivers can be bought. Either they have a direction and a step input, or they have a pattern input. Your existing driver has got microstepping possibilities. So you should check, if a simple full or half step driver gives enough resolution (steps per revolution). For example the L298 is a chip to drive a step motor. It needs a pattern input. http://www.datasheetcatalog.com/datasheets_pdf/L/2/9/8/L298.shtml.
    There are two coils in the motor, the pattern of the current can be for half steps:
    1: 1 0
    2: 1 1
    3: 0 1
    4: -1 1
    5: -1 0
    6: -1 -1
    7: 0 -1
    8: 1 -1
    9: 1 0 as number one.

    There are stepper drivers in the obex.

    Good luck!
    Christof
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2010-04-06 21:55
    Ben, a stepper is perfect, you have the motor and a drive already. If you made your step pin go high and low 15 times the motor will step 15 times, it is as simple as that to begin with.

    Graham
  • hover1hover1 Posts: 1,929
    edited 2010-04-06 22:11
    I'm not sure that's a good quote. It is possible to stall stepper motors by ramping too fast or by hitting a hardware stop. In this case the software would think it got to the correct position, when in fact, it did not. I did not see any feedback mechanism in the OP data sheets.
    ·That said, being carefull to ramp speed within the motor's capabilities and load considerations, and have a track that will not bind, then my vote is for the stepper. Positional accuracy is very good.
    Jim
    Christof Eb. said...
    Hi Ben,
    if you want to know the exact position and/or exact speed of the motor, then a stepper motor is a very good choice.
  • bdjbdj Posts: 5
    edited 2010-04-14 19:24
    Thanks for your help guys. Using some of the objects in the OBEX and the L298 chip on the Demo Board, I was able to supply a pulse train (just 1, 0, 1, 0...) to the existing driver Command I/O pins.
Sign In or Register to comment.