Skip to content

Bang Bang

Alex Dickhans edited this page Feb 1, 2022 · 2 revisions

Bang bang control

A bang bang controller is a feedback controller that turns off a discrete output on and off based on a variable input. This controller would switch abruptly between states. This controller wouldn't be optimal control in most robotics cases because of the discontinuous nature of it, but this year balancing on the ram provides a unique problem where you want to apply force until the ramp starts tipping then you want to stop driving before it is balanced so you don't overshoot.

Our implementation of a bang bang controller

For balancing on the ramp we don't want to only have control in one direction in the case that we overshoot, we would want to have a controller that would be able to recover from the other side. For our controller we would have a variable that is the maxAngle for the imu on either side, that would be the max the abs of the pitch could be. We would run the controller at velocity speed. We will do this until we are considered balanced then stop the controller and stops and returns the control to what it was doing before.

Balance code

For the balance code we have 2 closed loop controllers to control the forward movement of the drivetrain and the orientation control to maintain a straight line. The bang bang controller will only work when it is on the ramp at an angle because otherwise without other input it cannot know whether it is on the ramp or off and which way to go to start driving on the ramp. First we drive onto the ramp, then we start the controllers and run them for the rest of the match or run to adjust to outside forces effects on the platforms.

When we get back to school we can make erik test the code and add it all to a spreadsheet.

Clone this wiki locally