Feedback Speed Control Embedded Systems Interfacing.
Transcript of Feedback Speed Control Embedded Systems Interfacing.
![Page 1: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/1.jpg)
Feedback Speed Control
Embedded Systems Interfacing
![Page 2: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/2.jpg)
Overview Background Task 1 MATLAB® Step Response Root Locus Task 2 Scaled Coefficients Task 3 Proportional-Integral Speed Control Task 4 Step Response for:
Critically Damped Over Damped Under Damped
![Page 3: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/3.jpg)
PWM/Motor Speed Labs
ADC
+5 VDC
PWM
+12 VDC+5 VDC
PIC24FJ128
TD62003AP
LM2907
V(speed)
![Page 4: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/4.jpg)
Open-Loop Load-Speed Characteristics
Speed
Load
![Page 5: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/5.jpg)
Block Diagram
_k(z-b)___
z(z-1) B_ (s+A)
-
+ R(z)
Y(z) U(s) E(z) ADC
Y(s) DAC
U(z)
InternalTo
feedback.cPIC24FJ128
Darlington Driver,Motor and
Freq-to-Volt
![Page 6: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/6.jpg)
PID Controller Time-Domain
Laplace-Domain of PI Controller
dt
tedKdtteKteKtu DIP
s
KsK
sE
sU
KKK
Kss
KK
sE
sU
IP
PID
DI
P
0 and 0 ,0
PID
![Page 7: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/7.jpg)
Stability Control Ratio
Critically Damped
I
I
KBsAs
KB
sR
sC
2
B
AK
KBA
cab
I
I
4
014
04
2
2
2
![Page 8: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/8.jpg)
Control Algorithm
Tnene
Knunu
nTTnnene
Knunu
I
I
2
))()1(()()1(
12
))()1(()()1(
![Page 9: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/9.jpg)
Task 1 – Step Response Analysis Within MATLAB®
Define A and B Define transfer
Function Use step()
![Page 10: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/10.jpg)
Task 2 – PID Gains
Condition K1 = 1024k K2 = bK1
Under Damped
Critical Damped
Over Damped
Unstable
![Page 11: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/11.jpg)
Task 3 Within main( ) Initialization
RD0 Timer 3 ADC Interrupts and Timer 3 Interrupt PWM ADC PMP then LCD LCD text on screen
![Page 12: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/12.jpg)
Task 3 Within main( ) Endless Loop
Wait for for semaphore == 1 Clear semaphore Calculate new output value using
difference equation Write to PWM Update out(k+1), in(k+1), and in(k+2) Display Speed
![Page 13: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/13.jpg)
Task 3 Within Timer 3 ISR Clear Interrupt flag Start sampling
![Page 14: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/14.jpg)
Task 3 Within ADC ISR Get new speed reading and clear DONE Set semaphore Check for one-hundred passes (100 x
50ms = 5 s) If 100 passes then
Toggle RD0 Calculate new reference = Step*D0 + Offset Reset pass count
Else Increment pass count
Clear ADC interrupt flag
![Page 15: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/15.jpg)
Task 3 Download to project
folder feedback.c peripherals.a (library
archive) peripherals.h
Create project and add all three files
Add linker script Create heap
![Page 16: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/16.jpg)
Open-Loop Load-Speed Characteristics
Speed
Load
Closed Loop
Open Loop
![Page 17: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/17.jpg)
Task 4 Use Internal Reference Use MPLAB’s Data Monitor and
Control Interface to Adjust K1 and K2 Capture Image on MSO and repeat for
Critically Damped Over Damped Under Damped
![Page 18: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/18.jpg)
Data Monitor and Control Interface
![Page 19: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/19.jpg)
DMCI Configuration
Right Click
![Page 20: Feedback Speed Control Embedded Systems Interfacing.](https://reader035.fdocuments.us/reader035/viewer/2022062219/551b1a08550346cf5a8b54bd/html5/thumbnails/20.jpg)
DMCI Use Press Save after
Dynamic Data Control is configured
Press Halt Adjust Sliders
Use Mouse Up arrow and
Down arrow Press Start