Answers

1. See the figure.

2. Speed=6 steps/sec=6×7.5 deg/sec=45 deg/sec=45/360 rev/sec →60/8=7.5 rpm.

3. Linear characteristic: Output voltage, Vt=mt+c; t=temperature; Gradient, m=10 mV/°C.

At 0°C, sensor voltage, Vt=500 mV, so 500=c. Hence, Vt=10t+500 mV.

4. The parallel display uses more MCU output pins, drive requirements are more complex (segment encoding required), and it shows only 3.5 numerical digits, while the serial LCD is 16x2 alphanumeric.

5. lcd_symbol(DigMap[8],DIG1);

The first argument of the function is an array variable that contains the seven-segment code for the number 8, and the second identifies the seven display memory bits for the segments of the digit.

6. The DC motor needs position feedback to achieve a set position or speed. A slotted wheel and optical sensor produce pulses as the shaft turns, allowing the MCU to count the revs completed in unit time.

7. The stepper motor has multiple coils, which are energized in sequence to turn the shaft, so it can be turned through a set number of steps with no feedback required. The stepper motor on the mechatronics board has two sets of windings, two wires each, which are connected to the four drive outputs.

8. Connect the motor sensor to Timer1 input and configure the timer to measure the pulse period. The Capture mode of operation allows the timer count to be captured when the sensor input changes. The MCU program can convert the pulse period into revs/sec.

9. 1 step=7.5°, 1 rev=360/7.5=48 steps.

Time per step=1/48=20.8 ms ≈21 ms.

10. The temperature sensor gives an output of 10 mV/°C, with an offset of 500 mV, so the temperature can be calculated at any value in that range. The light sensor output cannot be quantified in the same way, because it is not linear and the absolute level is therefore more difficult to calculate.

11. Vt=sensitivity×temp+offset=(10×25)+500=750 mV.

ADC output scaling=2048/1024=2 mV/bit.

ADC output value=Vt/scaling=750/2=375.

12. Sink=Pg.Ng=M.N.F.

Source=!Pg.!Ng=(P.M.!N.F)+(P.!M.F)=P.F.((M.!N)+!M).

13. P1 and N2, P2 and N1, M1 and M2. The current flows diagonally across the bridge, so P1 and N2 are on together for forward current and P2 and N1 for reverse. M1 switches on and off N2 and M2 switches N2 for PWM control.

14. With the inputs linked for full bridge operation, P1 and P2 operate Drives 1 and 2, respectively, which are connected to stepper motor Coil 1, brown and orange wires. PWM1 is connected to CCP1 output. P3 and P4 operate Coil 2, red and yellow; and PWM3 is connected to CCP2. Sequence: Drive 1, 4, 2, 3.

15. It is voltage operated with a high input impedance, so it is simple to interface and can be driven directly from a logic output. The output ‘on’ resistance is low, and the ‘off’ resistance is high.

16. Gain of amp=10.

Sensing resistor=0.1 Ω.

Test resistor=3.3+0.5=3.8 Ω.

Total resistance=3.8+0.1=3.9 Ω.

Amp input voltage=(0.1/3.9)×5=0.13 V.

Amp output voltage=0.13×10=1.3 V.

17. The latch consists of cross-coupled NOR gates, such that only one output can be high at a time. The drives are disabled when the fault output is low and the LED output is high. The comparator output goes high when an overcurrent is detected, forcing the fault output low and switching on the LED. This state is held until the Reset button forces the LED output low and the fault output high, resetting the latch.

18. The MOSFET is switched by applying 5 V between the gate and source, with the load connected to the drain. The NMOSFET has its source connected to 0 V and is switched on with 5 V at the gate; the PMOSFET has its source connected to +5 V and is switched on with 0 V at its gate. This provides symmetrical drive components in the half bridge.

19. Connect the motor between Drives 1 and 2. Enable drive at P1 from MCU RD7, and control N2 from MCU CCP2(RD2). PWM output is generated from the CCP2 module, which controls the speed of the motor.

20. Output sequence at Port D: 0x80, 0x10, 0x40, 0x20.

PWM inputs not connected=1 (enabled).

Outputs high: RD7(P1+N2), RD4(P4+N3), RD6(P2+N1), RD5(P3+N4).

Drive sequence: Winding1 forward(Drive1 → Drive2).

Winding2 reverse(Drive4 → Drive3).

Winding1 reverse(Drive2 → Drive1).

Winding2 forward(Drive3 → Drive4).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.115.118