This feature is ** deceptively simple.** I know exactly what everyone thought when they saw this challenge. I have even seen it implemented in some Ri3D code. So here is what I know your thinking about.
measure gyro angle
use PID to move forwards and backwards depending on if it’s tilted
slow down robot until it works
But this challenge is way more complicated than that. You need more than a PID controller here just because of the number of variables.
With traditional position control PID, you really only care about robot position and robot velocity (controlled by p and d terms). This challenge requires not only control over robot position and velocity, but control over the charging station angle and angular velocity.
Unless your team has a lot of experience with control theory, it might just be worth letting the human do the balancing. EDIT: It appears that it is possible to get it done in a simple way
We are planning to use two PID controllers, one that takes the angle of the switch and generates a target position, and a second that takes the target position and drives the robot to that spot.
If you guys have any other ideas, it would be great to share them, as this is one of the trickiest control problems FRC has seen recently.
I believe that balancing should be a very slight thing, like aim assist, for the drivers. It’s easy to get a human to understand how to tell when it needs balancing, but the robot has no idea what’s going on around it other than in this case a gyro. It’s a very complicated problem that has many solutions, though most will do just fine.
I might be greatly oversimplifying, but with a small amount of parameter tuning and possibly an odometric adjustment once tilting, I imagine this would work just fine. Whereas the nonlinearities in tilting may come out to bite PID users.
There are two dimensions: forward/backward, and tilt. A sort of control system that references both of these values will be much more effective than a 1D system.
The issue with this is, imagine the switch is held down, your robot will fly off the edge. This is because simple first order controllers don’t contain enough information to control this ideally.
Not to downplay the challenge of building an effective system too much (getting anything to work reliably in the real world is hard in robotics!), but some teams were doing this successfully all the way back in 2001 (and again in 2012).
As far as I know, none of those teams did anything particularly complex in terms of controls. The key thing to remember is that the bridge has quite a bit of hysteresis due to the double hinge, so this isn’t really an inverted pendulum type problem.
(Now, two or three robots who are trying to auto balance simultaneously would be a real party…)
I am like a very Math + CS type guy so i thought it was best to model this like an inverted pendulum with a dead zone.
It will certainly be interesting to see what teams come up with, but i really hope that more teams share the math the end up using. Not only is it interesting to read, but it makes FIRST more equitable, especially for high schools that don’t offer higher level math courses.
A thought:
Detect when the robot angle reaches the 11-ish degrees (IE its fully on the charging station).
That will give you a well known position.
Drive forward a specific distance; ideally the target is the center of the dead zone.
Wait for a maximum of ?? seconds for an angle change.
If the angle doesn’t change drive forward to almost the far end of the dead zone
Once the angle starts changing wait for it to stop changing
UNLESS the angle starts to go negative; response immediately by backing up half a dead zone/
I think the hysteresis of the system is really going to complicate this!
Super cool would be to have a LIDAR spinner scanning across the charging station where it could see the floor on both sides (horizontal axis spin). With that you would know where you were on the platform without the issue of slipping wheels.
The impact of the other robots (mass and location) will change the dynamics a LOT and also move the dead zone. Hmmmm
If you really want an inverted pendulum type problem, try to get the bridge to balance at an angle of 2.4 degrees from the floor plane and hold there for 3 seconds after the match end. Anything within 2.5 degrees counts as LEVEL, so you could get all the points, and have a fun programming challenge, and make things exciting for spectators.