View Full Version : help --- how to drive other motors
qpang
03-14-2008, 10:58 AM
I'm using the function block "Tank() " to drive my wheel motors, and it works fine. But when I try to use the same function to drive my other motors (used for the arm), it just doesn't work. Those motors for the arm are not the same model, but use the same voltage.
My question is whether there is a specific requirement on the motors for the tank function be able to drive it?
TubaMorg
03-14-2008, 11:56 AM
#1. There is no need to post your question multiple times in the forums. There are plenty of people here that can help you and one post will suffice.
#2. There are several reasons why your arm motors aren't working the way you want. Things to look for:
Are your arm motors connected to victors?
Are the victor LEDs solid or blinking?
Are the victors connected to your RC PWM outputs? Which ports?
Instead of using the "Tank" function block, use:
void Motor(unsigned char port, char speed);
where "speed" is a value from -127 to 127, 0 being neutral. For example if one of your arm motors is connected to PWM port 6 and you want to drive it at a medium speed in one direction:
Motor(6, 160);
Hope this helps!
qpang
03-17-2008, 04:48 PM
Thank you for your help.
Is "Motor()" a function that is in the easyC Pro Library?
I don't see it as a function block.
Actually I've tried to use "OI to PWM", but didn't work either. ( Again it does work to control the wheel motors)
I'm pretty sure I'm commanding the correct PWM port.
So it really seems that it's a hardware problem. Too bad that we can't check it now.
TubaMorg
03-17-2008, 05:01 PM
EasyC pro for FRC uses a library called WPILIB. While functional blocks of a lot of these commands are built into EasyC, not all of them are. Here is the WPILIB reference:
http://users.wpi.edu/~bamiller/WPILib/WPILib.pdf
Your use of OIto PWM should work just as well. Make sure to check your Victor light. It should be solid and not blinking. If it is blinking, it is likely that your PWM cable is not connected properly. It is also possible that power is not reaching the motor that you are trying to drive.
Check them out when you can...
vBulletin® v3.6.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.