We’re in our first FRC this year and as expected we are completely new to Labview. What we’re trying to do now is have the motors run at the exact same speed. I’m not entirely sure as to how to do this and we’re coming up with theories but nothing has worked so far. Could anyone direct us to fixing this issue?
You can feed each of the speed controllers the same value from a joystick, but the whole chain from the motor to the wheels on the carpet introduces error.
the speed controllers must be identically calibrated
the motors will vary within manufacturing tolerances
the motors may have a design bias to turn better forward than they do backwards
the gear trains the motors drive will have varying efficencies, binding, grease, tooth engagement, etc.
To match motor speeds in code through the whole chain you would need sensor feedback from something like an encoder or potentiometer.
We currently are running on 4 motors (looking to use a Y cable instead of four individual cables) with Victor SP speed controllers. Our Left motors are inverted and the Right motors are not. We do have encoders and may use them. How would we apply them via the code?
I don’t expect encoders to be terribly reliable going over the rough defenses.
To match speeds you could use a PID vi to modify the motor speeds on each side to track a desired speed.
In other words, speed up a motor if it’s going slower and slow down a motor when it’s going too fast. Or let one motor run according to the joystick setting and have the other motor match speed with joystick input modified by a PID check.
I’d suggest playing with PID on a standalone motor first to let you get the hang of what it is doing and how it works.
Do a search on PID in the whitepapers here on CD to start with the basic concepts.
We’re trying to get our robot to move completely straight. Such as in autonomous one motor may move faster than the other (even though their values are the same) and knock it off course.
Yep. Use a gyro to sense the direction the robot is facing, and use the difference between that and the desired direction to adjust the motors so the robot turns toward the target direction.
One of the best software tools for doing that is PID control on the X axis “steering” input of an Arcade Drive function.