Professional Documents
Culture Documents
Workshop 16F877 5sx
Workshop 16F877 5sx
Workshop 16F877 5sx
DC Motor Control [ 1 ]
(Continuous running control)
(DC Motor)
(DC Motor) 3
1. - (ON - OFF Control)
2. (Direction Control)
3. (Speed Control)
H Bridge
N.O..
N.O..
com.
com.
com.
N.O..
.
com.
N.O..
.
4 .
4
1. Free Run Stop 4 .
2
4
Circuit Diagram
1
H Bridge 8 Model SE-RYI-8 4
. PortB Model SE-PIC877
1. 1
2. 12 H Bridge
s_off
fwd
rwd
brake
trisa
trisb
adcon1
portb
var
var
var
var
=
=
=
=
portb.3
portb.2
portb.1
portb.0
%111111
%00000000
7
0
start:
if (s_off = 0) and (fwd = 1) and (rwd = 1) and (brake = 1)
if (s_off = 1) and (fwd = 0) and (rwd = 1) and (brake = 1)
if (s_off = 1) and (fwd = 1) and (rwd = 0) and (brake = 1)
if (s_off = 1) and (fwd = 1) and (rwd = 1) and (brake = 0)
pause 50
goto start
end
--------------------------- End of Program ----------------------------
then
then
then
then
portb
portb
portb
portb
=
=
=
=
%0000
%1001
%0110
%1010
Assignment 36
DC Motor Control [ 2 ]
(Jogging control)
(DC Motor)
(Jogging Control)
Assignment 35
fwd
rwd
trisa
trisb
adcon1
portb
var
var
=
=
=
=
portb.2
portb.1
%111111
%00000000
7
0
start:
if (fwd = 1) and (rwd = 1) then portb = %1010
if (fwd = 0) and (rwd = 1) then portb = %1001
if (fwd = 1) and (rwd = 0) then portb = %0110
pause 50
goto start
end
--------------------------- End of Program ----------------------------
Assignment 37
DC Motor Control [ 3 ]
(Speed control)
(DC Motor)
( Speed Control )
(DC Motor) 2
1. (Linear DC voltage Control)
(Armature
Voltage)
VCE
Armature Voltage
VCE
VBE
1
SPEED
active
2. (Switching Control) VBE Control Voltage Cutoff Saturate
Active
2 PWM
2
ON OFF Duty cycle
(Pulse Generator)
400 Hz - 2 KHz
duty cycle
1
% Duty cycle = Pulse width X 100
Cycle
------------------------ 1
duty cycle
2
Voutput
= %Duty cycle X
Vsupply
------------------------ 2
2
%Duty- cycle PWM
(PWM : Pulse Width Modulation) PWM
Pulse Width
PWM
PIC16F877 PWM
2
I/O 2 RC2
HPWM 1 RC1 HPWM 2
HPWM chanel, duty cycle, frequency
PWM Signal
'*************************************************
'* Name : Speed.BAS
'* Author : Somboon Niamglam
'* Notice : PIC16F877 MCU
'*
: Speed Control
'* Date
: 15/09/2005
'* Version : 1.0
'*************************************************
DUTY VAR BYTE
SPEED VAR BYTE
BRAKE VAR PORTA.3
ADCON1=14
TRISA =%111111
TRISC =%00000000
Assignment 38
DC Motor Control [ 4 ]
(Speed and Direction control)
(DC Motor)
( Speed Control ) (Direction Control)
(DC Motor)
H-Bridge
PWM
1 MOSFET H Bridge
POWER MOSFET 4
Opto Isolated Gate Drive Opto Isolated
Gate Drive INA INB
POWER MOSFET H Bridge
Complementary
EN / PWM POWER MOSFET
2 MOSFET H Bridge SE HB 60
3 MOSFET H-Bridge