Pid loop

My team 5150 wants to make a pid loop so when our robot is not level the robot will adjust and make the robot level. What’s the best way to do this?

1 Like

Sounds like a plan :+1:

1 Like

Use NavX-mxp, which is a gyro. You might want to get the pitch or roll from it based on the roboRio orientation and put in a PID. For example you have a method called moveDrive where you pass an argument called speed. You can pass pid.calculate() inside the argument. The input would be the pitch or roll value and the setpoint would be something around 0.

1 Like

The NavX or Pigeon2.0 are both great gyros for FRC. Use roll (or other appropriate value) as the current value and try to get the PID to target getting the value to 0. Remember you want to keep movements, slow and small.

1 Like

^

This is irrelevant for auton.

The post didn’t mention whether it was auton or not

Also for auton, the same concerns about the velocity of weight along a seesaw apply
Just raw PID may not work but some smarter logic might

See this thread. PID can work, especially when you combine two. In fact, a simple bang-bang control would work. No smart logic needed.

To reword a bit maybe:

You are trying to control the angle (position) and angular velocity (first derivative) to be 0

Moving your robot along the switch adjusts the torque on the seesaw by controlling the accel of your robot, so you are trying to control x, and x’s first derivative using x’s fifth derivative.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.