• Nie Znaleziono Wyników

Exercise 5

N/A
N/A
Protected

Academic year: 2021

Share "Exercise 5"

Copied!
9
0
0

Pełen tekst

(1)

Laboratory of Mechatronics, Diagnostics and Technical Safety

INSTITUTE of VEHICLES

Faculty of Automotive and Construction Machinery Engineering WARSAW UNIVERSITY of TECHNOLOGY

ul. Narbutta 84, 02-524 Warszawa

Tel. (22) 234-8117 do 8119 e-mail: sekretariat@mechatronika.net.pl http://www.mechatronika.net.pl

Laboratory of Automation Systems

Exercise 5

Created by: Jędrzej Mączak Przemysław Szulim

Subject:

Control systems simulation

Target of the exercise:

The target of the exercise if to introduce students with the structure of PID controllers and basics of software that enables controller systems implementation.

(inner use only)

Warsaw, 4.05.2016

(2)

1. Target of the exercise

The target of the exercise is to build a regulation system from electrical engine’s model, that will allow to perform simulation of its work. Second goal is to introduce methods of controllers tuning. During the exercise, students will:

 Build simulator of an electrical engine controller in LabVIEW environment.

 Select controller parameters for the engine defined by transfer function.

Positive grade is granted by working program and correct report of the exercise. The report should contain valid work parameters of the regulation system. Report has to be done during exercises.

WARNING: In order to participate in the exercise, students are expected to have knowledge about structure of P, I, D regulators.

2. Electrical engine model

Equation describing dynamics of the engine has form:

where: J – rotor’s moment of inertia, MS – engine torque, MO – load torque, ω – angular velocity

Engine torque is directly proportional to motor winding current I and certain constant kT

which is coefficient of proportionality.

Motor winding current is obtained directly through Ohm’s law. Influence of inductance will be neglected for simplicity sake. Therefore current is equal to quotient of resultant voltage Ue

and motor resistance R.

Resultant voltage is the difference of two voltages: one applied to motor clump, and the electromotive force E generated within motor’s wiring.

It is known, that movement of the conductor within magnetic field involves phenomenon called inductance of electromotive force. Within DC motors, electromotive force E is induced through rotation of the shaft that contains coiled wiring, and is kept within constant magnetic field created by permanent magnets. Electromotive force is directly proportional to angular velocity of the shaft ω, as well as coefficient of proportionality kv.

Differential equation below is a mathematical model of electrical motor:

The same equation in slightly different form:

(3)

At this point it is useful to introduce quantity called efficiency η which is a ratio between power produced by motor (output power), and power transmitted towards it. Efficiency can take any real value between 0 and 1. As far as model shown above is concerned, it can be described with such expression:

If we assumed that there were no electrical losses within motor (resistance R equals to zero), the only losses would come from transition of current into torque, which leads to equation:

After substitution, we get following equation:

Having used Laplace transform and after neglecting load torque Mo, we will obtain transmittance:

If losses from transition of electrical current were also neglected (ηT=1), we would come to the following expression:

Finally:

where:

- electromotive force induced for particular angular velocity of the rotor , J - rotor’s moment of inertia ,

R- motor resistance .

Transmittance can be defined in MATLAB syntax by commands:

num=[Kv]; % nominator den=[J*R Kv^2]; % denominator

motor=tf(num,den); % transition function (transmittance)

(4)

2. Regulation system with feedback loop

General diagram of electrical engine regulation system with feedback loop is shown below:

Figure 1. Diagram of motor regulation system with feedback loop.

Regulation system will use Integrating – Differential controller (PI) shown on Fig. 2.

Figure 2. Integrating – Differential controller (PI) diagram

Where parameter kp is a proportional gain, and ki – inverse of doubling time (time constant of integrating action)

3. Model structure

Electrical engine model described above will be constructed in Lab View [1] environment with the aid of Control Design and Simulation library. Most of the functions required to build program can be found in function pallet Control Design and Simulation:

 Simulation loop that contains differential equations solver, enabling usage of integration and differentiator parts is located in Simulation tab;

 Summation, Gain and Integrator blocks can be found in Signal Arithmetic tab;

 Transfer Function block can be reached through Simulation >> Continuous Linear Systems.

Fig. 4 shows block diagram of complete model. In order to build it, perform following steps:

1. Create new VI.

2. Insert simulation loop to the diagram (Control & Simulation Loop). It can be found in Control Design and Simulation >> Simulation. Set simulation parameters according to Fig. 3 by Clicking on the terminal located in top left corner of the loop.

(5)

Figure 3. Simulation loop parameters.

3. Place two Summation blocks in the diagram . Warning, one block will

require additional change of a sign. Add two Gain blocks to the diagram as well

as one Integrator block. . Gain blocks have one input by default. To add extra input: right click on it, press Configuration.. and pick Terminal option for Parameter Source.

4. Create gain controls Kp, Ki as well as angular velocity slider scaled between values (-1, 1). Within user interface window (Front Panel), these controls can be found under Modern>>Numeric library. Assign proper names to controls Kp and

Ki .

5. Insert Transfer Function block which describes motor’s transmittance. From context menu Configuration set Parameter Source>>Terminal.

Note that this block has two outputs: output y(k) and state x(k). The one under name output y(k) should be used.

(6)

6. Insert Simulation Time Waveform (sim time waveform) block from Simulation >> Graph Utilities library. This will add to the front panel window showing waveforms of reference and actual (simulated) velocity of angular velocity.

7. Connect inserted elements according to the diagram on Fig. 4. Build Array block can be found in Programming >> Array library. It should be dragged down in order to enable connection of two inputs.

8. Insert Halt Simulation block from Simulation >> Utilities library, and

connect logical control STOP to its input. . Motor transmittance definition

In order to define motor transmittance, use Math Script node. It allows to perform computations and is based on Matlab syntax.

1. Place Math Script block beyond Simulation loop (Programming >> Structures).

2. Right – click left side of the border and pick Add Input option three times to define three input variables: K, R and J.

3. Define transmittance equation within the block according to Fig. 4.

4. Define output of the node by right – clicking right side of the border and hitting Add Output (name: motor – it contains transmittance of the motor).

5. Connect appropriate constants to inputs K, R, J (see Fig. 4) and connect output (motor) to Transfer Function block within simulation loop. Transfer Function block should have already been configured to contain appropriate input. If this hasn’t been done – look into point 5 above.

Block diagram should look like on Fig. 4.

Figure 4. Electrical engine regulation system simulation model.

(7)

Figure 5. Front panel of the program.

Configuration tips

In order to prepare Front Panel for simulation, follow these steps:

1. Configuration of waveform chart window

a. It is required to extend plot buffer. Right – click on the control, pick option Chart history length from context menu, and input value 100 000.

b. Add palette that allows plot magnification. Right – click on the control again and pick Visible Items >> Graph palette option from context menu. New set of icons will be visible within plot window . Expand middle icon

to pick between different tools, such as: (first row) box magnification, magnification along x or y axis, (second row) fit view, zoom out, zoom in.

c. Turn grid of the plot on by right – clicking Waveform Chart on the Front Panel and picking Properties (see Fig. 8).

2. Configuration of angular velocity slider.

a. To add additional window displaying current value, right – click on slider in Front Panel window, and pick option Visible Items>>Digital display.

3. Configuration of Stop control

a. Stop control should be defined in such way that it’s value was always false once program started, and true after clicking on it. To do so, Right – click on it in Front Panel window, and pick option Mechanical Action>>Lath When Pressed.

(8)

4. Controller parameters selection

Perform initial simulation with parameters Kp and Ki (integration and differential gains of the controller) set to zero value which is equivalent to lack of regulation. In following simulations change one or both parameters and explore influence on response of the system and general regulation quality. Parameters value should be in range (0,2) for Kp and (0,10) for Ki.

5. Exercise execution

In these exercises student should build electrical engine control system such as in Fig. 4 and test its functionality. The goal is to understand how regulation parameters affect work of the control system. Finally, student should find values that provide the best work of the system.

During evaluation, consider the following:

Regulation time tr

This is time from occurring disruption to moment when regulation deviation becomes lower than abs(e) (absolute value). It is often assumed that e = 5% em.

Maximum deviation em

This is maximal value of deviation e(t), that is difference between y(t) (reference signal) and w(t) (output signal from plant).

Overshoot k

where e1 i e2 are amplitudes of first and second peak deviation from reference value.

These quantities are shown on Fig. 7 and 8 [2].

Figure 6. System response for step disruption [2]

Figure 7. Regulation system responses with a) P – type controller, b) I – type controller [2]

(9)

Figure 8. Waveform Chart configuration window

Simulations should be performed for P, I and PI controllers. In order to do this:

• Change motor velocity during simulation in order to set new reference value.

Test all types of regulators by assigning zero or non - zero value to appropriate gains.

Report should include plot of reference value, as well as system response for disturbance.

All explained regulation parameters should be marked within the plot.

Table should contain the best gain values found for each type of the controller and regulation parameters corresponding to it. Results need to be provided with explanation and conclusions what effect has each controller on quality and parameters of the regulation process.

Attention

:

 In order to obtain stepwise change of reference velocity it is practical to change slider into numerical control. It is also possible to add numerical field to the slider: Context menu of the slider >> Visible Items >> Digital Display.

References

1. National Instruments Tutorial: Teach Tough Concepts: Closed-Loop Control with LabVIEW and a DC Motor. http://zone.ni.com/devzone/cda/tut/p/id/12944 (access 20.04.2012).

2. Żelazny M. Materiały pomocnicze do wykładu Podstawy Automatyki.

http://www.scribd.com/doc/44893270/Marek-Elazny-Podstawy-Automatyki (access 20.04.2012) .

Cytaty

Powiązane dokumenty

[r]

Spełnione jest założenie o normalności >> do weryfikacji hipotezy o średnich wybieramy test t. origin=1, origin=3) Sprawdzenie normalności. mpg dla origin=1 mpg dla origin=3

." 4565457859 :;?@A=B :C DEEFG HE IJKLMI NOJPMQRSP KTROM MIJ SJU VW SJQXITROYPZ[\] ^JXQRSKL ]__Q`J _RY VOYRaJZ bRaJSIKXJSc d@> ;ef@ghijgkl =m B n C HopqG rRYMKLQMs MYJStP QS

SZCZEPAN FIGIEL JUSTYNA KUFEL Instytut Ekonomiki Rolnictwa &#!'### *+,Warszawa... Szczepan Figiel,

[r]

[r]

lumen narrowing, increased wall-to-lumen ratio, rarefaction or reduced retinal capillary flow, have been independently associated with cardi- ometabolic diseases: hypertension,

[r]