|
Re: Limit speed of 4 chassis CIM motors
You have a few ways to do this:
One way would to just multiply your inputs from the joystick by a constant, less than 1, and pass that value to your motor.Set() function.
Another way, would be to limit the actual speed of your robot. For this to work, you would need encoders on each side of the robot, to monitor your speed.
Then you have an if statement, comparing the current speed of your robot, to a predefined "maximum" speed. If you are approaching your maximum speed, lower the output of the motors by a certain amount.
I would suggest, for either solution, you have a toggle to turn it on and off. Maybe you will want to go full speed for some reason? Who knows.
__________________
1771- Programmer, Captain, Drive Team (2009-2012)
4509- Mentor (2013-2015)
1771- Mentor (2015)
|