sites.psu.edu · web viewfind the bldc (pmsm, pmac) motor with the same baseplate number (or serial...

18
Lab 9. PMSM Part II – Torque, Velocity and Position Control Updated SP15 adh The “clamp” switch in Figures 9.7-9.12 should be set to ~=0 and NOT >=0 9.1 Introduction In the last laboratory experiment, you implemented the commutation and voltage control for a Permanent Magnet Synchronous Motor (PMSM), using an encoder as the position feedback. In this laboratory, you will modify the voltage control from the previous laboratory to form a Torque Controller. Then, a velocity control loop will be built around the torque controller to regulate rotor speed. Finally, a position control loop will be built around the speed controller to form a position controller for the PMSM. 9.2 Procedure 9.2.1 Connections Find the BLDC (PMSM, PMAC) motor with the same baseplate number (or serial number) that you used in the previous lab. You will need to also look back into your previous lab to find the specific k t determined in Lab 8. Connect the encoder of the PMSM motor (8 pin round connector) to the DSPace connector panel using the supplied cable. At the connector panel, the cable plugs into the INC1 (encoder). The other cable end (37 pin D connector) need not be plugged in since we are not using the Hall Sensor Feedback. Connect the 42V Power Supply to the Converter Board using two banana connectors and set the output to 36 volts. Also, connect phases A1, B1, and C1 of the converter board to the BLDC Motor: If using an older motor (round enclosure) A1 goes to the BLDC phase A (we will consider the RED jack to Phase A), B1 goes to Phase B (the YELLOW jack), and C1 goes to Phase C (the BLUE jack). If using a newer motor (square 1

Upload: dangdung

Post on 23-Jun-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: sites.psu.edu · Web viewFind the BLDC (PMSM, PMAC) motor with the same baseplate number (or serial number) that you used in the previous lab. You will need to also look back into

Lab 9. PMSM Part II – Torque, Velocity and Position ControlUpdated SP15 adh

The “clamp” switch in Figures 9.7-9.12 should be set to ~=0 and NOT >=09.1 IntroductionIn the last laboratory experiment, you implemented the commutation and voltage control for a Permanent Magnet Synchronous Motor (PMSM), using an encoder as the position feedback. In this laboratory, you will modify the voltage control from the previous laboratory to form a Torque Controller. Then, a velocity control loop will be built around the torque controller to regulate rotor speed. Finally, a position control loop will be built around the speed controller to form a position controller for the PMSM.

9.2 Procedure

9.2.1 ConnectionsFind the BLDC (PMSM, PMAC) motor with the same baseplate number (or serial number) that you used in the previous lab. You will need to also look back into your previous lab to find the specific kt determined in Lab 8.

Connect the encoder of the PMSM motor (8 pin round connector) to the DSPace connector panel using the supplied cable. At the connector panel, the cable plugs into the INC1 (encoder). The other cable end (37 pin D connector) need not be plugged in since we are not using the Hall Sensor Feedback.

Connect the 42V Power Supply to the Converter Board using two banana connectors and set the output to 36 volts. Also, connect phases A1, B1, and C1 of the converter board to the BLDC Motor: If using an older motor (round enclosure) A1 goes to the BLDC phase A (we will consider the RED jack to Phase A), B1 goes to Phase B (the YELLOW jack), and C1 goes to Phase C (the BLUE jack). If using a newer motor (square enclosure) A1 goes to the BLDC phase A (the GREEN jack), B1 goes to Phase B (the YELLOW jack), and C1 goes to Phase C (the BLUE jack). Do not turn on the 42V supply until you are ready to test the motor.

Connect the CURR. A1 (phase a current measurement port) on the drives board to the Channel ADCH5 of CP 1104 I/O board and the CURR. B1 (phase b current) on the drives board to the Channel ADCH6 of CP 1104 I/O board. Also, connect the encoder output (mounted on the DC-motor) to the INC1 9-pin DSUB connector on CP 1104 I/O board and the +/- 12V supply to the board connector. Make certain that the 12V supply does not exceed 12V (more than 12 can damage the board). After the voltage is verified to be 12V, turn on the ANALOG power switch on the board – the LED indicator for ANALOG POWER should now be lit.

If you rotate the BLDC motor shaft slowly, you should see the Incremental Encoder Sensor signals changing on the LEDs of the connector panel.

1

Page 2: sites.psu.edu · Web viewFind the BLDC (PMSM, PMAC) motor with the same baseplate number (or serial number) that you used in the previous lab. You will need to also look back into

9.2.2 Modifying the Simulink Model for Torque Control Mode. Note: You will open and rename your lab8 file. Then for each of the three following experiments (Tq, speed and position cotrol), DO NOT rename your simulink file. By keeping the same file name throughout this lab, you can re-use and modify as necessary the associated ControlDesk layouts.

Launch Matlab (same procedure as previous labs) and then Simulink. Make sure that your Matlab path points to the folder containing your Model File! Also make sure you are working out of a jump drive, NOT pass space.

From Simulink, open your PMSM model file that you have save from Lab 8. [File → Open → ????.mdl]. For your reference, the Lab 8 model is shown again in Fig. 8.1 below. You will need to rename this file and save it to a Lab 9 folder.

Fig. 8.1: PMSM Control Model

Verify your Simulation Parameters using Simulation→Configuration Parameters: set stop time to inf, fixed step size is .0001 sec., solver is ODE4 (Runge-Kutta), and all optimization is disabled. To disable all optimization, all blocks at the top of the menu under the Simulation and Code Generation section should be unchecked and the compiler optimization level at bottom of menu set to “optimizations off”. Also, the Real Time Workshop Target Selection system target file should already be set to rti1104.tlc. If not set it as such.

Be sure the counts-to-rads gain corresponds to your motor! (-2*pi*5/1000 for round enclosure motor; -2*pi*4/1000 for square enclosure motor).

Modify your Simulink Model from Lab 8 to implement a torque control system, as shown in Fig. 9.1.

o The PID block can be found in the Continuous library Some of the specific block settings, if they are not shown in the figure are given

below:

2

Page 3: sites.psu.edu · Web viewFind the BLDC (PMSM, PMAC) motor with the same baseplate number (or serial number) that you used in the previous lab. You will need to also look back into

o The input to the system is now a Torque command, so change that constant block to have a label of T_cmd (or something similar)

o The gain block after the T_cmd input should have a gain of 2/(3*Kt) (where Kt will be defined later at the Matlab prompt). This calculates the required peak phase current required to achieve commanded torque (see debriefing Question 2).

o In the PID Controller block, set the proportional gain to 2, and the integral and derivative gain both to 0.

o Be sure to disconnect the output of Fcn 2 block.o Note the negative sign in front of the “sum of elements” block. This block

adds each element of the input vector. The negative sign negates the result. Be sure to set the negative sign in the block settings. This block essentially creates signal to be used as the Phase C duty ratio (through Kirchoff’s current law).

o Set the limits on the saturation block that follows the PID controller (and gain block) to +/- 1. This setting will not allow the PID controller to request more voltage than is available from the DC power supply Vd.

Fig. 9.1: PMSM Torque Control Model

Name all blocks something similar to the names given in Fig. 9.1 The model obtained should look like the one shown in Fig. 9.1. Before building

the real-time model, don’t forget to define and Vd and kt as global variables at Matlab prompt. Set Vd=36 Volts by typing Vd=36 at the Matlab prompt, and set Kt by typing Kt=xx at the Matlab prompt, where xx is the Kt you found in lab 8 (AGAIN YOU MUST USE THE SAME MOTOR USED IN THE PREVIOUS LAB. RE-VERIFY THAT YOU HAVE THE SAME BASE PLATE NUMBER OR SERIAL NUMBER FROM THE NAMEPLATE.)

3

Page 4: sites.psu.edu · Web viewFind the BLDC (PMSM, PMAC) motor with the same baseplate number (or serial number) that you used in the previous lab. You will need to also look back into

Build (CTRL+B) the Simulink model.

9.2.3 Modifying the Control Desk Layout for Torque Control OperationHere, you will modify the ControlDesk layout from Lab 8 so that it is appropriate for Torque control of the PMSM.

Start Control-desk and open a new experiment. Load the variable file (*.sdf) into the Control-desk created from your Simulink

build. Create a Control Desk layout so that it looks similar to the layout shown in Fig.

9.3.o The small block in the upper right corner is not necessary (it is a block

showing the current time of the present simulation. It is convenient to see that the program is running).

o You do not need to add the additional layout block labels shown in Fig. 9.3.

o Modify the slider so that it is now connected to the T_cmd input of the simulink model. Modify the parameters of the slider so that the maximum and minimum values are +/- .5 N-m.

o Attach the PID controller P and I gain to the two numeric boxes. Be sure to use the "gains" and not the "outputs."

o The plot should be used to display both phase A and B current outputs.o Assign the checkbox to the output of the “Zero Position” constant (as

labeled in Fig. 9.1. o Assign the electrical angle (you may have named this "rads to degs" in the

previous lab) and speed (perhaps, wm) displays to the appropriate variable name from the simulink model.

Fig. 9.3: ControlDesk Instrumentation Layout for PMSM Torque Control Experiment

4

Page 5: sites.psu.edu · Web viewFind the BLDC (PMSM, PMAC) motor with the same baseplate number (or serial number) that you used in the previous lab. You will need to also look back into

The experiment should look similar to the one shown in Fig. 9.39.2.4 Operating the PMSM in Torque Control ModeSelect "Go Online" and "Start Measuring." Turn on the power supply, and adjust it to 36V. Initialize the rotor position by checking the “zero position” checkbox. Make sure the rotor is locked into position. If it is, make sure the slider is set to 0 N-m (or very close to it), and deselect the “zero position” checkbox. The system should be ready for torque control mode operation.

For each of the torque command settings shown in Table I, apply a load torque (use your hand) and record the corresponding peak value of the phase current. Note that if the machine is unloaded, it will likely not be able to deliver the requested torque! Therefore, to see torque mode in operation, you will probably have to load the motor by hand until you see that the current (as displayed on ControlDesk) no longer increases. If the -.1 and .1 Torque settings are too low (i.e. motor stalls), experiment with slightly lower and higher values, respectively (record the alternative values).

Table I. Torque Command versus Peak Phase CurrentTorque Cmd (N-m) -.5 -.3 -.1 .1 .3 .5

Peak Phase Current (A)

When you have completed filling out the table, turn off the 42 V supply.

9.3 Velocity Control Mode OperationAs discussed in lecture, a velocity control loop can be built around the torque controller. In this section, we will modify the PMSM torque control to operate as a velocity controller.

9.3.1 Modifying the Simulink Model for Velocity Control ModeTo “unclutter” the torque model controller and facilitate adding the velocity control mode, let us first take the torque controller, and collapse it into a subsystem. As shown in Fig. 9.4, draw a selection box around the blocks indicated in that figure (to select them).

5

Page 6: sites.psu.edu · Web viewFind the BLDC (PMSM, PMAC) motor with the same baseplate number (or serial number) that you used in the previous lab. You will need to also look back into

Fig. 9.4. Collapsing the torque controller into a subsystem.

With the selected blocks highlighted, right mouse click and select "Create Subsystem.” This should collapse the selected blocks into a single subsystem, as shown in Fig. 9.5. Rename the new subsystem block “Tq Control” (or similar). Re-name the subsystem inputs and outputs by opening the subsystem, and re-labeling the input and output ports to the appropriate values (See Fig. 9.6). Be careful with the renaming here; input ports 1 2 and 3 may be in a different order in your Simulink file than the image shown in Fig 9.6. If the unused output from the Fcn2 block in the subsystem is connected to an output port, you can delete that output port. The “cleaned up” and labeled torque control subsystem should look similar to Fig. 9.6.

6

Page 7: sites.psu.edu · Web viewFind the BLDC (PMSM, PMAC) motor with the same baseplate number (or serial number) that you used in the previous lab. You will need to also look back into

Fig. 9.5. Collapsed Torque Controller

Fig. 9.6. Renamed and re-labeled Torque Controller Subsystem.

Now with the torque controller collapsed into a subsystem, we will re-configure the system for velocity control. Refer to Fig. 9.7 for connections.

o Change the T_cmd input from Fig. 9.6 to V_cmd (for velocity command input).

o Add a switch from the Signal Routing library and set it to ~=0. This switch is necessary to keep the integrator in the PID block

from “winding up” while the system is in the zero position mode. The switch should be set up as shown below:

7

Page 8: sites.psu.edu · Web viewFind the BLDC (PMSM, PMAC) motor with the same baseplate number (or serial number) that you used in the previous lab. You will need to also look back into

o Add another PID Controller for the speed regulator. The PID gains should be set to : Proportional = .01 , Integral = 1, and Derivative=0.

o Connect the velocity feedback, as shown in Fig. 9.7o Add another saturation block, after the velocity PID controller, and set its

limits to +/- 2. This is so that the velocity controller cannot request more than 2 N-m of torque from the Torque controller.

Fig. 9.7. Velocity Control of PMSM: Note, the clamp switch should be set to ~=0

Name all blocks something similar to the names given in Fig. 9.7 The model obtained should look like the one shown in Fig. 9.7. Build (CTRL+B) the Simulink model.

8

Page 9: sites.psu.edu · Web viewFind the BLDC (PMSM, PMAC) motor with the same baseplate number (or serial number) that you used in the previous lab. You will need to also look back into

9.3.2 Modifying the Control Desk Layout for Velocity Control OperationHere, you will modify the ControlDesk layout from the previous section so that it is appropriate for velocity control of the PMSM.

Modify your ControlDesk layout so that it looks similar to Fig. 9.8.o The slider should now connected to the V_cmd (velocity command) input

of the simulink model. Modify the parameters of the slider so that the maximum and minimum values are +/- 200 r/s.

o Attach the velocity controller PID P and I gain to the two numeric boxes.o Two plots should be used: one to display the speed command and actual

speed; the second to display the phase A current. Drag the appropriate values onto the plotter to accomplish this.

Fig. 9.8. ControlDesk Layout for Velocity Control Operation of PMSM

9.3.3 Operating the PMSM in Velocity Control ModeTurn on the power supply, and adjust it to 36V. Initialize the rotor position by checking the “zero position” checkbox. Make sure the rotor is locked into position. If it is, make sure the slider is set to 0 r/s (or very close to it), and deselect the “zero position” checkbox. The system should be ready for velocity control mode operation.

Experiment with the velocity control loop. For example, command a very slow speed, such as 1 r/s. Try to slow down the rotor (by hand) and see what the result is. Particularly, observe the current on the Control Desk display. Record your observations to that you can later answer debriefing question #4. Also, note debriefing question #5 and #6. That is, observe what happens when speed is changed, and try relatively fast speed changes. Carefully record all of your observations to better facilitate answering the debriefing questions.

9.4 Position Control Mode OperationAs discussed in lecture, a position control loop can be built around the velocity and

9

Page 10: sites.psu.edu · Web viewFind the BLDC (PMSM, PMAC) motor with the same baseplate number (or serial number) that you used in the previous lab. You will need to also look back into

torque control loops. In this section, we will modify the PMSM torque control to operate as a position controller.

9.4.1 Modifying the Simulink Model for Position Control ModeTo “unclutter” the velocity controller model and facilitate adding the position control, let us first collapse the velocity controller into a subsystem. As shown in Fig. 9.9, draw a selection box around the blocks indicated in that figure (to select them).

Fig. 9.9. Collapsing the velocity controller into a subsystem.

With the selected blocks highlighted, create a subsystem as before. This should collapse the selected blocks into a single subsystem, as shown in Fig. 9.10. Rename the new subsystem block “Speed Control” (or similar). Re-name the subsystem inputs and outputs by opening the subsystem, and re-labeling the input and output ports to the appropriate values (again be careful to label correctly, here). The “cleaned up” and labeled torque control subsystem should look similar to Fig. 9.11.

10

Page 11: sites.psu.edu · Web viewFind the BLDC (PMSM, PMAC) motor with the same baseplate number (or serial number) that you used in the previous lab. You will need to also look back into

Fig. 9.10. Collapsed Velocity Controller

Fig. 9.11. Renamed and re-labeled Velocity Controller Subsystem.

Now with the velocity controller collapsed into a subsystem, we will re-configure the system for position control. Refer to Fig. 9.12 for connections.

o Change the V_cmd input label from Fig. 9.11 to Theta_cmd (for position command input).

o Add a position controller. This controller is exactly the same in structure as the velocity control loop. Thus, you can double click on the velocity control loop, copy the blocks, and paste them onto the model to save a little time in building this controller.

The PID control block gains should be set to Proportional=3, Integral and Derivative=0.

11

Page 12: sites.psu.edu · Web viewFind the BLDC (PMSM, PMAC) motor with the same baseplate number (or serial number) that you used in the previous lab. You will need to also look back into

The switch should be set up the same as the switch in the velocity control subsystem.

o Connect the velocity feedback, as shown in Fig. 9.12. Note that there is a negation (gain of -1) in that loop. This loop is necessary to match increasing velocity to increasing rotor angle. That is, it compensates for hardware mismatches with our PMSM model (similar to the negation in angle discussed in the Voltage Controller of Lab 8).

o For the saturation block in the Position Controller, after the position control PID block, set the limits to +/- 200. This is so that the position controller cannot request more than 200 r/s of velocity from the velocity controller.

Fig. 9.12. Position Control of PMSM

Name all blocks something similar to the names given in Fig. 9.12 The model obtained should look like the one shown in Fig. 9.12. Build (CTRL+B) the Simulink model.

9.4.2 Modifying the Control Desk Layout for Position Control OperationHere, you will modify the ControlDesk layout from the previous section so that it is appropriate for position control of the PMSM.

Modify your ControlDesk layout so that it looks similar to Fig. 9.13.o The slider should now connected to the Theta_cmd (position command)

input of the simulink model. Modify the parameters of the slider so that the maximum and minimum position command values are +/- 200 radians.

12

Page 13: sites.psu.edu · Web viewFind the BLDC (PMSM, PMAC) motor with the same baseplate number (or serial number) that you used in the previous lab. You will need to also look back into

o Attach the position controller PID P and I gain to the two numeric boxes.o Two plots should be used: one to display the position command and actual

position; the second to display the phase A current and the velocity. Drag the appropriate values onto the plotter to accomplish this.

Fig. 9.13. ControlDesk Layout for Position Control Operation of PMSM

9.3.3 Operating the PMSM in Position Control ModeTurn on the power supply, and adjust it to 36V. Initialize the rotor position by checking the “zero position” checkbox. Make sure the rotor is locked into position. If it is, make sure the slider is set to 0 r (or very close to it), and deselect the “zero position” checkbox. The system should be ready for position control mode operation.

Experiment with the position control loop. With the position command set to 0, try to move the rotor from this position. What happens? Command 100 radians, and observe the speed and position as the motor approaches its commanded position. Feel free to experiment with the position controller.

Before shutting down, be sure to save your experiment files, and MDL file onto your own storage device. These files may be needed in upcoming labs.

9.5 Deliverables Each individual must turn in an informal lab report that contains:

1. Explain why the Phase C current feedback is not needed in the simulink model.

2. Why do we divide Torque command by 2/(3*Kt) to get phase current peak values?

3. Show your data from Table I. Add another row to the table, and enter the predicted amplitude of the Current Space Vector. Add one more row, and enter the predicted peak value of the Phase

13

Page 14: sites.psu.edu · Web viewFind the BLDC (PMSM, PMAC) motor with the same baseplate number (or serial number) that you used in the previous lab. You will need to also look back into

Current. Compare the predicted peak phase current with the actual measured values.

4. In speed control mode, what happens when you try to force the rotor to slow down when a non-zero speed is commanded? Does the speed change? How about the torque? How about the phase current? Based on your observations, and your understanding of the Velocity Control model (nested around the torque controller), describe in detail (referring to model blocks if necessary) what is happening when you try to slow the rotor shaft.

5. Observe the effect of changing speed on the frequency of the stator currents. Discuss how and why the PMSM operating speed affects the frequency of the stator currents.

6. In previous labs, you may have experienced overcurrent faults (RED fault LED illuminates on the Power Conversion Board) anytime the voltage was changed too rapidly. Hopefully, you should not experience such faults if you change velocity commands quickly. Try to explain this improvement, using you knowledge of the velocity/torque controllers.

14