Make my motor turn!


#1

We’re using the default code and we are trying to make the motor turn using the pwm functions and the pwm outputs 13-16. We have our motor hooked up and all components working as intended up to that point as far as physical electrical connections.


#2

Do you have the motor connected to the M+/M- side of a Victor speed controller?

The same Victor that your PWM cable goes to?

Is the PWM cable plugged all the way into the Victor speed controller … sometimes they are hard to get in due to the plastic of the PWM cable connector being a bit large.

Are you supplying 12 volts from the battery, through a circuit breaker, to the V+/V- side of the Victor speed controller?

Are the wires all in good contact?

Did you test the motor first (direct-connect to a 12 volt battery)?

Make sure you are not outputting a “neutral” value to the pwm13 variable in your code … neutral (no voltage to motor) is in the range of 127 +/- 14 (114 through 141). If you are just testing and the motor isn’t connected to any gears or the robot, just set pwm13 to something like 10, or 230.


#3

I’m doing this from memory, because I don’t have the default code at home and I’m too lazy to do it, but to use pwm13-16, don’t you have to use the Generate_PWMS(); function call?


#4

Another tip: The LEDs on the Victors should change color as you move from full forward to full reverse to neutral (green, red, orange is neutral). Also teams have had trouble using the last four PWM connections. You can try changing your code so that you can use 1-4 instead.

Important point, though, is to watch the LEDs. If they are flashing then something isn’t connected right.


#5

Other than everything else already mentioned, do you have alot of interrupts and are not using some kind of replacement for Generate_PWMs?

My team found that running with alot of interrupts can either disable or make pwm 13-16 irratic using only Generate_PWMs


#6

Yes this is the problem teams tend to have if they use PWMs 13-16. Interupts conflict with the psuedo PWM’s. Better to avoid the issue if possible by using any of the other PWMs.


#7

When you use the default code you must connect your PWM cables to the specified PWM outputs on the RC. The joystick port is already mapped for you, to specific motor PWM outputs. The RC manual has a complete documentation of the default code. (See Page 6, PWM Output map, default code only)
From the manual…
“PWMs 13-16 are meant to
be used if one desires to
control the robot using only
one joystick. The left and
right drive motors are
controlled by mixing the X
and Y axes of joystick 1.”
Let us know if this helps.