Professional Documents
Culture Documents
Yes
At end point ?
Start button pressed?No Start signal from No Start signal from No
Master ? Master ?
No
Yes Yes Yes
Calibrating the sensors
values Set end_flag = 1 Write start signal to Receive desired Receive desired
Slaves motor speed from Master motor speed from Master
Compute e2 using
Weighted Average Calculate current Calculate current
Get errors motor speed motor speed
Compute e3
Yes Set PWM duty cycle using Set PWM duty cycle using
end_flag = 1? PID algorithm PID algorithm
Return to Main Program
No
End signal from No End signal from No
Sub-program of Master Apply Fuzzy law Write end signal Master ? Master ?
to Slaves
Yes Yes
Compute V, W and End End
Start send to Slaves End
End
e2, e3: tracking errors (m) Ng. Ng. Duy Hung
H. Phi Hung
Flowchart diagram 1
Sheet: 1
1:1
Number of sheets: 1
Kp, Ki, Kd: PID controller gains
Instruct Assoc. Prof Ng.Qu.Chi
Ts: sampling time of PID controller HCMC University of Technology
Interrupt program for Emergency Stop Censor Faculty of Mechanical Engineering