We have been attempting to test code on our practice bot, but the left side motors only work when we are calibrating. On top of that, the left side motors are inverted when we calibrate the second motor. Right now we are stumped on what the problem could be. We ruled out code because the drive code hasnt been touched since it was written, and it worked fine until recently. We would really appreciate any help that can be provided.
Which motor controller are you using?
We are using victors
You are holding down the cal button when performing the cal I hope.
I’m going to spell out what I think your setup and observations are, then give you the problem and solution, assuming my understanding of the setup and observations are correct.
Setup: You have two motors going into a single gearbox to power each side of the robot. This would be for a normal “tank” drive robot, for example having 6 wheels on each side all chained together.
- One side does not move when the code tells it to
- When calibrating the motor controllers, you see:
- Calibrating controller “1” makes the wheels spin forward when you want them to go forward in the calibration
- Calibrating controller “2” makes the wheels spin backwards when you want them to go forward in the calibration - ie it acts opposite of controller “1”
Is all of that correct? If so, then I’ve got another test for you. Unplug controller “2” and try driving. Does that side work as expected? Now, plug that controller back in and unplug controller “1” and try driving. Does that side work as expected?
I suspect you somehow got the motor leads “swapped” for controller “2”. As a result, when you try driving forward on that side, motor “1” sees a +12V signal, while motor 2, with the leads swapped, seeings a -12V signal. The motors run against each other and stall in the gearbox. Unplug the motor leads from controller “2”, swap them, and plug them back in.
We tried something similar, we unplugged 2 and tried driving, and it worked perfectly fine. We traced the leads, and they are all plugged in fine and everything is where it should be. For now I fixed the problem by inverting the motor in the code, which seems to make them both travel in the correct direction. We suspect that there is a problem with the victor but we cant be sure.
I would just like to say that I accidentally read the title as “Mentors Only Work When Being Calibrated”. Needless to say, I was quite intrigued, and then slightly disappointed.
If it really is a problem with the Victor you really want to replace it. If something has gone wrong inside the speed controller to reverse the motor inputs it is damaged, something else could easily happen. Before you do that you should check the voltage going into and coming out of that Victor in order to make sure it is actually reversed. (In other words, make sure it is actually the Victor and not some other problem in wiring.)
me too, but i was thoroughly confused.
I did the same thing. Maybe the title got changed from when I clicked it? Or maybe we’re all just crazy since week 1 is so near (way more likely). In any case… Carry on
What motors are you using? If it’s a motor where your team soldered wires, it’s easy to get them backwards.
I don’t think the title was ever changed. After my mistake I realized that I had already seen the thread before, but without the confusion.
I think the fact that we are all crazy is far more probable. I’m glad to know that I am not alone in this.
Your Victor may be fine. The direction a motor spins when apply 12V on the + side and ground on the - side is dependant upon how the motor is wound internally.
Not all motors from the same manufacture are wound in the same direction. This could mean two separate motors from the same manufacture can spin in opposite directions when applied voltage in the same orientation.
We have personally notice this on CIM motors. You should make it a habbit to check each motors direction of travel off board and mark them, especially when placing two or more motors in the same gearbox.
It sounds like your problem was just driving both motors into each other causing them to fight. I don’t think your victor is broken, but you can check it by unplugging the motor and reading the voltage out of it as you scale the sticks. The voltage should move near linearly from 0 to full battery voltage.
Swapping the boolean value in code, is exactly what you should have done to rectify your situation, so don’t think you did a quick fix, it was the correct way.
Hope this helps,