370/labs/lab2-servomotor.docx · web viewlab no. 2 servomotor analysis and control servomotor...

70
1 California University of Pennsylvania Department of Applied Engineering & Technology Electrical Engineering Technology EET 370: Instrumentation Design 1 Lab No. 2 Servomotor Analysis and Control

Upload: dangduong

Post on 06-May-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

1

California University of Pennsylvania

Department of Applied Engineering & Technology

Electrical Engineering Technology

EET 370: Instrumentation Design 1

Lab No. 2

Servomotor Analysis and Control

Page 2: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

2

Servomotor Analysis and Control

Laboratory Experiment Objective.

This is a multistage experiment. Students will gain understanding of different motor control techniques.

In order to achieve this objective, student will demonstrate the ability to:

- use software tools to investigate the behavior of a servomotor

- use software tools to interface, acquire, analyze, and control a servomotor.

- analyze and discuss the effect of different control strategies on a servomotor.

- Optional, students may synthesize, construct, and implement analog controllers.

Preface:

This experiment is divided into several sub experiments. Students should read all steps carefully and make best judgments as they proceed through these experiments. Since all experiments are related in the way they build on each other, it is imperative that each experiment is performed excellently.

Students must read all steps and perform all required tasks.

The complexity of the experiments increase as we advance through the set.

Deliverables:

A formal laboratory report is to be submitted at the conclusion of the set. Thus, students are encourage to document all steps and to save electronic copies of all results.

Page 3: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

3

Experiments:

The experiments are as listed below. A brief explanation of each experiment is provided (as needed.)

Experiment 2-A: Introduction to LabVIEW DAQ system (Two weeks experiment)

Experiment 2-B: Servomotor interface to LabVIEW. (One week Experiment)

Experiment 2-C: Investigation of Servomotor Open-Loop and Closed Loop performance

Experiment 2-D: Controller Design and Implementation – speed control ( PID)

Experiment 2-E: Controller Design and Implementation – Position Control (students are to decide on best control strategy)

Experiment 2-F: Controller Design and Implementation- speed control (Phase Lag, Phase Lead)

Experiment 2-G: Controller Design and Implementation - speed control (Phase Lead-Lag)

Parts Needed:

- myDAQ

- 2n3904 and 2n3906 BJTs

-LM 741

- Pololu 6VDC, 120 RPM 50 oz-in Gearmotor w/ Encoder

- Breadboard

Reading References

1- Refer to the “Servomotor Identification” document on my web page under EET 410 labs.

2- Refer to the datasheet regarding the servomotor (found under Labs for this course)

3- Refer to Chapter 8 in your textbook and to the myDAQ Specifications and User’s guide on the course’s page.

Page 4: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

4

Experiment 2-A: Introduction to LabVIEW DAQ system

Answer all question clearly and completely.

Objective: To gain first hand familiarity with some of the DAQ device I/O terminals and capabilities

Section I – Analog InputA- Getting to Know the Data Acquisition (DAQ) board

The DAQ device used in the laboratory is National Instrument’s myDAQ

NI myDAQ provides analog input (AI), analog output (AO), digital input

and output (DIO), audio, power supplies, and digital multimeter (DMM)

functions in a compact USB device

From the myDAQ Specs. and User’s Guide, answer the following:

a- Number of possible analog inputs in differential mode is ---------, and the number of analog inputs if used in stereo audio input is: --------------

b- These analog inputs operate in differential or single ended mode ? -------------

c- Sampling rate in one channel mode is -----------

d- The maximum voltage range on the analog inputs is ----------------

e- Number of bit in the A/D conversion is -------------------

f- Number of analog outputs as ground referenced is --------------, and as audio stereo outputs is ---------------

g- the D/A conversion for the analog output is ---------------- bits

Page 5: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

5

h- the maximum update rate is ----------------

i- the maximum range on the analog output is --------------

j- the maximum output current per channel is ----------------

k- the maximum TOTAL power available from the power supplies is -----------

l- Number of digital I/O lines is ---------------

m- How are the digital lines configures as inputs or as outputs ? -------------

n – the maximum output current per DIO line is ----------------

o- Number of counters/timers ------------, number of bits (Resolution) ---------------, frequency

------------, the maximum update rate is --------------

p- Which pins are used for the timer counter functions ? ---------------------------

q- What does PFI stand for ? -------------------------------------------------------

r- What is the difference between RSE (Reference Single Ended) and Differential mode inputs ?

s- Give an example where differential mode input is mostly used. ----------------

Page 6: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

6

B- Test the DAQ board

1- Do not launch LabVIEW yet.

2- Connect the 20-pin screw terminal connector to the board (most probably already done)

3- Using the USB cable, connect the myDAQ to your PC

4- Once acknowledged by the PC, launch the Measurement and Automation Studio . It should be found on the desktop.

5- In the Measurement and Automation Studio, expand the Devices and Interface

6- find myDAQ and click on it.

7- click on Self-Test -- if all is ok, should get a passing message.

8- click on Test Panel >>Analog Input>>Start. Should see a noisy signal.

9- click on Digital I/O , Click Start, set the line directions to All Outputs>> change the states and watch the results below. Stop

10- click on Counter/Timer>>change the mode to Edge Count. Start, should see counting due to noise.

11- if all the above work, the device is working properly. Close the M&A studio

C- DAQ as an input device –DC Input

1- Ensure that the voltage applied to the DAQ never exceeds 10V. (For our case, we will always work with a maximum of +/- 8V)

2- Run LabVIEW

3- Start a blank VI and develop a DC voltmeter

on the block diagram, functions>>Input>>DAQ Assistant (may be different path: Functions>>Measurement I/O, Dmax, DAQ Assistant)

A menu pops up, select Acquire Signal>>Analog Input>>Voltge>>Analog Input 0 (AI0), then click Finish

Click on the Terminal Configuration, you will notice, you cannot change the mode from Differential for this DAQ.

Set the acquisition mode to One Sample on Demand.

select analog input channel 0 (ai0)

Page 7: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

7

On the Front panel, place a numeric indicator and set the range to be -10 to +10

select the Digital Display to be as shown.

In the block diagram, connect the DAQ assistant output to the meter indicator.

Enclose the two items in the block diagram with a while loop

Make sure the bench power supply is turned all the way down to zero volts

and that it is turned OFF. From your bench power supply, connect the ground to the AIGND and the DC voltage to the AI0+.

Run the VI. Slowly increase the DC voltage (NEVER EXCEED 8Volts.) You should notice the meter reading changing accordingly.

Set the DC supply to 5 volts. Does your meter measure 5V (within 2%)? --------

There should be an error in the reading. This should be due to the fact that the DAQ

input configuration is --------------------?

Stop the VI, Connect the AI0- to the AIGND to the bench reference. Run the VI. Is the voltmeter providing more accurate results ? ---------------------------

Demo to instructor.

Double click on the DAQ Assistant and change the acquisition mode to Continuous.

Run the VI ---- vary the DC input (careful not to exceed 8 Volts.) Do you notice any difference in performance?

Comments: ----------------------------------

Page 8: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

8

D- DAQ as a DC output and DC input Device.

Remove any wiring connections to the myDAQ.

1- Start a new blank VI

2- Build this on the front panel.

3- Place a while loop in the block diagram to enclose the control and indicator and to allow room for adding two DAQ Assistants.

4- Place a DAQ Assistant and select Generate Signal>>Analog Output>>Voltage>>0 (AO0)

5- change the generation mode to continuous and set the min and max ranges to -8 and +8 volts. Click OK

6- Connect the control (output voltage) to the DAQ Assistant’s input.

7- Place a DAQ assistant and configure it as analog input voltage at AI0. Set the range to +/-8 Volts and set the acquisition mode to continuous.

8- Connect the meter indicator to this DAQ assistant’s output. This will be the input from the DAQ to LabVIEW.

9- On the myDAQ, connect the Analog output GND to the Analog Input GND and connect AI0- to the analog input GND. All are set to the GND reference.

10- Connect the Analog output 0 (AO0) to the Analog Input 0+

11- Run the VI, you should notice that the meter reading is displaying the signal provided by the control knob. Using digital displays to show accurate readings.

12- Demonstrate to instructor.

Page 9: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

9

Section II – Analog Output

Part –A DC output

1- Design a simple VI so that the user can manually adjust a DC voltage level between -5 to 5 Volts Make sure the knob control shows a digital display. Set the digital display to two decimal places.

2- Using the DAQ assistant, configure it for DAQ analog output voltage on ao0. On the configuration window, set the min and max to -8 to +8 Volts ,respectively. Set the configuration mode to On Demand.

3- Monitor the DC output using the bench DMM and verify correct operation.

4- Configure a DAQ assistant for analog input at ai0. Set the min and max to -8, +8, and configuration mode to On Demand.

5- feed the DAQ DC output of step 2 above back into the DAQ input. (ensure the differential mode is connected properly.)

6- Note, tie analog out ground to the analog in ground and to the bench meter’s ground.

6- Display the reading using meter indicator and verify correct operation. Include a digital display with the meter. Set the display to two decimal places.

7-enclose the DAQ system on the block diagram in a while loop.

Place front panel (showing results) and commented block diagram here.

Part - B Continuously varying DC output

1- Do not modify the DAQ assistants of part A.

Page 10: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

10

2- Remove the knob control on the front panel. The Varying DC is to be generated automatically.

3- Design the VI so that it outputs automatically a DC voltage between -4 to +5 volts in increments of 0.5volts. Wait 1000ms between increments (or enough time for you to distinguish values.) The loop should then automatically stop once the output just exceeds 5Volts.

4- The front panel should have the meter reading and a switch to power the VI ON to start incrementing (do not bother with turning the VI off during the process.) Verify operation of measurements and the power switch.

5- Use decoration and good layout on the front panel.

Place front panel (showing results) and commented block diagram here.

Part - C Analog Output (AC)

1- Start with a blank VI

2- place a signal generator VI on the block diagram.

3- On the block diagram, create control inputs for amplitude, frequency, signal type and sampling information. Your block diagram should look like this

Page 11: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

11

The Front Panel should look like this:

Change the amplitude to 2V, the frequency to 500Hz, the sampling frequency to 20K and the number of samples to 1000. Select sine wave for the signal type.

4-Place a waveform graph on the front panel and resize it to be easier to read.

5- Place a DAQ Assistant and set it up for analog output voltage at AO0. Enclose all Vis on the block diagram with a while loop

Configuration of the DAQ Assistant: This part is tricky and it is worth spending time on it to better understand it.

- we would set the Generation mode to On Demand if the signal is at DC or if it is at a VERY low frequency (1 or 2 Hz.)

- However, we prefer continuous generation mode. BUT, we may run into computer hardware problems. Data may fill the buffer too fast (faster that reading it) or the data in the buffer may be overwritten before it is read – thus lost.

e- For now, set the Generation mode to Continuous Generation , a sampling rate of 20KHZ and 100 samples to write

f- On MyDAQ, feedback the DAQ output to the analog input (ensure the differential input is taken care of.)

g- Place another DAQ assistant to acquire a voltage signal at AI0. Set up DAQ assistant to the same voltage levels and same terminal configurations as above.

h- Tricky part again: Set the acquisition mode of the N samples. This way, the DAQ will read the exact number of samples available in the buffer with samples to read = 100 and a sampling frequency of 20K.

You should have the following on the block diagram.

Page 12: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

12

6- Set up a sine wave signal at 500Hz and 2V pk.

7- verify the signal output using the scope (waveform graph) on the front panel.

8- On the front panel, change the time scale on the waveform graph to a maximum of 4ms and disable auto scaling on the x-axis. Change the input frequency to 1KHz. Do you still obtain a reasonable waveform ? ---------

9- While the VI is running, Change the input frequency to 2KHz. Do you still notice a reasonable

sine wave ? ---------------- What distortion do you notice ? -------------------------------------

Page 13: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

13

10- While the VI is still running, change the # of samples on the front panel to 10000. What do you notice?

11- Stop he VI. On the block diagram, change the number of samples to write and to read to 2K. Run the VI, you should notice slight improvement in the waveform.

12- While the VI is running, change the input frequency back to 1KHz. You should see a proper sine wave. ? -------------

13- Again, while the VI is still running, change the input frequency to 4KHz. What do you notice ?

14- While the VI is running, slowly increase the input frequency until the waveform changes to a triangular wave.

Explain why did this happen : ------------------------------------------------------

At what input frequency did this occur ?

15- change the input frequency back to 1KHz and, while the VI is running, change the signal type to sawtooth, square wave, and triangular wave .

16- Remove the DAQ input labeled as “From DAQ” (to optimize performance) and only obtain a sine wave output

17-While monitoring the signal on the bench scope, use your skills to determine the maximum frequency of a sine wave that can be obtained from the system.

18- What is your answer to #17 ? Explain the result to instructor.

Page 14: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

14

Part - D Analog Output ( Adjustable Duty Cycle)

Using the VI from above, modify the Basic Function Generator tol produce a TTL waveform (0V to 5V) at 1KHz and allows the user to :

1- vary the duty cycle between 20% to 80%

2- The waveform should be observed on the scope for verification

3- The front panel should display the generated waveform on a waveform graph. (Do not have to feed the output waveform back to the input of the DAQ)

4- Display the following MEASURED parameters on the front panel: (May use function in the Signal Processing palette)

a. Frequency

b. DC value

c. RMS value

Include images of the front panel and the commented block diagram here.

Section III- Digital I/O

Digital channels can be configured as input or output. Binary control/indicators are used for this purpose. One may work with a port or individual lines. This option is selected upon configuring the DAQ assistant. Port values can also be read or written to using 8-bit integers or array of Boolean.

In this part of the experiment you are to configure a digital I/O port as a write/read.

A- Digital Output

1- Connect the connector block and measure the voltage levels at each DIO0, DIO1, DIO2, DIO3 with respect to /digital GND. What are the voltage levels at these lines?

2- The default case for these voltage levels is H or L ?

3- The result in 2 should be used as a reference when designing a digital I/O polling.

4- Construct the following VI

Page 15: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

15

a- on the front panel build an array of 8 LEDs as control (refer to Figure 9.59 on page 445 of your textbook.) Note, place one LED (one resized) into the array and then expand the array to show only 8 elements (though the figure is showing 4)

b- label the array Port 0

c- place a Stop control button

d- on the block diagram, change the LED array to Control

e- build the following block diagram

f- Run the VI, turn on/off LEDs and see the equivalent unsigned value. It should now make sense why the array was revered!!

g- Remove the unsigned number value indicator and continue building the VI on the bottom of page 443. DO NOT check the Invert All Lines in Port since our diodes are to use positive logic.

Page 16: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

16

h- Test DIO0 – DIO3 as you turn on and off the LEDs on the front panel. Should have a positive logic result! Is it?

j- Have instructor verify correct operation.

B- Digital Input

On your own, design a VI to have 4 LEDs on the front panel that will react to digital LINE input.

LED3 LED2 LED 1 LED0 (of course, in an array)

The conditions are:

Assume 4 bit digital inputs:

DIO3 DIO2 DIO1 DIO0

and the 4 LEDS are arranged to represent the 4 bits.

If DIO0 is switched LOW, LED1 will turn ON and so on

Note: Keep the proper sequence from LSB to MSB

Demonstrate a successful operation to instructor

Page 17: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

17

Experiment 2-B: Servomotor interface to LabVIEW.

In this experiment, the LabVIEW to servomotor interface is established.

1- Construct the circuit shown. Make sure to obtain the header pins from the instructor to enable ease of use of the motor with the breadboard. Only the red and black wires (power and ground wires) are used for this part of the experiment.

3

2

4

7

6

51

9V

-9V

2N3904

2N3906

Servo

DC input from DAQ

2- Design the LabVIEW front panel and block diagram as shown. Here, we will use the lower level VIs to reduce the overhead on acquisition timing. It is recommended that you close all none-related running tasks on your PC. Connect myDAQ to the PC.

Important: Connect the Digital ground, analog input ground, analog output ground, AI0-, the motor’s ground wire and the power supply common to a common bus on your breadboard.

a- place a numeric control knob and change its data range to be between -6 and 6.

b- on the block diagram, place a “Create channel VI” found under: Measurement I/O>>NI-MAQmx>>Create Channel. On its pull down menu, change to Analog output>.Voltage

c- Display the context help window. place a 6 and -6 for the max and min values.

Page 18: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

18

d- right click on the “physical channel” and create control

e- right click on the output terminal configuration and create constant. From the resulting menu, select RSE.

f- before proceeding, go to the front panel and from the pull down menu, select your device and ao0. If you are not sure what is your device number, place a DAQ assistant and start to configure it for acquisition. When the pop-up window appears, it should show the device number.

g- Return to the block diagram. Place a Start Task VI and connect it as shown. Ensure that task ID and error flows through the Vis. Build the rest of the block diagram as shown

h- On the front panel: Edit>>Make Current Values Default then save the VI and ServoDirection

i- connect Ao0 to the op-amps noninverting input as shown in the circuit above. Power the circuit.

Run the VI and verify that the motor’s speed and direction vary as the DC voltage is varied on the front panel.

Page 19: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

19

3- Rising Edge count

a- Open ServoDirection VI you completed earlier

b- File>>Save As>> Check “Substitute For Original”>>Continue>>Change the file name to: PulseCount>>OK

This will close the previous VI and will create a new VI on your PC

c- create a numeric indicator on the front panel and label it as Rising Edge Count

d- Add the Vis as shown below.

- on the new “Create Channel” on its pull down menu, select counter Input>>Count Edges

-right click to create control for the physical channel and a constant for the Rising edge.

- Then, connect the Start Task and the DAQmx Read. On its pull down menu, select Counter>>Single Sample>>Double

- complete the connections. Notice, the Merge Errors and the Simple Error Handler are found in the Dialog & User palettes.

4- Save the VI

5- On the front panel, select the right device and counter0 for the counter and the right device and ao0 for the physical channel.

6- Make sure the power is OFF. Wire the Ao0 to the Op-amp’s noninverting input. Connect the Hall-Effect sensor output (yellow wire) of the motor’s encoder to the DIO 0. (Digital I/O pin 0)

Page 20: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

20

7- connect the hall effect sensor power (blue wire) to 5 volts

8- connect the hall-effect sensor ground (green wire) to the common ground on your board.

9- Important: verify all correct connections

10- turn the power ON and run the VI, observe the count and the motor’s rotational direction as you vary the DC voltage.

11- set the DC voltage back to zero, then make all values default then Save the VI.

Page 21: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

21

Experiment 2-C: Investigation of Servomotor Open-Loop and Closed Loop performance

In this section, the servomotor’s transfer function is determined in the same way that the servomotor identification lab of EET 410 was done.

In order to avoid repeating the steps, here are the final results. The instructor completed the experiment to help with the servomotor’s identification. Motor parameters were determined to be as listed in Table -1.

Table- 1. PM DC Motor Parameters

Parameter Value UnitsRa 13.50 ΩK 0.2750 N.m/ABm 0.00221 N/m/sJ 0.00198 Kg . m^2/sec^2

Plot of the output shaft speed vs. the applied voltage resulted in the equation:

ω = 2.618 ea (with a little offset)

or, may be rewritten as: ea = 0.382ω (this is the theoretical feedback transducer’s transfer function)

A- Calculate G(s) for the motor

The resulting motor’s transfer function that relates the angular velocity (rads/sec) to the applied voltage is (plug in the values):

G( s )= ΩEa

=

KJRa

[s+( K2

JRa+BmJ )]

=

as+b

=

Page 22: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

22

Questions:

1-

Applying the final value theorem on the transfer function, determine the steady state angular velocity if the applied voltage is 4 volts. Show work

2- What is the feedback transfer function, H(s), equal to?

3- Given the open-loop transfer function and the feedback transfer function, determine the closed loop transfer function, GCL(s)

Page 23: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

23

4- Using the result in (3), determine the steady state value of the angular velocity if the applied voltage is 4 volts. Show work.

Matlab Simulation

A- Open Loop (see figure below)

(save this file as servomotorOL.m)

clear all;clc,clf

num =

den=

G=tf(num,den);

step(4*G)

From the simulation results, determine the following:

- steady state value = ----------------------- rad/sec.

- rise time = ----------------------------- sec.

- is the system over damped or under-damped? ------------------

Does the steady state value obtained from the Matlab Simulation agree with the value calculated in Question 1 above ? ---------------- If no, fix the problem.

Page 24: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

24

Out 11

Transfer Fcn

10 .185

s+3.909Step

Scope

B- Closed Loop (see figure below)

save this file as servomotorCL.m)

clear all;clc,clf

H =

num =

den=

G=tf(num,den);

GCL=feedback(G,H);

step(4*GCL)

From the simulation results, determine the following:

- steady state value = ----------------------- rad/sec.

- rise time = ----------------------------- sec.

Important Question: What is the percentage change in steady state value from the open loop to the closed loop system?

Page 25: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

25

Out 11

Transfer Fcn

10 .185

s+3.909Step

Scope

Gain

0.382

Hardware- LabVIEW interface

A- Open Loop

Build the VI as shown. Refer to the in-class discussion on this VI

with the front panel as shown

Page 26: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

26

- On the DAQ assistant for the analog input, set the acquisition mode as shown below:

Page 27: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

27

Save the VI as servo_OL.vi

- With the power turned OFF, connect AO0 to the noninverting pin of the op-amp circuit

- connect the Hall-sensor –A output (yellow wire) to AIo+. Make sure AI0- is connected to ground.

- connect the red and black wires of the motor as shown in the circuit above.

- connect all the common grounds as in earlier step of part 2B (page 17)

- set the speed control knob to 10.48 (this corresponds to Ea = 4.0 volts)

Page 28: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

28

- The POWER is still OFF. Do the sequence as follows:

Power to the circuit is still OFF, run the VI, a second later, turn Power ON (the motor should start running), wait 5 to 8 seconds, Click the stop on the VI, then turn OFF the power to the circuit.

This should give you a plot of angular velocity vs. time.

From the plot: (Demonstrate to instructor)

- the steady state value is: ------------ rads/sec. (10.45 rads/sec.)

- estimated rise time is: --------------- sec. ( about 0.65 sec.)

Refer to the Matlab results of the Open-Loop simulation on page 23. Do the experimental results agree with the theoretical values? ---------------- If no, fix the problem.

Once the open loop response is verified to agree with the theoretical data, proceed to the next steps. Otherwise, ensure to fix problems as the errors will end up compounding.

Save the VI

B- Closed Loop

Build the VI as shown. Refer to the in-class discussion on this VI

Page 29: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

29

And the front panel is:

Save the VI as Servo_CL.vi

- With the power turned OFF, connect AO0 to the noninverting pin of the op-amp circuit

- connect the Hall-sensor –A output (yellow wire) to DIO 1 in order to access the counter/timer

- connect the red and black wires of the motor as shown in the circuit above.

- connect all the common grounds as in earlier step of part 2B (page 17)

- set the speed control knob to 10.48 (this corresponds to Ea = 4.0 volts)

- The POWER is still OFF. Do the sequence as follows:

Power to the circuit is still OFF, run the VI, a second later, turn Power ON (the motor should start running), wait 3 seconds, Click the stop on the VI, then turn OFF the power to the circuit.

Page 30: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

30

This should give you a plot of angular velocity vs. time.

From the plot: (Demonstrate to instructor)

- the steady state value is: ------------ rads/sec. (5.3 rads/sec.)

On the front panel, the error is displayed. Record this value.

Error = ---------------

Questions: What two quantities were subtracted to produce this error ?

Is the steady state value of the closed loop almost half the open loop steady state value.? Thus, the closing of the loop resulted in a lower steady state. Is this a correct assumption ----------------?

Refer to the Matlab results of the Closed-Loop simulation on page 24. Do the experimental results agree with the theoretical values? ---------------- If no, fix the problem.

Once the closed loop response is verified to agree with the theoretical data, proceed to the next steps. Otherwise, ensure to fix problems as the errors will end up compounding.

Save the VI

Page 31: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

31

Experiment 2-D: Controller Design and Implementation – speed control ( PID)

In this section, the PID implementation for motor speed control is investigated. Having performed the open loop and closed loop system investigation, we are now ready for controller implementation.

A- PID parameters.

The first step is to determine the PID parameters using Simulink.

1- start Simulink and build the block shown. No values are assigned for the PID yet.

2- open the PID block and place 1 for each of KP, KI, and KD

3- Place the linearization points as shown.

4- save the block and Motor_PID

5- Open the step input, look at it, but do not change anything

6- Tools>>Control Design>>compensator Design

7- On the pop-up window, Click on Select Blocks. Place a a check mark next to the PID controller then press ok

8- Click next on the SISO Design Configuration

9- In the design configuration wizard, in the first row for plot 1, select Open-Loop Bode as shown below

Page 32: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

32

10 - click next. On the next window, select Step for plot 2 and place a check mark under plot 2 as shown

11- click Finish

12- you shown rearrange the two window plots to see the SISO design o nthe left and the LTI Viewer on the right

13- Move the mouse pointer over the SISO portion of the plot that is on the top(Magnitude dB) and drag the zero ( the red circle) to the right in steps. As you do that, watch the step response. Keep doing it until you get a response that looks like this:

Page 33: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

33

14- One of the Matlab open windows is the Control and Estimation Tool Manager. Once you are satisfied with the step performance, click on Store Design and on Update Simulink Block

15- Close this Window ( Control and Estimation Tool Manager) All the plots should now be closed.

26- on the Simulink block, double click on the PID block and write down the controller gains:

Kp =

KI =

KD =

The values I obtained were ( 0.0067, 15.45, and near zero for Kd)

Note: We will revisit this later for Auto-tuning of the PID.

B- Matlab Implementation of the PID Controller

1- Write this Code and save it as PIDSpeed.m

Use your values for the PID controller

Page 34: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

34

2- Run the code and observe the step response.

3- From the step response, record the following:

a) steady state value = -----------

b) % overshoot = ------------------------

c) Rise time = ------------------------

4- What can you say about the steady state value of this closed loop compensated system when you compare it to the open and closed loop performance earlier (pages 23 and 24)

----------------------------------------------------------------------------

-----------------------------------------------------------------------------

Page 35: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

35

C- LabVIEW Implementation of the PID Controller

1- Open the Servo_CL vi then:

File>>Save As>> Check “Substitute For Original”>>Continue>>Change the file name to: Speed_PID>>OK

2- Modify the front panel and block diagram to be similar to what is shown below. The Set Speed knob is an integer representation

Page 36: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

36

3- Save the VI

4- Turn the Set Speed dial to 6 rads/sec and set the values of the compensator gains and calibration to the values shown on the front panel

5- set the y-scale values to the range shown and uncheck auto scale y-axis

6- Connect the motor and DAQ as follows:

- With the power turned OFF, connect AO0 to the noninverting pin of the op-amp circuit

- connect the Hall-sensor –A output (yellow wire) to DIO 1 in order to access the counter/timer

- connect the red and black wires of the motor as shown in the first circuit above.

- connect all the common grounds as in earlier step of part 2B (page 17)

- set the speed control knob to 6

- set Kp, Ki, and Kd to the values shown

7- save the VI

8- System Response

With the compensator gains set as shown EXCEPT change Ki to 0.8 and with the calibration error as shown do the following

a) Turn the circuit power ON and keep it ON. (DO NOT start the VI yet)

b) While watching the motor, start the VI for a second then stop the VI. This step is of no significance except to set the I/O pins on the DAQ to proper initial values.

c) start the VI , wait a few seconds (5) and stop the VI

d) The response should look something like this:

Page 37: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

37

e) Turn the Power OFF

f) Let us make some observations:

1- What is the steady state value ? is it exactly as specified by the Set Speed knob -------?

2- Notice that the steady state value is now accurate, unlike the closed loop (no control) response on page 30.

3- What is the measurement error (on front panel) , it should be near zero -------- ?

4- is the response overdamped, underdamped, or marginally stable ------------------- ?

g) Turn the POWER back ON (do not start the VI yet) The motor should start turning :

1- Change the set speed to 8 and start the VI the stop it after a few seconds. Is the steady state value 8 rads/sec. -------- ?

2- Change the set speed back to 6 rads/sec and verify that the steady state value of the motor returned to 6.

h) Turn the power off

i) In this step you are to ONLY change Ki to obtain overdamped, underdaped, and marginally stable responses. MAKE SURE TO WATCH the physical motor’s behavior in each case.

Ki range is [0.02 up to 2.0]

Change Ki and observe the responses. Turn the Power ON and leave it ON. Then set Ki and start (and 5 seconds later stop) the VI. Then test a different Ki Value.

Page 38: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

38

List below the Ki value and a snap shot of the response as seen on the waveform graph.

j) Which Ki value (or range) resulted in overdapmed response --------?

k) whick Ki value resulted in marginally stable response ----------------?

l) how did the physical motor behave with the value in (k ) -----------------------?

m) whick Ki value (range) resulted in underdamped response ? ---------------------?

Page 39: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

39

Page 40: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

40

Experiment 2-E: Controller Design and Implementation – Position Control ( PID)

This lab is made of of two sections

Section 2-E –I : Position measurements are investigated.

Section 3-E- II : Position control (PID) is investigated.

Section 2-E-I

Position Measurements are Calibration

Preliminary Reading

1- Refer to the motor datasheet on the course’s page.

Read the description section and the section on encoder.

Questions:

a- What the counts per revolution on the motor shaft ? ----------------------

b- What is the gear ration ? ------------------------

c: the product of the gear ratio and the CPR (parts a and b) = ------------------

d- What does the answer in C represent? ------------------------ (should be about 465!!)

2- Read the information provided by NI at this link:

Refer to this link at NI.com

https://decibel.ni.com/content/docs/DOC-17346

Page 41: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

41

1- From the motor/encoder datasheet, does the built in encoder have a position reference terminal? -------------------

2- How is the direction of movement determined? ------------------------------------------------------

3- on myDAQ, To which pins are each of the hall sensor outputs A and B need to be connected?

---------------------------

Position Measurements

Build a VI to measure the relative change in position

Note:

Make sure you do not keep the power on for a significant amount of time as the low power transistors may burn out. Feel the transistors every time you run the VI to make sure to turn off the power when necessary.

Whenever the error is above 0.4, there is a potential of heating of the transistors. This sounds like unreasonable, however the issue is the energy is accumulative and the motor stopping, restarting, and changing directions is going to cause the drawing of higher levels of current.

Build the VI and test it to ensure that the motor moves in the proper direction and stops.

To test it, so the steps at the bottom.

Page 42: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

42

Page 43: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

43

Test procedure:

1- Connections

a- Make sure the power is OFF. Wire the Ao0 to the Op-amp’s noninverting input. Connect the Hall-Effect sensor output (yellow wire) of the motor’s encoder to the DIO 0. (Digital I/O pin 0) and the Hall-Effect sensor output (white wire) to DIO 2.

b- connect the hall effect sensor power (blue wire) to 5 volts

c- connect the hall-effect sensor ground (green wire) to the common ground on your board.

d- connect the AOGND, the DGND, the circuit and power supply grounds to a common point.

2- Set up

- set the position dial to zero

- Turn the power ON

- start the VI, All data must read zero, if not, stop the VI and restart it immediately.

- if the motor is turning, then there is a problem, stop the VI, turn power off and fix the problem (do not ask the instructor, simply debug and fix it)

- once the problem is fixed, if any: start the VI, turn power off (may have to restart VI to rest all to zero) Turn the dial to the “-2” position. Feel the transistors; make sure they are not getting too warm.

What happens?

What is the error?

While watching the motor, move the dial to different positions to see how the tracking process is taking palace.

Is the servo tracking the relative position?

Verify operation to instructor.--------------------------- Instructor approval (DO NOT PRINT THE PAGE)

Page 44: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

44

Section 2-E-II

Compensator Design and Implementation (Requires two weeks to complete- do not rush through this)

The goal of this experiment is to design and implement a PID controller for position control application.

Steps

1- Circuit set up

A- Build the circuit shown, however, replace the transistors with a higher power capabilities transistors as follows:

2N3904 replace with TIP 120

2N3906 replace with TIP127

3

2

4

7

6

51

9V

-9V

2N3904

2N3906

Servo

DC input from DAQ

Note, the pin-out for TIP 120 and 127 is as shown:

Q1: from the datasheet : http://www.fairchildsemi.com/ds/TI/TIP122.pdf

- Observe the Darlington pair configuration of the transistors

Page 45: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

45

- What is the maximum rated DC collector current (at 25 oC)? ------------------

- What is the maximum collector power dissipation (at 25 oC) ? ------------------

B- Circuit Test

Before continuing with LabVIEW work, it is a good idea to ensure that the setup is correct.

With the motor connected to the circuit, (red wire to the emitter junctions and black to common ground) power the circuit and connect 5V to the noninverting pin of the op-amp. The motor should then spin at a fixed speed.

C- LabVIEW Implementation of the Closed Loop System.

This phase must work correctly before proceeding to controller implementation.

1- Connect the system and the motor as was done in Section 2-E –I of last week (page 42)

2- open the VI of last week (this is a closed loop system without any control/compensation)

-Calibration steps (will be referred to several times in this experiement)

Power is OFF, b- Position dial to zero, run then stop VI, power ON, run then stop the VI (all live data should read zero) then power OFF

- set the “Motor desired position” dial to zero

- Turn the power ON, RUN the VI, turn the dial on the front panel in the C.W direction to position 2. Ensure that the motor turns approximately two revolutions.

- Set the dial to zero, stop the VI and run it again ( a few times if needed) until the Live Data is zero in all indicators.

- Turn the dial CCW to position 2 and ensure that the motor turns correctly then stops.

- set the dial back to zero and reset live data to zero as was done above.

- Turn the power off.

Page 46: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

46

D- PID Implementation

In this section we will investigate different system responses based on controller parameters.

1- open the VI of the previous section

2- Save it as: MOTOR_Position With PID

3- add the items shown on the front panel (see explanation below)

- the PID gains have “Digital Display” as visible items on the right.

- The PID parameters are grouped in a cluster.

- The graph is the XY Graph (not the Ex XY graph)

4- Complete the block diagram

- The block diagram shown does not show the PID connections. It is left to the student to make the connections.

The PID controller obeys the equation:

u (i )=K p e ( i )+K iT s∑i=0

N

e(i)+KdTs [e ( i )−e( i−1) ]

Page 47: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

47

Where u is the controller’s output and e is the controller’s input (error)

We will assume that the choices of values of Ki and Kd in the PID of LabVIEW are such that the sampling period, Ts, is already taken care of.

Therefore, the modified equation is then:

u (i )=K p e (i )+K i¿∑i=0

N

e (i)+K d¿ [e (i )−e(i−1)]

Implement this controller in the block diagram shown.

5- Save the VI

6- Power is OFF, b- Position dial to zero, run then stop VI, power ON, run then stop the VI (all live data should read zero) then power OFF

Page 48: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

48

7- set the PID parameters as: Kp = 1, Ki =0, Kd = 0

8- Calibrate (as in step 6)

9- Turn the power ON, start the VI and turn the dial to position 2.

The motor will eventually reach almost a zero speed. Stop the VI, turn the dial back to zero and turn the power off

Below is what I obtained:

The motor did not reach position 2. However it takes too long from the point the motor begins to turn until it technically reaches steady state.

Cursors were used (not necessary) for accuracy.

Response Time = 1.5496-0.0896 = 1.46 sec.

Page 49: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

49

Thus, the closed loop system has a response time (do no want to call it rise time) of 1.46 sec.

Record your result here:

Response Time = ----------------------- (must demonstrate to instructor )

10- Once the above system is verified to work correctly, you are ready for PID implementation.

11- Change Kp , Ki, and Kd to be as shown below

12- set the dial to zero (power is off), run/stop the vi until all calibrated

13- turn power ON, Run the VI and move the dial to position 2. (let it run for 40 seconds or so) Watch the motor respond faster and change direction. Watch the relative error (it should eventually swing to within +/- 0.3 or so)

stop the VI and make observations as you answer the questions below.

The result I obtained is shown below. The time from when the motor begins to turn to the first time the motor hits position 2 is about 0.25 sec. This is the time we refer to in this document as the response time.

Page 50: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

50

From you results:

a- is the response overdamped, underdamped, unstable, or marginally stable ?---------

b- what is the steady state? -----------------

c- What is the % overshoot ? -------------------

d- What is the response time? ---------------------------

e- What is the absolute value of the percentage of improvement on the response time ?

Page 51: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

51

For my case : |0.25−1.461.46 |×100=82.9 % (this is a major improvement)

Power is OFF, b- Position dial to zero, run then stop VI, power ON, run then stop the VI (all live data should read zero) then power OFF

14- set the controller values as shown

15- Turn the power ON

16- Start the VI and turn the position to 2. Run the system for 30 seconds or so (read below)

The motor should spin back and forth but each time with increased number of revolutions. This implies unstable response! Then stop the VI (hit Continue when the “out of range” error message pops up—this is due to the fact that the system is now unstable )

Here is a response that I obtained.

Page 52: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

52

Notice how the position keeps on increasing.

Verify your response to the instructor.

Write down your Kp, Ki, and Kd that resulted with unstable response.

Answer:

17- Obtain a NEAR marginally stable response (make sure you calibrate each time you test a new set of gains)

Here is a suggested set

Page 53: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

53

The response that I obtained:

18- List the controller values for a marginally stable response (near marginally stable)

Answer:

Must demonstrate the response to instructor.

19- set Kd =0, Kp =0.8, change Ki to obtain an over-damped response

List the range of values for Ki to obtain an over damped response

For comparison, here is the overdamped that my system resulted in

Page 54: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

54

Notice, the steady state value is = 2 ( the set point)

20- from your result, how long does it take for the response to reach 2? --------------------

Must demonstrate to instructor.

21- with Kp and Ki as above, change Kd to 1.

22- re-calibrate and run the system.

23- Is the response over-damped or underdamped? -----------------

24- how log does the response take to reach 2? ------------------

25- is this result an improvement over the result in 20 ? -------------

26- What does increasing Kd do to the system ? ---------------------

27- set Kp = 0.8, Kd = 1, and Ki =0

28- Test response. What is the steady state value ? --------------------

29- What would you say the main advantage of adding integral control (Ki) ?-----------------------

30- set Kd = 0, Ki =0.02, Kp =0.9 (after calibration, run the system for a minute)

Page 55: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

55

Insert an image of the response and make observations

31- Chose your Kp, Ki, and Kd as shown.

insert the response and comment on it.

32- pick controller parameters that yield response that would have an absolute value of error < 0.3, an overshoot < 50% and a rise time < 1 sec. (Obtain the best you can without spending too much time on this.)

list the controller values and insert the response.

Demonstrate to instructor.

Page 56: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

56

E- Auto-tuning PID

1- close the previous LabVIEW VI

2- open the previous VI and ..

3- Save it as Position Auto PID

4- modify the block diagram as shown (see hints below)

5- On the block diagram

right click>>Control Design&Simulation>>PID>> select PID Autotuning

6- connect the Set point on the PID to the knob (Motor Desired Position)

7- right click on Auto tuning parameters and create control

Page 57: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

57

8- right click on Output range and create constant (set the values as shown)

9- Connect the Process variable to Relative Revolution (as shown)

10- connect the output as shown

11- right click on PID gains out and create indicator

12- on the Difference, create the error indicator ( as shown)

Here is the Front Panel

13- Calibrate to zero, run the VI, turn the knob to position 2 and let the system run for about a minute or until you see the error (as shown to the right of the Dial) almost un changing

Here is an example of a response

Page 58: 370/Labs/Lab2-servomotor.docx · Web viewLab No. 2 Servomotor Analysis and Control Servomotor Analysis and Control Laboratory Experiment Objective. This is a multistage experiment

58

14- insert your response here and demonstrate to instructor.

15- What type of controller resulted from the auto-tuning ? -------------------