# The Development And Optimization Of A Controller Biology Essay

**Published:** **Last Edited:**

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

A PID controller was developed for a Quanser-VTOL system. The development

The report covers development and optimization of a PID controller model for a Quanser-developed Vertical Take-Off and Landing (VTOL) system. A PID control model was developed development involves estimate of the system parameters and transfer function using QNET Virtual Instrument (VI) and system identification toolkit (both embedded in LabVIEW) respectively. VTOL system parameters encompass the voltage-current dynamics of the motor and the current-position dynamics of the VTOL body. The optimization of the developed model in Simulink includes fine tuning of the PID parameters with the subsequent application of the parameters on the real system in LabVIEW. The system response so obtained shows that the developed controller is optimum and efficient as the system outputs closely tracks the input within an acceptable error of about Â±2% (as evident in the results obtained).****

## INTRODUCTION

A cascade control, with a Proportional Integral (PI) secondary loop and a Proportional Integral Derivative (PID) primary loop, forms the control system for the VTOL system. The voltage-current and current-position dynamics subsystems of the VTOL are controlled, respectively, by the PI and PID. A PI controller model, designed to the desired VTOL trainer motor specifications of natural frequency of 42.5 rad/s, damping ratio of 0.7 (with assumed inductance 53.8 mH), was manually derived and simulated using current control Virtual Instrument (VI) in LabVIEW and a response closely tracking the input signal was obtained. The VTOL trainer model parameters and transfer function were identified, and used in the validation of the manually derived system function; using LabVIEW System identification toolkit. The result of the system identification was an identified transfer function that best describes the trainer system response. The identified transfer function was compared with that of manually-derived function and observations were made. Consequently, the Proportion Derivative (PD) and PID steady-state errors, on the identified transfer function for the VTOL trainer system were, estimated and validated using the LabVIEW Flight Control VI. The lab was concluded with a set of "best" PID parameters that seem to have produced the best system response as evident by the response signal obtained on the scope which is characterized by reduced steady-state error, improved response time and little or no oscillations.

Finally, the response of the VTOL trainer system was also obtained in Simulink using the obtained identified transfer function for the VTOL and motor system during the lab. Comparison was then made between the responses obtained in both the LabVIEW and Simulink.

Describe the experiment that you have completed and any necessary control theory.

Lab Objectives

Necessary Control theory

## RESULTS

The responses to the following exercises (as asked in the lab manual) give a summary of the laboratory results. These are as follow:

Exercise 1: Rm (avg) = 2.9 â„¦ (see Appendix 5.4.1, Table 2.1 & Appendix 5.5.1)

Exercise 4: kp,c = 0.3 V/A, and ki,c = 97.2 V/(A.s) (see Appendix 5.5.2).

Present your results, you may wish to present what you believe are the main results only and include the less important result in an appendix.

Exercise 2: An increase in the system response time, overshoot and oscillation was observed. (see Appendix 2*** for the wave obtained).

Exercise 3: An increased in the steady state error, but with less overshoot and oscillation compared to the result in exercise 2 above, was observed. (see Appendix 2 *** for the waveform).

Tables are the most common form of diagram in technical reports, Vertical and horizontal rulings can be untidy and confusing: the use of space is a much more successful alternative.

To give more vertical space in a table, units and powers of ten should if possible be put into the column heading. Headings should be matched at the left hand side, for ease of reading and also of typing. Horizontal space is obtained by grouping similar items, with a space after, at most, seven items.

All graphs must be clearly labelled, and scales identified. Margins must be sufficient on

all sides to allow for clarity for all diagrams. Probably the most useful method of numbering is to use first the number of the report section in which the diagram appears, and then, after a decimal point, the sequential number. So Figure 3.7 is the seventh diagram in section three of the report.

## DISCUSSION

Describe your results _ what do they mean? Can you explain any di_erences from

theory?

Paragraphs should have unity of content

The pattern is this:

1. MAIN HEADING

1.1 Lesser Heading

1.1.1 Small Heading

## CONCLUSIONS

What were your main conclusions from the exercise?

## Conclusions

## Recommendations

## APPENDICES

References/Bibliography (In the text, references may be shown by a superscript number, 1;) OR In the text, the author's name, date of publication and page number are given in brackets, as (Lander, 1993, p25).

Examples:

van Emden, Joan, 2005: Writing for Engineers, Palgrave Macmillan, 3rd ed.

Hawley, Robert, 1996: Leadership challenges in an engineering environment,

Engineering Management Journal, vol 6 no 5, pp 217-231

Appendices should be distinguished from the main text by letter, and if necessary decimal

notation after the letter. Appendix B2.4 is therefore the fourth sub-section of the second major section of the second Appendix, and if referencing is correct it should be easy to locate and identify.

used to remove from the main text all information which is not needed by the majority of the users of the report.

is a good place for background information.

excellent for supporting statistics, and diagrammatic material which is not needed as the report is read.

ideal place for lists of symbols, technical terms and abbreviations which are familiar to some but not all readers.

experimental details and will be happy to find them in an appendix.

a Glossary at the beginning or at the end is much more useful than the normal practice of writing out a technical name in full, putting the abbreviation in brackets immediately afterwards in the case of symbols and abbreviations previously mentioned.

## 5.1 Appendix A- Reference

## General

A good dictionary, such as the Concise Oxford Dictionary

van Emden J, Easteal J, 1980: A guide to Technical Report Writing, The IET (Institution of Engineering and Technology) 2010.

www.theiet.org: A guide to Technical Report Â© The IET 2010, The Institution of Engineering and TechnologyÂ®â„¢

www.theiet.org AÂ guideÂ toÂ TechnicalÂ Report WritingTechnical ReportÂ WritingÂ Â© The IET 2010 The Institution of Engineering and Technology is registered as a Charity in England & Wales (no 211014) and Scotland (no SC038698).

## 5.2 Appendix B - Background

## 5.3 Appendix C - In Lab Experiments Procedures

## 5.3.1.0 Current Control

## 5.3.1.1 Find Resistance of the Motor

Open the QNET_VTOL_Current_Control.vi.

Ensure the correct device is chosen from the drop down menu.

(By default the value is Dev1, if nothing happens when you rotate the Open-loop Voltage knob change it to Dev2 etc. Stop the VI using the Stop button and restart).

Run the VI by clicking Operate > Run (or by holding "CTRL" and pressing "R" on the keyboard).

Set the Current Control ON switch to OFF.

Set the Open-loop Voltage knob to 4.0 V. The propeller should begin turning as a voltage is applied to the motor.

Vary the voltage between 4.0 and 8.0 V by steps of 1.0 V and measure the current at each voltage by observing the on screen scope. Enter the results in table 2.1.

## (Ex.1).

Click on the Stop button to stop the VI.

## 5.3.1.2 Verity Qualitative Current Control

Open the QNET_VTOL_Current_Control.vi

Set the Current Control ON switch to ON.

Run the VI.

In the Current Set Point section, set: Amplitude = 0.2 A, Frequency = 0.40 Hz, and Offset = 0.90 A. (This alternates the current set point between 0.90 and 1.10 A every 2.5 seconds).

In the Control Parameters section set the PI current gains to: kp_c = 0.250 and ki_c = 10

Reduce ki_c to 0 (zero) and observe the effect of not having any integral gain.

(Copy and store the response, for use in report writing, by Right Clicking on the scope, then select Data Operations > Copy Data).

## (Ex.2).

In the Control Parameters section set the PI current gains to: kp_c = 0 and ki_c = 100. Copy and store the response as in (6) above.

Ex.3: Show and explain the effect of not having any proportional gain. Store a sample response

Click on the Stop button to stop the VI.

(Caution: When you press the Stop button the propeller will stop and the VTOL Trainer will fall to its resting position. Take care to catch it and lower it slowly to its resting position. Failure to do so could cause damage to the unit).

Ex.4: Calculate and enter (in Table 2.2***Exercise 4) the PI gains, kp;c and ki;c, necessary to satisfy the natural frequency and damping ratio specifications: 42:5 rad/s = 0:70; using Rm from Table 2.****and assume the inductance of the motor to be Lm = 53:8_10-3 H. Enter the values in Table 2.2.

Open the QNET_VTOL_Current_Control.vi.

Set the Current Control ON switch to ON.

In the Current Set Point section, set: Amplitude = 0.20 A, Frequency = 0.40 Hz and Offset = 0.90 A.

In the Current Control Parameters section, set the PI current gains to the values from Exercise 4.

Run the VI.

(The VTOL Trainer propeller should begin turning at various speeds according to the current command. Examine the reference and measured current responses obtained in the Current (A) scope. They should be tracking. If they are not, stop the VI and re-check your calculations).

Ex.5: Include a plot showing the current response with your designed PI gains.

In the Current Control Parameters, slowly reduce the offset current until the system comes to a rest.

Click on the Stop button to stop the VI.

## 5.3.2.0 MODELLING

## 5.3.2.1 Measurement of the Equilibrium Current, Ieq

Open the QNET_VTOL_Current_Control.vi.

Set the Current Control ON switch to ON.

Run the VI.

In the Current Control Parameters section, set the PI current gains found in Exercise 4.

In the Current Set point section, set: Amplitude = 0.00 A, Frequency = 0.40 Hz and Offset = 1.00 A.

Gradually increase the offset current until the VTOL trainer is horizontal.

(The pitch should read 0 degrees when the VTOL Trainer is horizontal. To achieve this you may need to adjust the pitch offset by varying the VTOL Offset parameter. By default this is set to 25.0 degrees).

Exercise 6: The current required to make the VTOL Trainer horizontal is called the equilibrium current, Ieq. When you have found the equilibrium point, record this current, Ieq, in Table 2.4.

In the Current Control Parameters, slowly reduce the offset current until the system comes to a rest.

Click on the Stop button to stop the VI.

Exercise 7: Using equation 2.13, the values in Table 2.3 and the equilibrium current found in Exercise calculate the thrust current-torque constant, Kt. Enter this value into Table 2.4.

## 5.3.2.2 Find Natural Frequency

Open the QNET_VTOL_Current_Control.vi.

Set the Current Control ON switch to ON.

Run the VI.

In the Current Control Parameters section, set the PI current gains found in Exercise 4.

In the Current Set point section, set: (a) Amplitude = 0.00 A, (b) Frequency = 0.40 Hz, (c) Offset = Ieq

Run the VI.

Exercise 8: When the VI starts and the equilibrium current step is applied, the VTOL Trainer will shoot upwards quickly and then oscillate about its horizontal. Store this response and measure the natural frequency. Fill out Table 2.5 with the measured values.

Click on the Stop button to stop the VI.

Exercise 9: Using the values in Table 2.3 and Equation 2.16 (J eqn) and the moment of inertia, J, acting about the pitch axis. Enter the value into Table 2.4.

Exercise 10: Based on the natural frequency found in Exercise 8 and the moment of inertia found from exercise 8, and the stiffness, K, of the VTOL Trainer. Enter the value in Table 2.4.

Exercise 11: Using Equation 2.17 (P(s) eqn), compute the VTOL Trainer transfer function coefficients based on the previously found parameters: Kt, J, B and K. Enter the calculated transfer function in Equation 2.20 (Characteristics Equation) below

## 5.3.2.3 Model Validation for VTOL Trainer

Open the QNET_VTOL_Modeling.vi.

In the Current Control Parameters section, set the PI current gains found in Exercise 4.

In the Current Set point section, set: Amplitude = 0.00 A, Frequency = 0.20 Hz and Offset = Ieq (found from Exercise 6)

Run the VI

(If nothing happens you may need to change the device as you did before).

Let the VTOL Trainer stabilise about the horizontal.

In the Current Set point section set: Amplitude = 0.10 A.

(You should see the current set point change)

In the Transfer Function Simulation Parameters section, enter the parameters computed in Exercise 11.

Exercise 12: Is the simulation matching the measured signal? If not, why not? Store the response.

Click on the Stop button to stop the VI.

## 5.3.2.4 System Identification

Run the QNET_VTOL_Modeling.vi

Set Current Set point section set: Amplitude = 0.10 A, Frequency = 0.20 Hz and Offset = Ieq. (So the VTOL Trainer is about its horizontal with a current set point amplitude of +/- 0.10 A).

Let the VI run for at least 20 seconds.

Click on the Stop button to stop the VI.

(When the VI is stopped, the Estimated Transfer Function displays a newly identified transfer function of the VTOL system based on the last 20 seconds of current and pitch angle data. Given the data collected during this 20 second period, these are the values of the parameters that best describe the response of the system accurately Exercise).

Exercise 13: Enter the identified transfer function in Equation 2.21 below (2nd order Characteristics eqn). How do these differ from your parameters obtained in Exercise 11?

Enter the identified TF parameters into the Transfer Function Simulation Parameters section.

Go through steps 6 - 9 in Section 2.2.3.

In the Transfer Function Simulation Parameters section, enter the parameters computed in Exercise 13.

Exercise 14: How is the simulation matching the measured signal compared to the transfer function with the manually estimated parameters? Store the response.

Click on the Stop button to stop the VI.

Exercise 15: Assume the moment of inertia is as calculated in Exercise 9. Then from the identified transfer function, find the stiffness, Kid, the viscous damping, Bid, and the current- torque constant, Kt,id. How do they compare with the parameters you estimated manually? Enter the identified values in Table 2.4.

## 5.4.0 FLIGHT CONTROL MODE

## 5.4.1 PD Steady State Analysis

Exercise 17: After you complete this lab, calculate the theoretical VTOL Trainer steady-state error when using a PD control with kp = 2 and kd = 1 and a step amplitude of R0 = 4.0 degrees. Enter value in Table 2.6.

Open the QNET_VTOL_Flight_Control.vi

Run the VI

(If nothing happens you may need to change the device as you did before).

In the Position Set point section, set: Amplitude = 0.0 rad, Frequency = 0.15 Hz and Offset = 0.0 rad.

In the Position Control Parameters section, set: kp = 1.0 A/rad, ki = 2.0 A/ (rad.s), and kd = 1.0 A.s/rad.

Let the VTOL system stabilise about the 0.0 rad set point.

(Examine if the VTOL Trainer body is horizontal. If not, then you can adjust the offset by varying the VTOL Offset control).

To use a PD control, in the Position Control Parameters section, set: kp = 2.0 A/rad, ki = 0 A/ (rad.s) and kd = 1.0 A.s/rad.

In the Position Set point section, set: Amplitude = 2.0 rad, Frequency = 0.20 Hz, Offset = 2.0 rad.

(The VTOL Trainer should be going up and down tracking the square wave set point).

Exercise 18: Store the VTOL device step response when using this PD controller and measure the steady-state error. Enter the measured PD steady-state error value in Table 2.6. (How does it compare with the computed value in Exercise 17?).

Exercise 19: In your own time, calculate the VTOL Trainer steady-state error when using a PID controller. Enter values in Table 2.6.

Click on the Stop button to stop the VI.

## 5.4.2 PID Steady State Analysis

Repeat steps 2 - 8 from Section 2.3.1, but this time in the Position Control Parameters section, increment the integral gain until you reach ki = 4:0 A/(rad.s).

Exercise 20: Store the VTOL Trainer step response when using a PID controller and measure the steady-state error. Enter the value in Table 2.6. How does it compare with the expected value found in Exercise 19?

Click on the Stop button to stop the VI.

Exercise 21: Using Equations 2.32 and 2.34, and the natural frequency, wn, and damping ratio, required to meet a peak time of 1.0 seconds and a percentage overshoot of 20%. Enter the values in Table 2.6.

## 5.4.3 PID Control Design

Exercise 22: Calculate the PID gains kp, ki and kd, needed to meet the VTOL Trainer specifications using the values of K, B, and Kt identified and recorded in Table 2.4. Enter the values in Table 2.6.

Open the QNET_VTOL_FLIGHT_CONTROL.vi.

Run the VI.

In the Position Set point, set: Amplitude = 0.0 rad, Frequency = 0.15 Hz, Offset = 0.0 rad.

In the Position Control Parameters section, enter the PID gain values found from Exercise 22.

Let the VTOL system stabilise about the 0.0 rad set point.

(The VTOL Trainer body should be horizontal. If not, adjust the pitch offset by varying the VTOL Offset control).

In the Position Set point section, set: Amplitude = 5.0 rad, Frequency = 0.10 Hz, Offset = 2.0 rad.

(The VTOL Trainer should now track the square wave set point).

Exercise 23: Store the response of the VTOL system when using you designed PID controller.

Exercise 24: Measure the peak time and percentage overshoot of the measured response. Enter the values in Table 2.6. Are the VTOL Trainer response specifications satisfied? Can you tune the controller so that it gives a better response? If so provide your updated tuning parameters.

Click on the Stop button to stop the VI.

## 5.4 Appendix D - Tables and Figures

## 5.4.1 List of Tables

Table 1: Vm, Im and Rm Parameters for the Motor

Input

Voltage (V)

Measured

Current (A)

Resistance (â„¦)

4

1.35

2.96

5

1.65

3.03

6

2.05

2.93

7

2.50

2.80

8

2.75

2.91

Average Resistance, Rm (avg) = 2.93 â„¦ â‰ˆ 2.9 â„¦ (see Appendix 5.5.1)

Table 2: List of Parameters for VTOL Current Control Modes

S/No.

Label

Parameter

Description

Unit

1

Position

## á¶¿

VTOL pitch position numeric display

deg

2

Current

Im

VTOL motor armature current numeric display

A

3

Voltage

Vm

VTOL motor input voltage numeric display

V

4

Current ON?

Switches between open-loop current and voltage control

5

Open-loop Voltage

Input motor voltage to be fed

V

6

Signal Type

Type of signal generated for the current reference

7

Amplitude

Current set point amplitude input box

A

8

Frequency

Current set point signal frequency input box

Hz

9

Offset

Current set point signal offset input box

A

10

kp_c

kp_c

Current control proportional gain

V/A

11

ki_c

ki_c

Current control integral gain

V.s/A

12

VTOL offset

Pitch calibration

deg

13

Device

Select the NI DAQ device

14

Sampling Rate

Sets the sampling rate of the VI

Hz

15

Stop

Stops the LabVIEW VI from running

16

Pitch

## á¶¿

Scope with measured (in red) VTOL pitch position

deg

17

Current

Im

Scope with reference (in blue) and measured (in red) current

A

## Â

## Â

## Â

## Â

## Â

Table 3: PI Current Control Design Parameters

Parameter

value

Units

Rm

2.9

â„¦

Lm

53.8 x 10-3

H

Î¶

0.7

Ï‰n

42.5

rad/s

kp,c

0.3

V/A

ki,c

97.2

V/(A.s)

Table 4: List of Parameters for the VTOL Modelling Mode

S/No.

Label

Parameter

Description

Unit

1

Position

## á¶¿

VTOL pitch position numeric display

deg

2

Current

Im

VTOL motor armature current numeric display

A

3

Voltage

Vm

VTOL motor input voltage numeric display

V

4

Signal Type

Type of signal generated for the current reference

5

Amplitude

Current set point amplitude input box

A

6

Frequency

Current set point signal frequency input box

Hz

7

Offset

Current set point signal offset input box

A

8

kp_c

kp_c

Current control proportional gain

V/A

9

ki_c

ki_c

Current control integral gain

V.s/A

10

VTOL offset

Pitch calibration

deg

11

Transfer Function Parameters

Transfer function used for simulation

12

Simulation

Transfer Function

Displays the transfer function currently being simulated

Hz

13

Order of Estimated Model

Order of transfer function estimated using the LabVIEW system identification toolkit

15

Device

Select the NI DAQ device

16

Sampling Rate

Sets the sampling rate of the VI

Hz

17

Stop

Stops the LabVIEW VI from running

18

Pitch

## á¶¿

Scope with measured (in red) VTOL pitch position

deg

19

Current

Im

Scope with reference (in blue) and measured (in red) current

A

Table 5: Constant Parameters for Equilibrium Current

Parameter

Symbol

Value

Units

Equilibrium current

Ieq

2.0000

A

Current torque constant

Kt

0.0113

N.m/A

Moment of inertia

J

0.0033

kg.m2

Viscous damping

B

0.0020

N.m.s/rad

Stiffness

K

0.0530

N.m/rad

Sys ID: Current torque

Kt,id

0.0200

N.m/A

Sys ID: Viscous damping

Bid

0.0020

N.m.s/rad

Sys ID: Stiffness

Kid

Â 0.0100

N.m/rad

Table 6: VTOL Specifications

Description

Symbol

Value

Unit

Propeller mass

m1

0.068

kg

Counter-weight mass

m2

0.270

kg

VTOL body mass

mh

0.048

kg

Length from pivot to propeller centre

l1

0.156

m

Length from pivot to centre of counter weight

l2

0.056

m

Total length of VTOL Trainer body

lh

0.284

m

Estimated viscous damping of VTOL

B

0.002

N.m/(rad/s2)

Table 7: List of Parameters for Flight Control Mode

S/No.

Label

Parameter

Description

Unit

1

Position

## á¶¿

VTOL pitch position numeric display

deg

2

Current

Im

VTOL motor armature current numeric display

A

3

Voltage

Vm

VTOL motor input voltage numeric display

V

4

Signal Type

Type of signal for the current reference

5

Amplitude

Current set point amplitude input box

A

6

Frequency

Current set point signal frequency input box

Hz

7

Offset

Current set point signal offset input box

A

8

Kp

kp

Position control proportional gain

A/rad

9

ki

ki

Position control integral gain

A/rad.s

10

kd

kd

Position control derivative gain

A.s/rad

11

kp_c

kp_c

Current control proportional gain

V/A

12

ki_c

ki_c

Current control integral gain

V.s/A

14

Device

Select the NI DAQ device

15

Sampling Rate

Sets the sampling rate of the VI

Hz

16

Stop

Stops the LabVIEW VI from running

17

Pitch

## á¶¿

Scope with measured (in red) VTOL pitch position

deg

18

Current

Im

Scope with reference (in blue) and measured (in red) current

A

Table : Natural Frequency Parameters for the VTOL Trainer

Parameter

Symbol

Value

Units

Measured time between n oscillations

Tn

6.300

s

Number of oscillations

n

4.000

Natural Frequency

fn

0.635

Hz

Natural Frequency (Ï‰n = 2Ï€fn)

Ï‰n

3.989

rad/s

Table : Summary of the Results for the VTOL Trainers

Parameter

Symbol

Value

Units

PD steady state-error

ess,pd

2.804

deg

Measured PD steady-state error

ess,meas,pd

2.000

deg

PID steady-state error

ess,pid

0

kg.m2

Measured PID steady-state error

ess,meas,pid

0.2

N.m.s/rad

Desired peak time

tp

1.000

s

Desired percentage overshoot

PO

20.000

## %

Desired pole location

PO

1.000

rad/s

Natural frequency

Ï‰n

4.020

rad/s

Damping ratio

Î¶

0.624

Proportional gain

kp

1.494

A/rad

Integral gain

ki

4.719

A/(rad.s)

Derivative gain

kd

1.580

A.s/rad

Measured peak time

tp

2.000

s

Measured percentage overshoot

PO

20.000

## %

## 5.4.2 List of Figures

Figure : Pictorial Representation of QNET VTOL Trainer

Figure : Pictorial Representation of VTOL Current Control VI - open-loop voltage control mode.

Figure : Pictorial Representation of VTOL Current Control VI - open-loop current control mode.

Figure : Reference and Measured Current Waveforms for the VTOL Trainer System Motor when kp = 0.250, ki = 0.

Figure 5: Reference and Measured Current Waveforms for the VTOL Trainer System Motor when kp = 0, ki =100.

Figure 6: Reference and Measured Current Waveforms for the VTOL Trainer Motor when kp,c = 0.3 V/A, ki,c = 97.2 V/(A.s) (i.e. Designed PI gains)

Figure 7: Cascade Control Structure for the VTOL System Controller

Figure 8: Block Diagram of the VTOL PI Controller

Figure 9: Block Diagram of the VTOL Motor Dynamics

Figure 10: VTOL Motor PI Current Control Loop

Figure 11: Pictorial Representation of the VTOL Modelling VI

Figure 11: Free Body Diagram of the VTOL System

Figure 12: Measured and Simulated Model Signals for the VTOL System's Response Shown in Comparison

Figure 13: Measured and Simulated (Best Identified-model) Signals for the VTOL System's Response Shown in Comparison

Figure 14: Pictorial Representation of the VTOL Flight Control VI

Figure 1: Step Response of the VTOL Trainer When Running PD in LabVIEW

Figure 1: Step Response of the VTOL System When Running PID

Figure 17: Peak and Overshoot plot

Figure 18: VTOL Response When Running the Best Identified PID Gains

Figure 19: VTOL Best Response at kp = 3.0, ki = 5.5 and kd = 1.58

## 5.5.0 Appendix E - Equations and Calculations

## 5.5.1 Resistance Calculations for VTOL Trainer Motor

Resistance (â„¦), Rm = Input Voltage (V), Vm âˆ• Measured Current (A), Im

Average Resistance, Rm (avg) = (Rm1 + Rm2 + Rm3 + Rm4 + Rm5) âˆ• 5

Rm (avg) = (2.96 + 3.03 + 2.93 + 2.80 + 2.91) âˆ• 5 = 2.93 â„¦ â‰ˆ 2.9 â„¦.

(see Appendix 5.4.1, Table 1 for the values of Rm1, Rm2, Rm3, Rm4, and Rm5).

## 5.5.2 PI Controller Design Calculations for the VTOL Trainer Motor

The equation for voltage-current relationship for the VTOL trainer motor is given as

By transfer function,

Using PI controller, the voltage Vm (s), will be equal to

Where E(s) is given by E (s) = Iref (s) - Im (s)

Therefore, the closed-loop transfer function of this system (see Appendix 5.4.2, Fig. 2.5), is

But the standard second order characteristic equation is given as: s2 + 2 Î¶ Ï‰n s + Ï‰n2 = 0

Hence, the proportional gain can be shown to be kp,c = - Rm + 2 Î¶ Ï‰n Lm

And the integral gain shown to be ki,c = Ï‰n2Lm,

Where Ï‰n is the natural frequency and Î¶ is the desired damping ratio.

Hence, given Ï‰n = 42.5 rad/s, Î¶ = 0.7, Lm = 53.8 x 10-3 H (Assumed inductance for the VTOL trainer motor), and Rm = Rm (avg) = 2.9 â„¦ (see Appendix 5.4.1, Table 2.1),

kp,c = - Rm + 2 Î¶ Ï‰n Lm = -2.9 + (2 x 0.7 x 42.5 x 53.8 x 10-3) = 0.3011 V/A â‰ˆ 0.3 V/A and

ki,c = Ï‰n2Lm = (42.52 x 53.8 x 103) = 97.18 V/(A.s) â‰ˆ 97.2 V/(A.s)

## 5.5.3 Thrust Current-Torque Constant Calculation

As shown in Figure 11 (see Appendix 5.4.2), the torques acting on the rigid body system can be described by the equation

(1)

The thrust force, Ft, is generated by the propeller and acts perpendicular to the fan assembly. The thrust torque is given by:

(2)

Where l1 is the length between the pivot and centre of the propeller (see Figure 11, Appendix 5.4.2). In terms of the current, the thrust torque equals

(3)

Where Kt is the thrust current-torque constant.

With respect to current, the torque equation becomes:

(4)

The torque generated by the propeller and the gravitational torque, both, acting on the counter-weight in the same direction and oppose the gravitational torques on the body and propeller assembly.

We define the VTOL trainer as being in equilibrium when the thrust is adjusted until the VTOL is horizontal and parallel to the ground. At equilibrium, the torques acting on the system are described by the equation:

(5)

Kt = ((mhglh/2) + m1gl1 - m2gl2) /Ieq , (6)

Assume g = 9.81 m/s2, and using equation (6) above,

Kt = ((0.068 x 9.81 x 0.156) + (0.5 x 0.048 x 9.81 x 0.284) - (0.27 x 9.81 x 0.056)) / 2

Kt â‰ˆ 0.0113 N.m /A.

## 5.5.4 Natural Frequency Parameters Calculations for the VTOL Trainer

Number Oscillations, n = 4,

Measured Time between 4 Oscillations, Tn = 6.3s,

Natural Frequency, fn = n/ Tn = 4/6.3 â‰ˆ 0.635 Hz,

Natural Frequency, Ï‰n = 2Ï€fn = (2 x Ï€ x 0.635) â‰ˆ 3.989 rad/s.

## 5.5.5.0 Manually-estimated Model Parameters for the VTOL Trainer

The angular motions of the VTOL trainer with respect to a thrust torque, Ï„t, can be expressed by the Equation

(7)

Where á¶¿ is the pitch angle, J is the equivalent moment of inertia acting about the pitch axis, B is the viscous damping, and K is the stiffness. With respect to current, this becomes

(8)

The moment of inertia of discrete objects about a point can be defined as:

(9)

Where for object i, mi is its mass and ri is the perpendicular distance between the axis of rotation and the object. The transfer function representing the current to position dynamics of the VTOL trainer is:

(10)

Where K is the system stiffness. This is obtained by taking the Laplace transformation of Equation (8) and solving for á¶¿ (s)/Im(s). Notice the denominator

(11)

matches the characteristic second-order transfer function

s2 + 2 Î¶ Ï‰n s + Ï‰n2 (12)

## 5.5.5.1 Moment of Inertia, J

From equating (9) Appendix 5.5.5, and Figure 11, Appendix 5.4.2, the moment of inertia, J, acting about the pitch axis, J, is given as

J = mh(rh/2)2+ m1r21 + m2r22) = mh(lh/2)2+ m1l21 + m2l22

= (0.048 (0.284/2)2 + (0.068 x 0.1562) + (0.27 x 0.0562) â‰ˆ 0.0033 kg.m2.

## 5.5.5.2 Stiffness Constant, K

Comparing the terms in the characteristic and model equations (12) and (11), Appendix 5.5.5 respectively, the stiffness constant, K, is given as

K/J = Ï‰n2, therefore K = J Ï‰n2, = 3.989 rad/s (see Table 8, Appendix 5.4.1).

K = J Ï‰n2 = 0.0033 x 3.9892 â‰ˆ 0.053 N.m/rad.

## 5.5.5.3 VTOL Trainer Transfer Function

From Equation 10, Appendix 5.5.5 and Table 5, Appendix 5.4.1,

Kt = 0.0113 N.m/A, K = 0.053 N.m/rad, B = 0.0020 N.m.s/rad, and J = 0.0033 kg.m2.

Therefore,

(1/0.0033)(0.0113

P (s) = ---------------------------------------------------

(1/0.0033)(0.0033 s2 + 0.0020 s + 0.053)

3.424

P (s) = ---------------------------------------

s2 + 0.6065 s + 16.06

## 5.5.6 LabVIEW-identified Model Parameters for the VTOL Trainer

The best identified transfer function for the trainer system is given as

6.054

Pi (s) = --------------------------------

s2 + 0.568 s + 2.949

Comparing the terms in the above expression for the identified transfer function, Pi (s), with the equation (10), Appendix 5.5.5 and assuming J = 0.0033 kg.m2 (see Exercise 15, Section 2.0). Therefore, we have

Kt,id = 6.054 x J = 6.054 x 0.0033 = 0.0199782 N.m/A â‰ˆ 0.02 N.m/A

Bid = 0.568 x J = 0.568 x 0.0033 = 0.0018744 N.m.s/rad â‰ˆ 0.002 N.m.s/rad.

Kid = 2.949 x J = 0.0033 x 2.949 = 0.0097317 â‰ˆ 0.01 N.m/rad.

## 5.5.7.0 Steady-state Errors

The steady-state error of a system can be defined as the difference between the reference, r(t), and measured, y(t), signals once the system has settled. Hence the steady state error in the time domain can be defined as

(13)

Using Final Value Theorem (FVT), the steady-state error of the VTOL closed-loop PID step response is

(14)

Where R0 is the magnitude of the step change in the reference signal.

For a PD controller, the integral gain, ki, will be set to zero. Hence, equation (14) becomes:

(15)

This simplifies to

(16)

## 5.5.7.1 PD Steady-state Error

Given kp =2 A/rad, ki = 1 A/rad.s and Ro = 4.0 degrees, then PD steady-state error is

4 x 0.053

ess,pd = -------------------------------- = 2.804232804 â‰ˆ 2.804 degrees

0.053 + (0.0113 x 2)

## 5.5.7.2 PID Steady-state Error

From equation (14), the PID steady-state error for the VTOL system is given as

0

ess,pid = ------------ = 0 degrees. As all other terms would have become zero.

Ktki

## 5.5.8 PID Control Design

The standard second-order transfer function has the form

(1)

The properties of its response depend on the values of Ï‰n and Î¶. Consider when a second-order system is subjected to a step of

(2)

With an amplitude of R0 = 1.5. The obtained response is shown in Figure 17, Appendix 5.4.2, where the red trace is the output response, y (t), and the blue trace is the reference step, r (t).

The maximum value of the response is denoted by ymax and it occurs at a time tmax. For a response similar to Figure 2.4, the percentage overshoot is found using the equation

(3)

From the initial step time, t0, the time it takes for the response to reach its maximum value is

(4) This is called the peak time of the system. In a second-order system, the amount of overshoot depends solely on the damping ratio parameter and it can be calculated using the equation

(5)

Rearranging to find Î¶ gives

(6)

The peak time depends on both the damping ratio and natural frequency of the system and it can be shown that the relationship between them is

(7)

Rearranging to find Ï‰n gives

(8)

In general, the damping ratio affects the shape of the response while the natural frequency affects the speed of the response.

## 5.5.8.1 Natural Frequency and Damping Ratio Calculations

Given tp = 1.0s and PO = 20 %, then

Damping Ratio, Î¶, = ln (PO/100) âˆš (1/ (ln (PO/100)2 + Ï€2) = - ln 0.2 âˆš (1/ (ln (0.2)2 + Ï€2) = 0.624.

Natural frequency, Ï‰n, = Ï€ / (tp âˆš (1 - Î¶2)) = Ï€ / âˆš (1 - 0.6242) = 4.02 rad/s.

## 5.5.8.2 PID Gains Calculations

The values of the tuning parameters can still be derived to be functions of Ï‰n and Î¶ as follows:

-K + 2 Î¶ Ï‰nJ + Ï‰n2J

kp = -------------------------------- (9)

Kt

Ï‰n2J

Ki = ---------- (10)

Kt

-B + J + 2 Î¶ Ï‰nJ

Kd = ---------------------------- (11)

Kt

Kid = 0.0033 N.m/rad, Kt,id = 0.020 N.m/A, J= 0.0033 kg.m2 and Bid = 0.002 N.m.s/rad (see Table 5, Appendix 5.4.1). Also Î¶ = 0.624 and Ï‰n = 4.02 rad/s.

Therefore, using the equations (9), (10) and (11) above, the PID gains are

- Kid + 2 Î¶ Ï‰nJ + Ï‰n2J

kp = --------------------------------

Kt,id

kp = (-0.01 + (2 x 0.624 x 4.02 x 0.0033) + (4.022 x 0.0033))/ 0.02 = 2.9942644 A/rad.

kp â‰ˆ 2.994 A/rad.

Ï‰n2J

ki = ---------- = (4.022 x 0.0033) / 0.02 = 2.666466 A/rad.s

Kt,id

ki â‰ˆ 2.666 A/rad.s.

-B + J + 2 Î¶ Ï‰nJ

kd = ------------------------

Kt,id

kd = (- 0.002 + 0.0033 + (2 x 0.624 x 4.02 x 0.0033)) / 0.02 = 0.8927984 A.s/rad

kd â‰ˆ 0.893 A.s/rad.

## 5.6 Appendix F - List of Symbols

LabVIEW - Laboratory Virtual Instrumentation and Electronic Workbench

VI - Virtual Instrument

Fig. - Figure

Ex. - Exercise