Problem with cascade PID - Printable Version

+- JJRobots COMMUNITY (http://forums.jjrobots.com)
+-- Forum: JJrobots (/forumdisplay.php?fid=1)
+--- Forum: B-Robot (/forumdisplay.php?fid=2)
+--- Thread: Problem with cascade PID (/showthread.php?tid=1133)

Problem with cascade PID - Jim BK - 11-29-2016 10:15 AM

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!