01-31-2012 05:25 PM
I am the programer/frame specialist of rookie team 4301, and i am having trouble with our motors, they run regular forward and backwards, but the directions of left and right are switched(left is right and right is left), i have started new programs, built them, and deployed them to see if it was a programing error but it isn't.I have also switched the wires to different Jaguars, but that dint work either(we have also re wired to check for connection problems but that wasn't it either) Any suggestions on what could be the problem?
Solved! Go to Solution.
02-01-2012 08:55 AM
Hey,
It sounds like you have the left and right motors switched in code. Are you using tank drive, arcade drive, or your own custom drive setup? On the Open VI's for the motor controls I would switch the PWM assignments for left and right. Does that make any difference on the system? If that doesn't fix the issue post back screenshots of your drive/joystick setup and drive code.
02-01-2012 09:24 AM
Motors typically turn clockwise when looking at shaft when a +ve voltage is applied. However, sometimes this is reversed because of a manufacturing error, or by design the manufacturer didn't care and leaves the discovery to you. This doesn't really matter to us.
A simple procedure can solve your problems:
1. Choose the PWM that will be the right side signal. I'll say pwm(1).
2. Make sure that pwm(1) wire goes to the motor controller connected to the right side motor.
3. Make sure that the left side pwm(2) goes to the left side jaguar, connected to the left motor.
4. Make sure that the red wire from the motors goes to the M+ terminals, black to M-.
At this point a positive value to the controllers in software should turn both motors clockwise.
Now depending on the gearbox and number of chains etc, either the left or the right side, or both wheels may be going backwards.
5. Create a program set up for "tank drive" where the left joystick controls the left side, and the right joystick controller the right side. Make sure you specify the correct pwm output for left (pwm2) and right (pwm1). (note: that pwm1/pwm2 are my example - make sure you chose or followed what was setup in the default programs)
6. Arrange for only the left joystick to be forward half way. The left side will be moving. If it's going forward then the left side is all correct. If it's not, the easiest change is to power down the robot and swap the wires on the M+ and M- on the left side jaguar. Now the left motor is wired up the way the default program expects.
6a. If the right side of the robot is turning - swap the pwm cables in the digital side car.
(you did something wrong in steps 1-6 but this will get us back on track)
7. Repeat step 6, for the right joystick. If the right side wheels are moving forward you are done. If not swap the M+,M- wires on the right side jaguar.
Tank drive should now be working correctly. ** Never change the wires from this configuration again. **
Load up a program using arcade drive. If this seems to have a problem, then the problem is in software:
A. Look for the jaguar initialization code and see if your programmers have inverted the direction for one side.
B. Make sure that the arcade drive setup has the correct PWMs specified (swap these if necessary)
Pushing the joystick to the right, should make the left side of the robot drive forward and the
right side should not move or possibly go backward.
C. Your programmers have been too smart and have written code in to invert the left or right side,
because they know that one motor needs to go clockwise while the other goes anti-clockwise
to get the robot to go forward.
In software a positive number should result in forward movement on both sides.
Hope this helps.
02-01-2012 01:47 PM
I switched the motors in the block diagram and it worked! But is it recommended to have them controlled separately, like does it add extra control, if I doesn't , dies it matter that I control the motors separately with the 2 joysticks