What do you like in a SOFTWARE Motor Controller?
October 15, 2010
CTC & I were shouting and the topic came to smart motor control. Strangely, I have was working on a motor control software interface, and thought, what a great opportunity to ask, "What would you desire in motor control?"
My interface commands currently looks like this :
- attach (controller, directionPin, powerPin) - attaches the motor to a specific power & direction pin on a controller
- detach () - detaches motor from controller
- move (speed) - speed is a float 1 <-> -1, 0 being stopped, 1 to -1 so that all motors have a concept of full tilt = 1 and full tilt in the opposite direction = -1
- moveTo (position) - this will be controlled by a feed back device (encoder, halls effect, etc) - position is absolute
- incrementSpeed(value) - allows you to speed up or slow down an incremental value +/-
- incrementPosition (value) - allows incremental moves to position
- stop() - stops motor
- stopAndLock() - stops and locks motor, so no other commands can affect it until the lock is removed
- unlock() - unlocks motor
It supports 2 bit motors (heh).
There are 2 simple ways to make h-bridge controllers for motors
- smart H-Bridge is where 1 line control power (pwm typically) and 1 direction
- the other is Burnable - where 1 line controls each side of the H-Bridge - setting both bits/lines on will give you shoot through - not the best hardware solution, but if used - your software should never allow the "smoke" condition
I thought about adding ramping - but have not implemented it yet, something where you set the ramping parameters and enable it so that all other commands like "moveTo" do ramping if setup once.
What do you think? Got a good idea?