Full Version: Problem with cascade PID
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone,
I have a project of balancing robot. I've read code of B-RObot. But I can't understand Cascade PID.
1. What's the unit of SPEED in this code.
PHP Code:
actual_robot_speed_Old actual_robot_speed;
actual_robot_speed = (speed_M1 speed_M2) / 2// Positive: forward

int16_t angular_velocity = (angle_adjusted angle_adjusted_Old) * 90.0// 90 is an empirical extracted factor to adjust for real units
int16_t estimated_speed = -actual_robot_speed_Old angular_velocity;     // We use robot_speed(t-1) or (t-2) to compensate the delay
estimated_speed_filtered estimated_speed_filtered 0.95 + (float)estimated_speed 0.05;  // low pass filter on estimated speed 
2. The OUTPUT of SPEED CONTROLLER is the SET POINT of STABLITY CONTROLLER. But, the process variable of STABILITY is the tilt angle, and calculated by degree. So, Do Setpoint and process variable have the same unit?

Please help me explain those problems.
Thank you!
Reference URL's