arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

D. Controller Implementation & Evaluation (Week 3)

hashtag
Objectives

The objective of this part of the DC motor experiment is to implement the controller designed in part B and evaluate its performance.

hashtag
Equipment Required

The following is a list of the required equipment to perform this experiment:

hashtag
Controller Implementation

hashtag
1. Step Response Experiments

  1. Open q_servo_pos_cntrl.slx file. Do not change anything except the PID gains.

  2. Double-click on the Signal Generator and ensure that the following parameters are set to generate a square wave (i.e. step reference):

    • Signal Type = square

hashtag
2. Ramp Response Experiments

  1. Double-click on the Signal Generator and set the following parameters to generate a triangular wave (i.e. ramp reference):

    • Signal Type = triangle

    • Amplitude = 1

hashtag
Results and Questions for Report

Note: Some results require simulation response. This would require running a simulation using your SIMULINK model from Part C Control Design using the model validation K and tau values. The command input will be identical to either the square wave signal or the triangle wave signal implemented during the experiment. The attributes of the simulation will be mentioned in the corresponding section.

hashtag
(A) Step Response

Any simulation results in this subsection will have the following attributes:

  • Command input: Square wave

    • Amplitude: Maximum of 0.4 and minimum of 0

    • Frequency: 0.4 Hz

You may generate the command input either using the Signal Generator block or by using the corresponding command input data saved in the Step Response experiments.

hashtag
i) P Controller

  1. Plot angle or rotary position, i.e., commanded, experimental from Step 1.10, and simulation responses on one figure. Use the same gain value evaluated in Step 1.5 for the simulation response.

  2. What is the effect of proportional controller gain on closed-loop system behaviour?

hashtag
ii) PD Controller

  1. Plot angle or rotary position, i.e., commanded, experimental from Step 1.11, and simulation responses on one figure. Use the same and gain values evaluated in Step 1.11 for the simulation response.

  2. What is the effect of derivative controller gain on closed-loop system behaviour?

  3. Compare the PD simulation (that shows zero steady-state error) and experimental (that shows a steady-state error) results to also discuss regarding the dead zone in the DC motor and how it affects the steady-state error.

hashtag
iii) Sampling Time

  1. Plot angle or rotary position (commanded and experimental) and control input Vm from Step 1.12.

  2. What is the effect of sampling time on closed-loop system behaviour?

hashtag
(B) Ramp Response

Any simulation results in this subsection will have the following attributes:

  • Command input: Triangle wave

    • Amplitude: Maximum of and minimum of 0

    • Frequency: 0.4 Hz

You may generate the command input either using the Repeating Sequence block or by using the corresponding command input data saved in the Ramp Response experiments.

hashtag
i) PD Controller

  1. Plot angle or rotary position, i.e., commanded, experimental from Step 2.3, and simulation responses on one figure. Use the same and gain values evaluated in Step 2.4 for the simulation response.

hashtag
iii) PID Controller

  1. Plot angle or rotary position, i.e., commanded, experimental from Step 2.5 (or 2.4 if applicable), and simulation responses on one figure. Use the tuned , and gain values evaluated in Step 2.6 for the simulation response.

  2. Mention the final PID gains after tuning.

Servo Base

Amplitude = 1

  • Frequency = 0.4 Hz

  • In the Simulink diagram, set the Amplitude gain block to 0.2 and the Constant offset gain block to 0.2. Note that these gain blocks outside the Signal Generator block are introduced to generate the square wave with amplitude limits of 0 V and 0.4 V.

  • Check that the sampling time is set to 0.002 s (located under “Modeling” -> “Model Settings” -> “Solver Details”).

  • P Controller Test: To understand the behavior of a Proportional controller, implement a P controller by typing the values for KdK_dKd​ to 0 and KiK_iKi​ to 0 in the command window. Set KpK_pKp​ as the value obtained in Step 5 of Part C Control Design.

  • Turn on the power amplifier.

  • To build the model, click down arrow on Monitor & Tune under Hardware tab and then Build for monitoring .

  • Open the position scope.

  • Press Connect button under Monitor & Tune and then press Start . Run the experiment for 5 seconds.

  • Save your data. No need to Build again unless you change any blocks or configuration settings in the model.

  • PD Controller Test: By introducing a derivative gain (KdK_dKd​), notice how the system characteristics change. Set KpK_pKp​ and KdK_dKd​ to the respective values found in Step 6 of Part C Control Design. KiK_iKi​ will remain as 0. Connect and Start. Observe the behavior and save the data.

  • Sampling Time Test: Change the sampling time to 0.04 sec. To set the sampling time, you need to go to the block diagram file, and choose “Modeling” -> “Model Settings” -> “Solver Details”. Set the fixed step to 0.04 sec (it should have been 0.002 previously). Build, connect and Run PD Controller, observe the behaviour and save the data with an appropriate filename (e.g. - PD_sampling_0.04).

  • Frequency = 0.4 Hz

  • In the Simulink diagram, set the Amplitude gain block to π/6\pi/6π/6 and the Constant offset gain block to π/6\pi/6π/6. This will generate a triangular wave with amplitude between 0 to 60∘60^{\circ}60∘.

  • Change the sampling time back to 0.002 sec (“Modeling” -> “Model Settings” -> “Solver Details”).

  • PD Controller Test: This test is to determine the ramp response of the system with a PD controller. Set KpK_pKp​ and KdK_dKd​ to the respective values found in Step 6 of Part C Control Design. KiK_iKi​ will remain as 0. Connect and Start. Observe the behavior and save the data.

  • PID Controller Test: In the respective controller gain blocks, change the current values of KpK_pKp​, KdK_dKd​ and KiK_iKi​ to the PID values found in Step 9 of Part C Control Design. Save the data.

  • Repeat the PID controller test with double the gain value for KiK_iKi​ while keeping the same values of KpK_pKp​ and KdK_dKd​, and save the data.

  • Sampling time: 0.002 s (Go to "Modeling" -> "Model Settings" -> "Solver details" -> "Fixed-step size")

    Sampling time: 0.002 s (Go to "Modeling" -> "Model Settings" -> "Solver details" -> "Fixed-step size")

    KpK_pKp​
    KpK_pKp​
    KdK_dKd​
    π/3\pi/3π/3
    KpK_pKp​
    KdK_dKd​
    KpK_pKp​
    KdK_dKd​
    KiK_iKi​
    file-download
    48KB
    q_servo_pos_cntrl.slx
    arrow-up-right-from-squareOpen