We are having exceeding trouble in learning how to program our robot, which is a 4 motor 4 wheel shooter, to change speeds such as from full power to half. If anyone has an idea on how to change the speed of our wheels using integrated motor encoders, please feel free to share your knowledge!
Moved to General Forum.
What you have to do (after setting up the motors in Motor and Sensor setup), is to program the motors to a set speed. Most motors are 8 bit. So the maximum command is “127” and the minimum is “-127”. 127 is not a speed, since speed depends on the gear ratio. So to program half speed you need to add this:
motor(nameofmotor) = 63;
That changes the power, not speed. Speed will vary based on battery level and load. To control speed, some form of controller is needed. The simplest is a bang-bang controller, but that may not be suitable for a double flywheel. The other two popular options are TBH and PID, which are much more accurate and less damaging to motors, but more complex. All three are well-documented on the forum.
I actually answered this question a while back.
Ah, my bad. I get those two mixed up.