None
Using the workstation and the encoders on the motor, you will control the velocity for two configurations of the electromechanical system using closed-loop control.
Even though your quite new to trying to designing a closed-loop controller, you have already seen that you will need a plant transfer function in order to design a closed loop control system. Therefore, you will need to experimentally establish suitable plant transfer functions for the motor alone configuration you will control in this lab.
As you did in Lab 4, you will fit a dynamic model to the data. However, in this assignment, you won't need to determine the physical parameters (e.g. $J_m$, $b_m$, etc) because we will FIX THE SYSTEM SO IT WILL NOT CHANGE between the time we establish the plant behavior and the time we control the system.
Because we can expect the parameters to be constant, you can characterize the plant's behavior directly in terms in the transfer function's numerical characteristics (e.g. steady state gain, time constant, damping ratio, and natural frequency, as appropriate).
To establish the plant response, you will first record an OPEN LOOP step response, because this represents how the system acts without closed loop control.
Make a copy of your Arduino code from Lab 4 to provide a step input for the motor-alone configuration (REMOVE THE FLEX COUPLER CONNECTING THE MOTOR TO THE LOAD INERTIA).
% YOUR CODE HERE
error('No Answer Given!')
Use the plant transfer functions you developed from your data to design a propritional controller. Using the characteristic equation of the CLOSED LOOP transfer function, set the closed loop time constant to be 0.033 sec and report the gain required to achieve that performance.
Perform all the calculations in the OCTAVE cells below and clearly display your calculated gain.
% YOUR CODE HERE
error('No Answer Given!')
To assess the usefulness of your controller, you can compare your predicted responses to actual measured responses while the system is under closed loop control. However, to perform the experiment you will need to modify your Arduino code so it implements your closed loop controller design.
SAVE THE CODE YOU USED TO GENERATE YOUR OPEN LOOP RESPONSE in the section above. Then, in a new file, modify the code to implement closed-loop control:
In Block 4:
Provide your Arduino code with the proper formatting in the markdown cell below:
YOUR ANSWER HERE
Capture the response to a step input to the desired velocity and, in the OCTAVE cell below, graph the model predictions vs the actual data for your closed loop response on the same axes.
% YOUR CODE HERE
error('No Answer Given!')
It is important that your control signal does not "saturate". This occurs when you request a voltager HIGHER than you can deliver. To confirm you aren't saturating, Plot the PWM values sent to the motor for the same time span as the data above to show that the applied PWM signal does not reach 255 at any time during the response.
% YOUR CODE HERE
error('No Answer Given!')
Examining your results, list below any questions you have regarding the comparison of the data to the models. If you have no questions, list your conclusions.
YOUR ANSWER HERE
In Lab 4, you may have determined that both the motor alone and the motor-rigid shaft-load have a roughly first order response. However, if a spring connects the motor and the load, they are now independent energy storing elements. With the spring it means that a 3rd order model will be required to captured the dynamics. As before, expecting the physical elements of this system WILL NOT change so we will establish the transfer function without using a physics based lumped parameter model.
Since we don't have experience with 3rd order systems, we'll use our knowledge of superposition to allow us to use transfer function forms we are familiar with. Specifically, the 3rd order response can be modeled as the combination of a response of a 1st order system to a step and the response of a 2nd order system to an impulse. This represents a total 3rd order response with two zeros after the transfer functions are combined, but separating the system into constituent parts allows us to fit the first and second order behavior in two separate steps.
This is shown graphically below:
To find the 3rd order transfer function, first you need to find the transfer function that best approximates a first order step response that passes through the 3rd order response. Then, you can subtract the 1st order response from the 3rd order data to extract the 2nd order "impulse portion" of the real system's response. With the first and second order behavior separated, you can establish a transfer function for each by estimating the time constant, steady state, natural frequency, and the damping ratio as you have done before.
Once you have fit each part of the system's behavior, you can combine the two simpler transfer functions to form the total tranfer function for the 3rd order plant.
$ G_{3rd \, Order} = \frac{A}{s+a} + \frac{B \omega_n^2 s}{s^2 + 2 \zeta \omega_n s + \omega_n^2} $
Install the Motor-Spring-Load configuration of your load inertia module and record an OPEN LOOP STEP RESPONSE by providing the Motor-Spring-Load a step change in VOLTAGE. Capture this step response and plot your data and your fit on one set of axes. Then, display your plant transfer function. For clarity, display the plant model as a combination of individual first and second order transfer functions as shown above:
% YOUR CODE HERE
error('No Answer Given!')
Since you don't yet have tools to do the design of a proportional controller for a higher order system, we'll use model order reduction to proceed. "Model order reduction" is the act of representing a higher-order system as a lower-order one. In this case, you will use only the "First order portion" of your plant model in order to design your controller. For the purposes of controller design, you will ignore the "second order part" entirely during the design process.
Once you complete your design using the simplified plant model, you will have determined a "suitable" proportional gain for the system. This will allow you to see if your first order plant model is of sufficient fidelty to predict the actual behavior of the closed loop system during the controller validation step.
Determine the $k_p$ that will achieve a closed-loop time constant of 0.25 sec if we assume that the open loop system's response is modeled adequately by the first order part of the plant transfer function. Place your calculations in the code cell below.
% YOUR CODE HERE
error('No Answer Given!')
Implement your closed loop controller on the real system and compare the measured response to the predicted response for a step input of a magnitude you choose. Although you could not use the full third order model to design a controller, you can use the transfer function to predict how the system will respond to a known gain. Therefore, compute predicted responses using both the reduced order model AND the third order model using a closed-loop proportional controller you designed. Make sure the signal sent to the motor does not saturate during your closed loop step response tests.
You will need to replace the rigid connection between the mass and motor with a compliant spring coupling. Instructions on how to properly assemble your system can be found in the hardware resource.
Note: The photographs taken without the shield for clarity. The shield does not have to be removed to install the mass or the spring shaft.
% YOUR CODE HERE
error('No Answer Given!')
Discuss the impact of the proportional control on the actual system response. Since this is a higher order system, are there changes in the system response beyond the time constant?
YOUR ANSWER HERE