Need Motor 278971 Example of Propeller Spin Control
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 Parallaxs 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. Its 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
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 Parallaxs 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. Its 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
Maybe You want to be looking for Stingray stuff?
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.
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.
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.