Shop OBEX P1 Docs P2 Docs Learn Events
Need Motor 278971 Example of Propeller Spin Control — Parallax Forums

Need Motor 278971 Example of Propeller Spin Control

LarryCardoLarryCardo Posts: 28
edited 2011-02-21 08:41 in Robotics
I had this posted on the Propeller forum and received little info.

I am looking for an example of spin code to control the motor.

In my effort to simplify (counting of encoder pulses and motor control functions), I purchased what I thought would be a simple system solution. Using the Propeller Chip and Parallax’s Motor (#27971), H-bridge (#29144) and Position controller (#29319). I plan to initially use these parts to design a sort of balancing bot (The bot will balance a pole that extends from the chassis).

The literature indicates motor control is obtained by simplify specifying:
-Max speed value
-Speed ramp rate
-Travel distance

I am just looking for a simple code sample that would output this info to the controller. It’s like a picture is worth a 1000 words. I have searched the forms and have not come up with anything. The literature supplied with the hardware, only gives examples of using the Basic Stamp, not the Propeller using the total system (Controller, H-bridge and Motor).

I understand the system hardware wiring.

Larry Cardo
Mentor, OH

Comments

  • TtailspinTtailspin Posts: 1,326
    edited 2011-02-04 21:47
    Sorry You couldn't find anything in the OBject EXchange,

    Maybe You want to be looking for Stingray stuff?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-02-04 22:20
    I don't know if there is such an example for the Propeller. You'd use the FullDuplexSerial object that comes with the Propeller Tool to control the position controller.

    There are delays in communication between the Propeller and the H-Bridge and between the position controller and the Propeller that may affect your control loop. The HB-25, because it behaves like a servo, expects 1-2ms control pulses about every 20ms to set the motor speed. The position controller uses commands involving 1 to 3 bytes at 19.2KBps. That would take about 0.5 to 1.5ms per command, maybe more.
  • cdecde Posts: 37
    edited 2011-02-07 12:46
    Hi Mike,

    Which IC would you recommend as a driver? The TC442X from Microchip looked appropriate to me, http://www.farnell.com/datasheets/79490.pdf
    An additional stage might be required, but for small gearbox motors I tought the peak 6A MOSFET would be enough to drive a 12V DC motor that consumes at most 400mA. The TC4420 could be replaced with MC33151.
  • cdecde Posts: 37
    edited 2011-02-07 13:44
    cde wrote: »
    Hi Mike,

    Which IC would you recommend as a driver? The TC442X from Microchip looked appropriate to me, http://www.farnell.com/datasheets/79490.pdf
    An additional stage might be required, but for small gearbox motors I tought the peak 6A MOSFET would be enough to drive a 12V DC motor that consumes at most 400mA. The TC4420 could be replaced with MC33151.

    After a bit more research the L293N looks like the proper choice.
  • LarryCardoLarryCardo Posts: 28
    edited 2011-02-21 08:41
    I found 3 programs which assisted me in programming the motors.

    MPC_Roll_Demo.spin

    Wheel_Controller.spin

    WC_TestHarness.spin

    These examples helped me solve the confusion of wiring the motors, selecting a motor ID and the proper reverse command for one motor.
Sign In or Register to comment.