Root-Locus-Based PID Controller Design and Implementation
Feedback and Control | August 2024
Feedback and Control | August 2024
This project focused on designing and implementing a PID controller for a Quanser Qube servo motor using the root locus method. The goal was to drivethe motor to an angular velocity of 15 rad/s while achieving zero steady-state error, less than 10% overshoot, and a settling time below 0.6 seconds.
Before designing the controller, the motor was experimentally characterized and a voltage-to-velocity transfer function was derived from its measured step response. The resulting model was then used to design the controller in MATLAB, validate the response in Simulink, and compare the simulated behavior with the physical motor.
Figure 1: The Quanser Qube servo motor used for experimental evaluation.
Experimentally characterize the Qube servo motor and derive a voltage-to-velocity model.
Design a PID controller using the root locus method.
Achieve a commanded angular velocity of 15 rad/s with zero steady-state error.
Maintain less than 10% overshoot and a settling time below 0.6 seconds.
Validate the controller using MATLAB and Simulink.
Implement the controller on the physical Qube motor and compare its response with simulation.
The controller was designed to meet three primary performance requirements: a 15 rad/s angular velocity, zero steady-state error, less than 10% overshoot, and a settling time below 0.6 seconds.
The design also required developing a mathematical model of the Qube motor from experimental data. This provided a foundation for selecting the controller structure and determining the appropriate pole and zero locations for the desired response.
The controller was developed through motor modeling, controller selection, root-locus design, and simulation-based validation.
The design began by experimentally characterizing the Qube motor. A step voltage was applied to the motor, and its angular velocity was measured. This experimental data was then used to develop a voltage-to-velocity transfer function representing the motor dynamics.
The resulting second-order model was:
This transfer function represents the relationship between the voltage applied to the motor and its resulting angular velocity. It was used as the plant model for the PID controller design. The second-order model was selected as the plant for the controller design because it provided a closer representation of the measured motor response.
Figure 2: Experimental validation of the QUBE motor model, comparing the measured angular velocity response with the developed mathematical model.
Note: The yellow line represents the measured motor velocity, the blue line represents the ffirst-order model G1(s), and the orange line represents the second-order model G2(s).
The motor model was analyzed to determine the appropriate controller structure. Since the system was Type 0 and the design required zero steady-state error, an integral term was needed. A PID controller was selected because it provided integral action while also allowing the transient response to be shaped using proportional and derivative terms.
The controller was represented as:
The pole at the origin provides the integral action, while the two zeros provide additional control over the closed-loop response.
The design targeted 5% overshoot and a 0.1 s settling time, providing additional margin relative to the project requirements.
From the desired overshoot, the damping ratio was calculated as:
While the natural frequency was determined from the settling-time relationship:
This led to the desired dominant pole location being calculated as:
The root-locus method was used to determine the controller zeros and gain needed to place the closed-loop poles at the desired location. The target dominant pole was previously calculated as sd = -40 + j42.
This pole location was selected from the desired 5% overshoot and 0.1 s settling-time design targets.
Figure 3: The root locus drawing of the transfer function.
The controller zero location was first determined using the root-locus angle condition:
For the desired pole at -40+j42, the pole at -50 is 10 units away horizontally, giving the result for θ2. Conversely, The pole at -9.67 is 30.33 units away horizontally, giving the result for θ3. Therefore the controller zero needed to provide the remaining angle of θ1.
The angles are calculated directly from the geometry between the desired pole and the two existing plant poles shown in Figure 3. The remaining angle determines where the controller zero must be placed for the desired pole to lie on the root locus.
Using this angle and the desired pole location, the location of the zero, a, can be calculated:
The value 141.75 determines the location of the nonzero controller zero, placing it at approximately -141.75 on the real axis.
The distances from the desired pole to the controller zero and the two plant poles were then calculated from the same root-locus geometry:
These distances come directly from the horizontal and vertical separations shown in the root-locus diagram.
The root-locus magnitude condition was then used to determine the required gain. Because the motor model already contains a gain of 14273, the corresponding controller gain was divided to only find the additional gain needed. This resulted in the initial PD portion of the controller:
The angle condition determines the zero location, while the magnitude condition determines the gain required for the desired pole location. Together, these calculations establish the proportional and derivative portion of the controller.
Integral action was then incorporated to provide zero steady-state error. The second controller zero was initially positioned near the origin and then adjusted during the simulation-based controller refinement. A final location of -7.85 was selected because it produced the required closed-loop response.
The final controller was:
The pole at the origin provides the integral term, while the two zeros at approximately -145.06 and -7.85 shape the closed-loop response.
To implement the controller using separate proportional, integral, and derivative terms, the transfer function was expanded:
This gives the final controller gains:
These gains were the values entered into the MATLAB/Simulink controller implementation and used for the subsequent simulation and hardware evaluation.
The controller was evaluated with simulation in MATLAB and Simulink in addition to the physical motors.
The final PID controller was first evaluated in MATLAB to verify that the calculated controller parameters produced the desired response. The resulting step response reached the commanded 15 rad/s with less than 10% overshoot and a settling time below the required 0.6 s.
Figure 4: The Final MATLAB step response for the designed PID controller.
The final root locus was also examined to verify the placement of the closed-loop poles relative to the desired damping ratio.
Figure 5: The Root locus of the final PID-controlled system.
After the MATLAB design was verified, the controller was implemented in Simulink to evaluate its behavior in a model closer to the physical QUBE setup. The PID transfer function was converted into proportional, integral, and derivative terms and entered into the Simulink PID controller block. A filter coefficient of 100 was used for the controller implementation.
Figure 6: The Simulink implementation of the PID-controlled QUBE motor.
The Simulink response also satisfied the design requirements, reaching 15 rad/s with zero steady-state error, less than 10% overshoot, and a settling time below 0.6 s. The response differed somewhat from the MATLAB result, but remained within the required specifications.
Figure 7: The Simulink response of the PID-controlled QUBE motor.
The final step was to reconnect the QUBE servo motor and evaluate the controller on the physical system. The measured motor response followed the simulated response reasonably closely while reaching the desired operating point.
Figure 8: A Comparison of the simulated and measured QUBE motor responses.
Note: The yellow line represents the measured motor response, while the blue line represents the simulated response.
Overall, the physical implementation maintained the required control performance. The measured response showed a slightly faster response than the simulation, but the difference remained within the expected experimental variation.
The project resulted in a PID controller that successfully controlled the QUBE servo motor to the desired 15 rad/s while achieving zero steady-state error, less than 10% overshoot, and a settling time below 0.6 seconds. The controller was developed from an experimentally derived motor model and designed using root-locus analysis before being validated in MATLAB, Simulink, and on the physical motor.
The project demonstrated the complete process of experimentally characterizing a motor, developing a mathematical model, designing a controller around specific performance requirements, and transferring that design from simulation to physical hardware. It also provided practical experience applying root-locus methods to an existing system and translating the resulting controller into a working PID implementation.
For future improvements, the controller could be further refined to reduce the small differences between the simulated and physical responses and improve filtering of measurement noise. Additional testing under a wider range of operating conditions could also provide further validation of the controller's performance.