AE4610
  • Welcome
  • Experiments
  • Lab 0: MATLAB & SIMULINK
  • Lab 1: Rotary Servo Base
    • A. Integration (Week 1)
    • B. Modeling (Week 1)
    • C. Control Design (Week 2)
    • D. Controller Implementation & Evaluation (Week 3)
  • Lab 2: 3 DOF Gyroscope
    • A & B. Modeling and Control Design (Week 1)
    • C. Controller Implementation (Week 2)
  • Lab 3: Rotary Flexible Link
    • A. System Identification (Week 1)
    • B & C. Control Design and Controller Implementation (Week 2)
  • Lab 4: Rotary Inverted Pendulum
    • A & B. Modeling and Balance Control
    • C. Swing-up Control (Demo)
  • Final Project
  • Archive
    • Old Lab 1 Model Validation
    • Problem Set
    • DC Motor
    • Lab 1: Rotary Servo Base (Older Version)
      • A. Integration (Week 1)
      • B. Modelling (Week 1)
      • C. Position Control (Week 2)
    • Quadcopter
    • Gyroscope
    • Inverted Pendulum
    • 3DOF Helicopter
    • Torsional Pendulum
    • Aero LQR
      • A. System Identification
      • A. System Identification (Week 1) last check
      • B. Control Design & Implementation (Week 2)
    • Rotary Gyro
      • Rotary Gyro
    • 2 DOF AERO
      • A. System Identification
      • B. Control Design
      • C. Controller Implementation
    • Copy of Lab 4: Rotary Inverted Pendulum
      • Week 1
      • Week 2
Powered by GitBook
On this page
  • Objectives
  • Equipment Required
  • Controller Implementation
  • 1. Step Response Experiments
  • 2. Ramp Response Experiments
  • Results and Questions for Report
  • (A) Step Response
  • (B) Ramp Response

Was this helpful?

Export as PDF
  1. Lab 1: Rotary Servo Base

D. Controller Implementation & Evaluation (Week 3)

PreviousC. Control Design (Week 2)NextLab 2: 3 DOF Gyroscope

Last updated 3 months ago

Was this helpful?

Objectives

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

Equipment Required

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

Controller Implementation

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 block and ensure that a 0.4 Hz square wave input is being applied. Note that the gain blocks outside the Signal Generator block are introduced to generate the square wave with amplitude between 0 V to 0.4 V.

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

  4. Turn on the power amplifier.

  5. Open the position scope.

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

  7. 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).

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

    • Frequency = 0.4 Hz

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

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 triangle signal implemented during the experiment. The attributes of the simulation will be mentioned in the corresponding section.

(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

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

i) P Controller

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

ii) PD Controller

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

  2. 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.

iii) Sampling Time

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

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

(B) Ramp Response

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

  • Command input: Triangle wave

    • Frequency: 0.4 Hz

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

i) PD Controller

iii) PID Controller

  1. Mention the final PID gains after tuning.

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 .

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

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

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 . KiK_iKi​ will remain as 0. Connect and Start. Observe the behavior and save the data.

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∘.

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 . 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 . Observe the behavior. Save the data only if there is no steady-state error.

PID Controller Tuning: If the PID controller test has not eliminated the steady-state error, tune the gain values (KpK_pKp​, KdK_dKd​ and KiK_iKi​) until the system ramp response has zero (or nearly zero) steady-state error. Save the data and gain values after the final tuning.

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

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

Amplitude: Maximum of π/3\pi/3π/3 and minimum of 0

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

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 KpK_pKp​, KdK_dKd​ and KiK_iKi​ gain values evaluated in Step 2.6 for the simulation response.

Step 5 of Part C Control Design
Step 6 of Part C Control Design
Step 6 of Part C Control Design
Step 9 of Part C Control Design
48KB
q_servo_pos_cntrl.slx