ut-ras / Rasware

A generic robotics controller for the EK-LM4F120XL Stellaris Launchpad.
ras.ece.utexas.edu
Other
4 stars 0 forks source link

Adding Servo Motors #36

Closed geky closed 10 years ago

geky commented 10 years ago

It's very common to drive a motor through rc-pwm. In RAS we've driven Jaguars, Victors, VEX motor controllers, and continuous-servos in this way. It's not that hard to use the servo module for driving these motors, but leads to a bit of annoyance when you need to shift the range around.

This change adds PWMMotors, another motor type that takes a single pin and simply drives an rc-pwm in the range of [-1, 1] with an invert flag. It uses the polymorphism defined for the line sensor modules.

Now there is InitializePWMMotor and InitializeTLEMotor, although I'm not sure if there are better names we could use.

robz commented 10 years ago

Sorry to nag, and I know this code doesn't have much room for error, but just for the record: did you test this?

geky commented 10 years ago

Ah, It has been pretty well tested on servomotors although I haven't had the chance to try the maupassant motor controllers.