this 20 second video clip shows my trouble: - YouTube
My segway code uses an IMU (the MPU-6050) and comes up with the angle of the platform. It then just maps the angle from about plus or minus 20 degrees to plus or minus 0-100 percent motor speed. It works well with a rider, but when it's empty it is way to sensitive. I don't have any kind of PID control, but the PID library looks very hopeful!
Right now, I only use the IMU to figure out the angle, and that's it. But I think I also need to use the raw gyro reading as the key number in the PID. If the gyro reading is very high (or very low for the backward movement), than I could use it to tell the PID not to react as fast/severe. Does this sound good? I see the PID library has the setTunings() function to change the 3 values as it's running. Kp, Ki, & Kd. I'm not sure which of these I need work my gyro reading into:
Kp: Determines how aggressively the PID reacts to the current amount of error (Proportional) (double >=0)
Ki: Determines how aggressively the PID reacts to error over time (Integral) (double>=0)
Kd: Determines how aggressively the PID reacts to the change in error (Derivative) (double>=0)
Does anyone have any help on this. I've search quite extensively on the web, but haven't come up with anything.