![]() When we compare the response from the hardware to that of the simulation, we observe that they are very close! The System Identification Toolbox model is quite good. So, it does a pretty good job of tracking the reference signal. We ran the model on the target, sent it some commands and logged the data transmitted through the serial port. We also send the measured position through the serial port. The position error goes through the PID block which generates a voltage to be sent to the motor. To test the controller on the hardware, we created a Simulink model using blocks from the Arduino Support Package.Īs you can see, we receive the desired motor position from the serial port and compare it to the measured position from the Analog Input. To keep the PID controller’s output within the limits of the hardware, we go to the PID Advanced tab and enable output saturation along with anti-windup protection. Then we grab the PID block from the Simulink Library and configure it. To use it on our target, the first thing to do is to discretize it using the c2d function: You probably noticed that the controller shown above is in a continuous form. To deploy the controller on the hardware, we will use Simulink’s capability to generate an executable and run it on selected hardware.ĭeploying controller to the Arduino board We will now implement the controller on the Arduino Uno and see how the DC motor fares with this controller. We estimated the following transfer function for a simple DC Motor using tfest:įor this transfer function, we designed the following controller using pidtune: In my previous post, we saw how to estimate continuous transfer functions with System Identification Toolbox. ![]() This week my colleague Pravallika is back to continue her motor control story!
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |