1
Table of Contents
1.0 INTRODUCTION ... 2 1.1 Background ... 2 b. Position control ... 2 1.2 Theory ... 3 2.0 OBJECTIVE ... 5 3.0 APPARATUS ... 5 4.0 PROCEDURE ... 65.0 PRE LAB ASSIGNMENT ... 9
5.1 Derivations ... 9
5.2 Controller Design ...12
6.0 RESULTS AND DISCUSSIONS ...14
7.0 CONCLUSIONS ...21
2
1.0 INTRODUCTION 1.1 Background
a. Servomechanism
A servomechanism, sometimes shortened to servo, is an automatic device that uses error-sensing negative feedback to correct the performance of a mechanism. The term correctly applies only to systems where the feedback or error-correction signals help control mechanical position, speed or other parameters. For example, an automotive power window control is not a servomechanism, as there is no automatic feedback that controls position—the operator does this by observation. By contrast the car's cruise control uses closed loop feedback, which classifies it as a servomechanism.
b. Position control
A common type of servo provides position control. Servos are commonly electrical or partially electronic in nature, using an electric motor as the primary means of creating mechanical force. Other types of servos use hydraulics, pneumatics, or magnetic principles. Servos operate on the principle of negative feedback, where the control input is compared to the actual position of the mechanical system as measured by some sort of transducer at the output. Any difference between the actual and wanted values (an "error signal") is amplified (and converted) and used to drive the system in the direction necessary to reduce or eliminate the error. This procedure is one widely used application of control theory.
3
1.2 Theory
We shall begin by examining the electrical component of the motor first. In Figure 1, you see the electrical schematic of the armature circuit.
Figure 1.1: Armature circuit in the time-domain
Using Kirchhoff’s voltage law, we obtain the following equation:
Since Lm << Rm, we can disregard the motor inductance leaving us with:
We know that the back emf created by the motor is proportional to the motor shaft velocity,
such that:
We now shift over to the mechanical aspect of the motor and begin by applying Newton’s 2nd law of motion to the motor shaft:
4
Where is the load torque seen thru the gears. And is the efficiency of the gearbox.
We now apply the 2nd law of motion at the load of the motor:
Where Beq is the viscous damping coefficient as seen at the output. Substituting [3.4] into [ 3.5], we are left with:
that and (where is the motor efficiency), We know
we can re-write [3.6] as:
Finally, we can combine the electrical and mechanical equations by substituting [3.3] into [3.7], yielding our desired transfer function:
Where:
This can be interpreted as the being the equivalent moment of inertia of the motor system as seen at the output.
5
2.0 OBJECTIVE
The objective in this experiment is to introduce the student to the fundamentals of control using the PID family of compensators.
At the end of this session, you should know the following:
• How to mathematically model the servo plant from first principles. • An understanding of the different tuning parameters in the controller. • To design and simulate a PV controller to meet the required specifications. • To implement your controller and evaluate its performance.
3.0 APPARATUS
To complete this lab, the following hardware is required: [1] Quanser UPM 2405/1503 Power Module or equivalent. [1] Quanser MultiQ PCI / MQ3 or equivalent.
[1] Quanser SRVO2-(E) servo plant.
[1] PC equipped with the required software as stated in the WinCon user manual.
6
Figure 1.3: Quanser Consulting Plant SRV-02 4.0 PROCEDURE
1. Wiring and Connections
The first task upon entering the lab is to ensure that the complete system is wired as described in the SRV02 Experiment #0 - Introduction. If you are unsure of the wiring, please refer to the SRV02 User Manual or ask for assistance from a TA assigned to the lab.
Now that all the signals are connected properly, start-up MATLAB and start Simulink. You are now ready to begin the lab.
2. Controller Specifications
This lab requires you to design a Proportional + Velocity (PV) controller to control the position of the load shaft with the following specifications:
1. The Overshoot should be less than 5% ( 0.707). 2. The time to first peak should be 100ms (Tp = 0.100).
3. Simulation of the Plant
In Simulink, open a model called “s_position_pv.mdl”. This model includes the modeled plant (SRV-02 Plant Model), as well as the PV controller. Kp and Kv are both set by slider gains. Before you begin, you must run an M-File called
“Setup_SRV02_Exp1.m”. This file initializes all the motor parameters and gear ratios.
Click on Simulation->Start, and bring up the Simulated Position scope. As you monitor the response, adjust Kp and Kv using the slider gains. Try a variety of combinations, and note the effects of varying each parameter.
7
• Make a table of system characteristics ( and ) with respect to changes in Kp and
Kv. (Hold one variable constant while adjusting the other).
• Does the system response react to how you had theorized in section 3.1? Now that you are familiar with the actions of each parameter, enter in the designed
Kp and Kv that you had calculated to meet the system requirements.
*Note: the values should fall within the slider limits.
• Does the response look like you had expected? What is your percent overshoot?
• Calculate your Tp. Does it match the requirements?
*Hint: To get a better resolution when calculating Tp, decrease the time range under the parameters option of the scope.
If the simulated response is as expected, you can move on and implement your controller, if you are close to meeting the requirements, try fine-tuning your parameters to achieve the desired response. If the response is far from the specifications, you should re-iterate your design process and re-calculate your controller gains.
4. Implementation of the Controller
After successfully simulating your controller and achieving your desired response, you are now ready to implement your controller and observe its effect on the physical plant.
Open a Simulink model called “q_position_pv_e.mdl” or “q_position_pv_pot” - ask a
TA assigned to this lab if you are unsure which model is to be used in the lab. The
model has 2 identical closed loops; one is connected similar to the simulation block of the previous section, and the other loop has the actual plant in it. To better familiarize yourself with the model, it is suggested that you open both sub-systems to get a better idea of the systems as well as take note of the I/O connections. In the SRV02 plant block (blue), you will see a gain of 1/K_Cable to normalize the system due to our use of a gain cable (to enable a greater control signal being fed into the plant).
*Note: In place of a standard derivative block in the PV controller, we have place a derivative with a filter in order to eliminate any high frequencies from reaching the plant as high frequencies will in the long term damage the motor.
8
Before running the model, you must set your final values of Kp and Kv in the MATLAB workspace (type it in MATLAB). You can now build the system using the
WinCon->Build menu. You will see the model compile, and then you can use the
WinCon Server to run the system (click on the start button). Your plant should now be responding and tracking a square wave to the commanded angle (Setpoint Amplitude
(deg)).
Plot the Measured Theta (deg) as well as the Setpoint Amplitude (deg) and the
Simulated Theta (deg). This is done by clicking on the scope button in WinCon and
choosing Measured Theta (deg). Now you must choose the Setpoint Amplitude (deg) and the Simulated Theta (deg) signals thru the Scope->File->Variables menu.
• How does your actual plant response compare to the simulated response? • Is there a discrepancy in the results? If so, why?
• Calculate your system Tp and %OS. Are the values what you had expected?
*You can calculate these parameters by saving these traces as an m-file and making our calculations in MATLAB. You could also make your calculations directly from the WinCon scope by zooming in on the signals. It is suggested to make these calculations thru MATLAB as this method will provide greater accuracy.
If you are sufficiently happy with your results and your response looks similar to
Figure 4.1 below, you can move on and begin the report for this lab. Remember,
there is no such thing as a perfect model, and your calculated parameters were based on the plant model. A control design will usually involve some form of fine-tuning, and will more than likely be an iterative process.
At this point, you should be fine-tuning your Kp and Kv based on your findings from above (use the table created in section 4.3 of this lab as a guide) to ensure your response matches the system requirements as seen in Figure 3.
9
Figure 4.1: Step Response to a Command of 30 degrees
We can see by looking at Figure 3, that the position response has a 100ms time to peak and an overshoot of less than 5%. The system requirements have been met and implemented using a PV controller.
5.0 PRE LAB ASSIGNMENT 5.1 Derivations
The schematics for the electric motor is given as below,
10
The mechanical torque on the shaft is proportional to the current Im passing through the
system,
Tm = ƞmKtIm
Where ƞm is the motor efficiency and Kt is the motor‐torque constant that represents the
lumped electrical terms. The back‐emf is produced as the armature rotates in the magnetic field, resulting in the following relationship,
Eemf = ̇
Where is the back‐emf constant and ̇ is the motor shaft velocity. Using Kirchoff’s voltage law, which states that the voltage drop across a close circuit must be zero, the following equation is obtained.
Vm – RmIm – Lm(
) – Eemf = 0
Since = 100 µH (The small value can also be deducted from the relative small size of the
stator.),and
<< 1 amp/s. The values of RmIm and Eemf are easily orders of magnitude
greater than (
). Now disregard the motor inductance and a simplified equation for Im
can be obtained,
= = ̇
Using Newton’s 2nd Law of motion, the mechanical aspect of the motor can be modeled as
̇ = - ƞ
Where is the motor moment of inertia, ƞ is the efficiency of the gearbox, is the gear ratio, and is the torque generated by the motor, is the toque applied by the load.
Now Newton’s 2nd law at the load of the motor becomes,
̈ = - ̇
Where ̇ is the load angular velocity, is the load shaft moment of inertia, and is the viscous damping term at the output. Combining the previous two equations,
11
Note that = and = ƞ , the above equation can be rewritten as ̈ = ƞ ƞ - ƞ ̈ - ̇
Differentiate to obtain ̇ ̇ and plug in the equation for , the equation above becomes
̈ = ƞ ƞ ̇ - ƞ ̈ - ̇
Take the Laplace transforms and rearranges the terms, the desired transfer function becomes
=
Where ( ƞ ) = 0.0052, ƞ ƞ 0.1894, , and b = ƞ ƞ 0.333. The parameters used are listed in the table below,
12
5.2 Controller Design
The design specifications for this system are
• Zero steady state error • 5%
• 0.1 sec
The form of transfer function for the system as derived in the previous section is,
G (s) =
=
With 0, this becomes a type 1 system, and will have zero steady state error for a step input, thus no additional integrator is needed.
A PD controller of the form will be used to obtain desired transient response for the system.
The closed loop transfer function becomes
= =
To approximate the 2nd order system response, disregard the additional zero in the numerator and assume the following form for the denominator,
( ) --1
Using the design criterions, the damping ratio and natural frequency can be calculated as
√
13
Take the natural log of each side for and solve for , obtaining 0.698. Plug this value into the equation for to obtain = 43.8.
Compare the 2nd order response with the closed loop transfer function, values for and are obtained,
= 29.96
= 0.389
Note that these values are only approximations of the transient behavior; the additional zero is likely to decrease the rise time but also increase the overshoot in the process.
In order to satisfy requirements for the actual system, the controller gains must be tuned. The following diagram can be sketched to give an idea of required location of the poles.
14
6.0 RESULTS AND DISCUSSIONS
Table 6.1: Results From The Experiment (Kp fixed)
Kp Kv Peak Time, Tp (s) Maximum Overshoot,
MO (%) 25 -0.1 0.0875 60 25 0 0.07 46.67 25 0.2 0.1 20 25 0.3 0.1 10 25 0.4 0.1 3.33
The table 6.1 above shows the results from the experiment when value of Kp is fixed and value of Kv adjusted. From the table, it can be observed that when the value of the required design specifications obtained when value of Kp is 25 and value of Kv is 0.4. It is also indicated that when the value of Kv increased, the value of Tp also increased while the value of MO decreased. This is consistent with the assumptions made in pre-lab assignment.
Figure 6.1: Block Diagram
The figure 6.1 shows the block diagram of the PV controller Simulation at Kp 25 and Kv 0.4. after being simulated the graphs below obtained.
15
Figure 6.2: Graph Obtained after Simulation (Kp fixed)
The figure 6.2 above shows the result graph obtained after the simulation. The graph obtained is similar to the graph sample in the procedure. The peak time obtained is 0.1 second while the percentage of maximum overshoot is 3.33 %.
16
Figure 6.3: Graph of System Response (Simulation)
Figure 6.4: Graph of System Response (Actual)
Figure 6.3 shows the system response of simulated plant. While, figure 6.4 shows the system response of actual plant after the controller is implemented. From the results, it can be observed that there is discrepancy between the actual and simulation. It can be seen that
17
in actual system response, the maximum overshoot and peak time are decreased. this can be explain by the action of PD controller. The proportional controller will decrease the rise time and also the peak time of the system. While, the derivative controller will decrease the maximum overshoot of the system. Even though the proportional controller will also increase the maximum overshoot, the increment will be eliminated by the action of derivative controller.
Table 6.2: Results From The Experiment (Kp fixed)
No. Kv Kp Peak time, Tp (s) Maximum overshoot, Mo (%)
1 0 8 0.20 5.00
2 0 7 0.10 3.33
Table 6.2 above shows the data for simulation of PV controller with Kv is fixed to 0 and Kp is
varies. If Kp is keep decreasing, the values of Tp and Mo will decrease as per pre lab
assignment had theorized.
Figure 6.5: Block diagram
Figure 6.5 above shows the block diagram for the simulation of PV controller with at Kp=7 and Kv is fixed to 0. After being simulated the graphs below obtained.
18
Figure 6.6: Graph obtained from the simulation of PV controller (Kv fixed)
Figure 6.6 above shows the response of simulation PV controller with the calculated Kp = 7 and Kv = 0. The response that obtained matched what we had expected. The percentage overshoot Mo = 3.33% and Tp = 0.1 both are less than Mo = 5% and Tp=0.1 respectively.
19
Figure 6.7: Graph of System Response (Simulation)
20
Figure 6.7 shows the system response of simulated plant. While, figure 6.8 shows the system response of actual plant after the controller is implemented. From the results, it can be observed that there is discrepancy between the actual and simulation. It can be seen that in actual system response, the maximum overshoot and peak time are decreased. this can be explain by the action of PD controller. The proportional controller will decrease the rise time and also the peak time of the system. While, the derivative controller will decrease the maximum overshoot of the system. Even though the proportional controller will also increase the maximum overshoot, the increment will be eliminated by the action of derivative controller.
There are several limitations during the course of this lab. First, the lack of information and knowledge about PD controller. To overcome the problem, we did some research through internet and books. Second, there are some procedures that we do not understand. In order to understand the procedure, we ask the technician's guidance during the experiment is conducted. Lastly, the main problem is to obtain the mathematical model of the plant. We overcome this problem, we refer to notes, textbook and advice from the lecturer.
After completing this lab, we know that the controller could not be arbitrarily applied to any system. The specification and design of the need to be considered first, before implementing any types of controller to avoid any unwanted result. Wrongly applied the controller can result in instability of the system.
When the integral control action applied to the system, it could bring benefits to the system. Despite decreasing the rise time, it also can eliminate the steady state error, which will bring more stability of the system and reduced system response error.
21
7.0 CONCLUSIONS
From the experiment, it can be concluded that after fine-tuning the controller, there are two combinations of Kp and Kv could be use which are Kp=25,Kv=0.4 and Kp=7, Kv=0. The proportional and derivates control action effect can concluded as in table below.
Parameter Rise Time Overshoot Settling Time Steady state error
Kp Decrease Increase Small change Decrease
Kd Small Changes Decrease Decrease None
It also can be concluded that, effect of adjusting Kp and Kv is consisten with the pre-lab assignment.
22
8.0 REFERENCES
1. Chang, A., Gurocak, H., Karam, P., Levis, M., & Apkarian, J. (2011). Quanser Course
Material Sample. Quanser.
2. Jalili, D. N. (2002). Modelling and Control of Electromechanical Systems. 3. Muthuswamy, D. (2012). Position Control Design:Position and Rate Feedback. 4. Ogata, K. (2012). Modern Control Engineering. New Jersey: Pearson Education Inc.