Uploaded by arwamkt238

DC motor control- lab work

advertisement
1
GRADE
......................................................................... : ‫االسم‬
..................................................................... : ‫رقم القيد‬
------------------------------------------------------------------------------------------------
Microprocessor Applications
DC Motor Control
Procedure
PART 1
1. Locate the DAC and ADC circuit blocks on the 32-bit MICROPROCESSOR TRAINER. Place the DAC
RANGE shunt in the 10V position and the ADC shunt in the UNIPOLAR position.
2. Make the correct initial operating conditions as set by Table 1.
Conditions
Circuit block
CPU
No shunts on JP1,JP2,JP3
MONITOR ROM
Shunts on top 2 pins of all 3 headers
USER ROM
Shunts on top 2 pins of all 3 headers
PARALLEL PORT
JP5
MANUAL CONTROLS
No shunts on JP6, Shunts on top 2 pins of 3-pin header (in MORM position)
No shunts
SINGLE CYCLE switch off
Table 1
3. Power on the 32-bit MICROPROCESSOR TRAINER.
4. On the MICROPROCESSOR APPLICATION board place the MOT shunt in the SWT position and the ADC
shunt in the MOT position.
5. Refer to Fig. 1. Connect the 20-wire ribbon cable assembly (A) from JP6 on the 32-bit
MICROPROCESSOR TRAINER to the CONTROL circuit block on the MICROPROCESSOR APPLICATION
circuit board. Note: make sure that the colored stripe on the ribbon cable is at the top of the
connector at both ends of the cable.
Fig. 1
2
6. Connect the 8-wire ribbon cable assembly (B) from POWER circuit block on the MICROPROCESSOR
board to the POWER circuit block on the MICROPROCESSOR APPLICATION board. Note: make sure
that the colored stripe on the ribbon cable is at the top of the connector at both ends of the cable.
7. Manually rotate the fan blade on the motor. Which LED on the application board is pulsing?
…………………………………………………...
8. Use a patch lead to connect the LOGIC PROBE on the microprocessor board to PB7, PB0 and PC0 on
the application board. What are their states? PB7  ……….…. PB0  ….….……
PC0  ……..……
9. Enter the 5-byte program shown in Fig. 2 starting at address 0000 : 4000.
04000; B0 80 E6
04 CC XX XX XX
Fig. 2
The program outputs the byte (80H) at 04001H to port B of the PPI. The CPU then executes a
breakpoint (CC) to return to the function mode. The MSB of PB7 controls the motor status
(1= on, 0 = off). What is the state of the motor? motor  ………..…..….
10. Press <GO>, and enter 0000:4000 to execute the program.
11. The motor is now running at full speed in the CW or the CCW direction? ………………………
12. What is the state of PB7? PB7  ………..….
13. To turn off the motor you need to clear PB7 bit. Change the code at 04001H from 80H to 00H.
14. Press <GO>, and enter 0000:4000 to execute the program again.
15. What happens when you execute the program? PB7  ………..…. motor  ………..…..….
PART 2
The microprocessor board can generate an analog signal via the DACOUT line to control the speed and
direction of the motor.
1- Enter the program shown in Fig. 3 starting at address 0000 : 4000.
04000; B0 80 E6
22 CC XX XX XX
Fig. 3
3
2- Press <GO>, and enter 0000:4000.
3- Now the byte at 04001H is the digital value sent to the DAC, and represents the voltage applied to
the motor in the LIN mode.
4- Move the MOT shunt on the application board to the LIN position.
5- Verify Table 2 by making change to the byte at 04001H and using <GO> to execute the program
from 0000:4000 each time.
6- Use a voltmeter to measure the voltage across the motor.
04001H
motor
voltage (V)
motor speed
(rps)
80H
Off
C0H
Low
10H
increase
motor
direction
Table 2
7- Why does the motor’s speed changes?
……………………………………………………………………………………………………………………………………….
8- Why does the motor’s direction changes?
……………………………………………………………………………………………………………………………………….
PART 3
The microprocessor board uses individual I/O port bits to switch the heater on and off.
1) Write the program in Fig. 4 into RAM beginning at address 0000 : 5000. The byte at address 05001H
(FFH) is the value sent to the DAC. The byte at address 05005H is written to I/O port B. The LSB (PB0)
switches the heater in the TEMPERATURE CONTROLLER circuit block on (1) or off (0). The motor is
used to cool down the heater.
05000; B0 FF E6
22 B0 00 E6 04
05008; CC XX XX
04 CC XX XX XX
Fig. 4
2) What is the result of writing 00H to Port B?
……………………………………………………………………………….…………………………………………..
3) Move the ADC shunt to the TEMP position.
4
4) Run the program from address 0000 : 5000.
5) What happens to the motor speed? And what is its direction? ………………………………….…………………
6) Connect the voltmeter leads to ADCIN (+) and AGND (-) in the TEST POINTS circuit block and
measure the ADCIN voltage  …………..….
7) Change the byte at 05005H to 01H. Run the program from address 0000 : 5000. What happens to
the heater? ……………………………………
8) What happens to the ADCIN voltage  …………..……………………...........................................................
9) Change the byte at 05005H back to 00H and run the program from address 0000 : 5000. What
happens to the heater? And why?
…………………………………………………………………………………………………………………………………………………………
PART 4
The DAC output voltage determines motor speed when LIN mode is selected.
1. Press RESET.
2. On the MICROPROCESSOR APPLICATION board, place the MOT shunt in the SWT position and the
ADC shunt in the MOT position.
3. Write the program in Table 3 into RAM beginning at address 0000 : 5000.
ADDRESS
DATA
0000 : 5000
0000 : 5002
0000 : 5004
B0 40
E6 22
CC
MNEMONIC
MOV AL, 40H
OUT 22H, AL
INT 3
REMARKS
Put motor speed value into AL
Output motor speed to DAC (port 22)
Breakpoint (return to function mode)
Table 3
The first instruction loads a value into AL and output the value to the DAC. The last instruction causes a
jump back to the function mode to await a keypad command.
4. Move the MOT shunt to the LIN position.
5. What happens to the motor? …………………………………………
6. Press <GO>, and enter address 0000 : 5000. The motor should be running CW at a low speed.
7. Measure the voltage across the motor using a voltmeter.
V  ………...….
motor’s direction  ….…….….
5
8. It is difficult to calculate motor speed from the applied voltage; so the monitor ROM has a built-in
routine at address FFE4 : 0000 to measure and display motor speed.
9. In the IR CONTROLLER block on the 32-bit MICROPROCESSOR circuit board, install two shunts in the
IR3 and IR4 positions to enable the interrupts used with the motor speed routine.
10. Press <GO> and enter FFE4 : 0000 to jump to the monitor routine.
11. The speed in rps and the time that the routine has been running are displayed as shown in Fig. 5.
Fig. 5
12. What is the motor’s speed? …………………………………….
13. Measure the voltage across the motor. V  …..…….…. motor’s direction  ………...….
14. Press HULT to stop the built-in routine.
15. Change the byte at 05001H to 00H. Press <GO>, and enter 0000 : 5000 to run the program that now
writes 00H to the DAC.
16. Press <GO> and enter FFE4 : 0000 to jump to the motor speed routine.
17. What is the motor’s speed? …………………………………….
18. Measure the voltage across the motor. V  …..…….….
motor’s direction  …………….
19. Press HULT to stop the built-in routine.
20. Move the MOT shunt on the application board to the SWT position.
21. Remove the two shunts from IR3 and IR4 in the IR controller block.
Download