allen j wood power generation operation ost
DESCRIPTION
MEMBAHAS OPERASI SISTEM TENAGA COYTRANSCRIPT
References
[1] Allen J. Wood and Bruce F. Wollenberg, Power Generation Operation and Control, 2nd ed., John Wiley & Sons, Singapore, 2005, Chapter 9, pp. 328-362.
[2] John J. Grainger and Willian D. Stevenson, Jr., Power System Analysis, McGraw-Hill, Inc., Singapore, 1994, Chapter 16, pp. 695-707.
[3] Katsuhiko Ogata, Modern Control Engineering, 4th ed., Prentice Hall of India Pvt. Ltd, New Delhi, 2006.
[4] Katsuhiko Ogata, Discrete-Time Control Systems, 2nd ed., Prentice Hall of India Pvt. Ltd, New Delhi, 2005.
[5] Cyril W. Lander, Power Electronics, 3rd ed., McGraw-Hill Book Co., Singapore, 1993.
[6] Ned Mohan, Tore M. Undeland and William P. Robbins, Power Electronics, 3rd ed., John Wiley & Sons Inc., Replika Press Pvt. Ltd., India, 2006 .
[7] James W. Dally, William F. Riley and Kenneth G. McConnell, Instrumentation for Engineering Measurement, 2nd ed., John Wiley & Sons Inc., Replika Press Pvt. Ltd., India, 2006, Chapter 6, pp. 162-205.
[8] Thomas C. Hayes and Paul Horowitz, Student manual for The Art of Electronics, Cambridge University Press, Gopsons Papers Limited, India, 2002. Chapter 2, pp. 82-140.
[9] Website, http://www.allaboutcircuits.com/vol2/chpt 12/6.html. accessed on 4/06/2008.
[10] Data sheet # DS39582B/or PIC16F87XA 28/40pin 8-bit CMOS flash, Microcontrollers, Microchip Technology Inc., U.S.A, 2003.
[11] Data sheet # GT50J101 for 600V, 50A IGBT, Toshiba, Japan.
[12] Data sheet # PC817, Photocoupler, Sharp, Japan.
[13] Datasheet # UTC D313, NPN Switching Transistor, Unisonic Technologies Co., Ltd.
50
Appendix 1. The Matlab program used to find PID vales of the present synchronizer
% Estimate PID values of present synchronizer, [K(s+a)*(s+b)/s] J=250;
Wo=76.18; C=0.8; t=0:1:600; Tg=0.3; Th=3.0; a-0.2333; Kt=8000; for K=0.2.-0.01:0.01; %starts the inner loop to vary the a values for b=0.6:-0.001:0.001; %starts the inner loop to vary the a values numl =[K (a+bj *K a *b *KJ; denl =[0 1 OJ; tfl-tf(numl,denl); num2=[0 0 1]; den2=[0 Tg 1]; tf2=tf(num2,den2); num3-[0 01]; den3=[0 Th 1]; tf3=tf(num3,den3); num4=[0 0 1]; den4=[0 Wo*J Wo*C]; tf4-tf(num4,den4) ; tf5=tf]*tf2*tf3*tf4*Kt; sys=feedback(tf5,1); y=step(sys,t); m=max(y); n=minfy); ifm<1.35 & m>0.99; break; % breaks the inner loop end end ifm<1.35 & m>0.99;
51
break; % breaks the inner loop
end
end
r 1=1 ;while y(rl)<0. l,rl=rl+l ;end;
r2=l;while y(r2)<0.9,r2=r2+l;end;
Rise Jime=(r2-rl) *1 s-601; whiley(s)>0.98 &y(s)<1.02; s=s-l;end;
sett I ingjime=(s -1) *1
max overshoot=m-l
plot(t,y);
grid;
title('Estimated Unit-Step response of present Synchronizer')
xlabel('t Sec')
ylabel ('Amplitude')
aa=num2str(a); %string value of'a'to be printed on the plot
bb~num2str(b); %string value of'b' to be printed on the plot
kk-num2str(K); %string value of'K'to be printed on the plot
mm-num2str(max overshoot); %string value of max ̂ overshoot to be printed on the plot
rr=num2str (RiseJime); Hstring value of Rise Jime to be printed on the plot
ss -num2str (settlingJime); %string value of settling Jime to be printed on the plot
text (110,0.7, 'a='), text(150,0.7, aa)
text(110,0.5,'b='),text(150,0.5,bb) text(l 10,0.3, 'K= '),text(l 50,0.3, kk)
text(l 10,0.25, 'Max overshoot='),text(250,0.25,mm)
text(360,0.1, 'Rise time='),text(450,0.1,rr)
text(l 10,0.1, 'Settling time='),text(250,0.1,ss) sol=[sys]
sol=[K;b] TFj>fJresent=tfl *tf2*t/3*Kt
Appendix 2. The program used in Matlab to estimate PI parameters
% Estimate parameters for new PI controller when Pe(s) is connected, [K(s+d)/s] J=250; Wo=76.18;
C-0.8; t=0:l:90; Tg=0.3; Th=3;
K=0.2; a=0.2333; b=0.05; Kl-8000; Ke-6000; for Kp=0.9:-0.1:0.1; %starts the inner loop to vary the 'Kp'values for d=0.1. -0.001:0.001; %starts the outer loop to vary the'd' values numl=[K (a+b) *Ka*b*KJ; denl =[0 1 0]; tfl-tf(numl,denl); num2-[0 01J; den2-[0 Tg 1]; tf2=tf(num2,den2);
num3==f0 01J; den3-[0 Th 1J;
tf3=tf(num3, den3); 1f4=tfl *tf2*tf3*Kt; %tf of the new PI controller num4=[0 Kp Kp*dJ; den4-[01 0]; tf5=tf(num4,den4); tf6=tf5*Ke; Gc = parallel (tf4, tf6); num5=[0 0 I]; den5=[0 Wo*J Wo*CJ; Gp=tf(num5,den5);
53
sys=feedback(Gc*Gp,l); y=step(sys,t); m=max(y);
if m< 1.1 & m>0.99; break; % breaks the inner loop end
end ifm<l.l & m>0.99; break; % breaks the inner loop
end
end rl =i .while y(rl)<0. l,rl =rl+l;end; r2=l; while y(r2) < 0.9, r2=r2+1 ;end; Rise_time=(r2-rl) *1
s—91; whiley(s)>0.98 &y(s)<1.02; s=s-l;end; Settlingjime=(s-l) *1 maxovershoot=m-l plot(t,y);
grid; title('Unit-Step response when Pe(s) is connected') xlabelft Sec') ylabel ('Amplitude') kk=num2str(Kp); %string value of Kp to be printed on the plot dd=num2str(d); %string value of d to be printed on the plot mm=num2str (maxovershoot); %string value of max overshoot to be printed on the plot
ss=num2str(SettlingJime); %string value of Settling time to be printed on the plot
rr-num2str (Rise time); %string value of Rise time to be printed on the plot text(21,0.9, 'Kp='), text (26,0.9, kk)
text(21,0.7, 'd ='), text(26,0.7,dd) text(21,0.5, 'Max overshoot^'),text(42,0.5,mm)
text(21,0.3, 'Settling time='),text(42,0.3,ss) text(21,0.1, 'Rise time='),text(42,0.1,rr) sol=[sys] sol=[Kp;d]
Kp=Kp
d=d
tf4
(,H°Z
, >0 o WPZ^ppij
(puzp 'puinu)fi=[j~/O~JJ
1 L+ Appendix 3
GT50J101 m POWER SWITCHING APPLICATIONS.
U n i t i n mm
liigh Input Irapedance
High Speed
Low S a t u r a t i o n Vol tage
Enlianc emeu t -Mode
t f = 0 . 3 5 u s ( M a x . )
VCE(sat)=4.0V(Max.)
AXIMUM RATINGS (Ta=25°C)
CHARACTERISTIC
bllec t o r - E m i t t e r Vol tage
late-Emitter V o l t a g e
Collector Current
Junction T e m p e r a t u r e
DC
Ins lolleccor Power D i s s i p a t i o n rc*25°C)
itorage Temperature Ranp,e
crew Torque
SYMBOL
V'CES VGES
IC
iCP
Pc
Tj
[s t£_
RATING
6 D 0
±20
5 0
100
200
1 5 0
-55-150
0 . 8
UNIT
M
Nm
20-5MAX
XI? 2.5
3.0
+ 2 . 5 1 . 0 - 0 . 2 5
, 0 3 3 ± 0 2
! 1 I
5.4 5 ± 0 . 1 5 5.4 5 ± 0 . 1 5
I. GATE 2- COLLECTOR CHEAT S I N K ) 3. EMITTER
J E D E C
E I A J
T O S H I B A 2 - 2 1 F J C
ELECTRICAL CHARACTERISTICS (Ta«25°C) Weight : 9 .75g
CHARACTERISTIC SYMBOL ' TEST CONDITION MIN. TYP. MAX. UNIT Date Leakage Cu rrent ICES v G E = ± 2 0 v , V c e - 0 - _ ±500 nA Collector C u t - o f f Current ICES VCE=600V, VHE-0 — _ 1 . 0 cA Collector-Emitter treakduon Vol tage
V(BR)CES IC~2nA, VnE=0 600 - - V
Sate-Er.irter Cut -o f f Vo l tage VGE(off) IC~50nA, VCE=5V 3 . 0 - 6 . 0 V Collector-Emitter Saturation Vol tage
v CE(sat ) 1 C - 5 0 A , V C E = 1 5 V - 3 . 0 4 . 0 V
Input Capacitance Cies V c e = 1 0 V , V c c ® 0 i f-lMHz - 3500 — PF Rise Tine t r - 0 . 3 0 . 6
Switching Tine Turn-on Tice c on T ' n
•—'-15V 1
30<
- 0 . 4 0 . 8 us Switching Tine F a i l Tine t f
T ' n •—'-15V 1
30< - 0 . 1 5 0 . 3 5
us
» Turn-off Tine t o f f
T ' n •—'-15V 1
30< )V - 0 . 5 0 1 . 0 0
Hiermal R e s i s t a n c e R t h ( j - c ) - - - 0 . 6 2 5
GT50J101
WITCHING TIME - IQ
COLLECTOR CURRENT I C ( A )
3 10 30 100 300
GATE R E S I S T A N C E R G ( i l )
1000 ( V )
P U L S E W I D T H t w ( s )
30 0.5 1 3 10 30 100 300
COLLECTOR-EMITTER VOLTAGE V C E
3r
lb
SWITCHING TIME - R G
COMMON EMITTER
V C C = 3 0 0 V
V G E - ± 1 S V
I r = 5 0 A
5000 fa. ft 3000
V 1000 u
jr 500
300 M O £ < 100
- COMMON
E M I T T E R
V G E = ° f = l M H i
t Tc = 251C
( V )
REVERSE BIAS SOA
COLLECTOR-EMITTER VOLTAGE V C E
SAFE OPERATING AREA
• S I N G L E N O N R E P E T I T I V E PULSE Te = 25*C
CURVES M U S T BE DERATED L1NEALY W I T H INCREASE IN TEMPERATURE. .I : :: III I I I ,i i, I ill .1 1, 1.1 I,
0.3 1 3 10 30 100 300 1000
COLLECTOR-EMITTER VOLTAGE V C E ( V )
I C M A X . ( P U L S E D ) *
I C MAX. ( CONTI NOUS )
GT50J101
160
120
80
4 0
Ic - VCE
COMMON EMITTER
Tc — 25"C
2 0 1 5
/ / i 1 2
L 10
i f / f / s V n c = 8 V .
J. 1
0 2 4 6 8 10
COLLECTOR-EMITTER VOLTAGE V C E ( V )
O > 16
VCE - VGE
3 12 < t-m2 0 > g 8
p p»
2
1 « e u J
u '
COMMON
EMITTER
• T e = - 4 0 ' C
COMMON
EMITTER
• T e = - 4 0 ' C
COMMON
EMITTER
• T e = - 4 0 ' C
\ too
V 5 0
ic = 2 0 L
A
4 8 1 2 1 6 2 0
G A T E - E M I T T E R VOLTAGE V G £ ( V )
16
1 2
VCE - VGE
. COMMON
EMITTER
" Tc = 25"C
. COMMON
EMITTER
" Tc = 25"C •
. COMMON
EMITTER
" Tc = 25"C
1 0 0
5 0 —
V
h : = 2 ( A
0 4 8 1 2 1 6 2 0
G A T E - E M I T T E R VOLTAGE V G E ( V )
w u >
« o <
o > PS cc
3 u I a,
u u o o
16
1 2
VCE - VGE
COMMON
EMITTER
Tc = 125"C
5 0
I c = 2 0 A
100
0 4 8 1 2 1 6 2 0
G A T E - E M I T T E R VOLTAGE V G E ( V )
160
Jr* 120
v-z u £ 8 0
40
IC ~ VGE VCE-VGE - QG
COMMON EMITTER
V C E = 5 V
COMMON EMITTER
V C E = 5 V
JO *
»7i
u >
o < H 0 > a u f-H k—« 2 u: 1 cs c t u j
400
300
200
100
4 8 1 2 1 6 2 0 G A T E - E M I T T E R VOLTAGE V G E ( V )
rf 0 —' o
COMMON • EMITTER . R L = 6 X 1
Tc = 25*C
1 COMMON
• EMITTER . R L = 6 X 1
Tc = 25*C
/ COMMON
• EMITTER . R L = 6 X 1
Tc = 25*C / i
0
0 k o 0
0
1 0 0
n
/ /
16
12
4 0 80 120 160 200
C H A R G E Q G ( n c )
u o >
w o •< J 0 > cc M J-H »—« 2 w 1 • k H •< O
Appendix 4.
PC817 Series
PC817 Series # Lead forming type ( I type ) and taping reel type ( P t y p e ) are # # T U V ( V D E 0 8 8 4 ) approved type is also available as an option.
• Features 1. Current transfer ratio
( C T R : M I N . 5 0 % a t I F = 5 m A , V CE = 5 V )
2. High isolation voltage between input and output (Viso: 5 000V t o )
3. Compact dual-in-line package P C 8 1 7 : 1-channel type P C 8 2 7 : 2-channel type P C 8 3 7 : 3-channel type P C 8 4 7 : 4-channel type
4. Recognized by UL, file No. E64380
• Outl ine Dimensions
High Density Mounting Type Photocoupler
also available. ( P C 8 1 7 I / P C 8 1 7 P )
• Applications 1. Computer terminals 2. System appliances, measuring instruments 3. Registers, copiers, automatic vending
machines 4. Electric home appliances, such as fan
heaters, etc.
5. Signal transmission between circuits of different potentials and impedances
( U n i t : m m )
PC817 2 . 5 4 J " 5
® M ® C T R i 5 ? - ^ rank mark
Anode m a r k .
Internal connection diagram
© ® ft
® ® Mi 1.2 4 03
4 . 5 8 * 0 5
I o
0 . 5 *
C D ®
7 . 6 2 1 0 3
0 26*0-1
e = o to 13 °
<D Anode ® Cathode ® Emitter ® Collector
PC827 2 . 5 4 1 Internal connection diagram
® ® © ®
y y ft ft
® ® ® ®
I 7 . 6 2 ' 9 .66 * 0 , 5
0 . 5 *
® ® Anode ® ® Cathode © © Emitter © ® Collector
8 = 0 to 13"
PC837
2.54 * 0 2 5
© | © | © ® ® ® sp rj? «n r? «n r?
Internal connection diagram
© © © ® <S> ®
PC847 •E
\ ®
S i o • CL > • 0-AJ Li JJ U, JJ Li ® ® ® ® ©
y y y ft ft ft
'-] 2*0.3
1 4 . 7 4 * 0 - 5
® © ® ® ® © ® @ ® Anode ® ® ® Cathode ® ® © Emitter ® @ © Collector
7 . 6 2 1 0 3
2 . 5 4 *
© © @© © ®
Internal connection diagram
© © © © © © © ®
S o .
N fcfc co 5 5 I u i U u i i < 0 . 1 • CLl • 0 . 1 JJ U JJ li JJ Li ij Lb ® @ © ® ® ® ® ®
y y ft ft ft ft
0.9*0.2
1.2
® ® @® ® ® ® ®
7R9
0 . 5 *
, E 3 , 0.26* 0 1
, 5 r "1 •n | m
o co .
W o T r : 0 . 5 * ° - 1
8 = 0 to 13* ® @ ® ® Anode ® ® ® ® Cathode
0 to 13"
© © © © E m i t t e r ® © @ © Collector
" In tie absence of confirmation by device specification sheets, SHARP takes no responsibility for any defects that occur in equipment using any of SHARP'S devices, shown in catalogs, data boots, etc. Contact SHARP in order to obtain the latest version of the device specification sheets before using any SHARP'S device.*
SHARP PC817 Series
I Absolute Max imum Ratings ( T a = 25 °C) Parameter Symbol Rating Unit
Forward current If 50 mA
Input "'Peak forward current Ifm 1 A
Input Reverse voltage Vr 6 V Power dissipation p 70 mW Collector-emitter voltage V CEO 35 V
Output Emitter-collector voltage Veco 6 V
Output Collector current Ic 50 mA Collector power dissipation Pc 150 mW Total power dissipation P tot 200 mW
^Isolation voltage Vi,o 5000 Vrm, Operating temperature T opr -30 to + 100 °C Storage temperature T ag -55 to+ 125 °c
'3Soldering temperature T sol 260 °C
•1 Pulse width <=100ns, Duty ratio : 0.001 *2 40 to 60% RH, AC for 1 minute *3 For 10 seconds
• Electro-optical Characteristics (Ta= 25 °C) Parameter Symbol Conditions MIN. TYP. MAX. Unit
Input
Forward voltage Vf If = 20mA - 1.2 1.4 V
Input Peak forward voltage Vfm Ifm = 0.5A - - 3.0 V Input Reverse current 1R VR= 4V - 10 |IA
Input
Terminal capacitance C> V= 0, f= 1kHz - 30 250 pF Output Collector dark current ICEO VCE = 20V - 10-7 A
Transfer charac-teristics
*4Current transfer ratio CTR If= 5mA, Vce= 5V 50 - 600 %
Transfer charac-teristics
Collector-emitter saturation voltage VcE(sB) lF = 20mA,Ic= 1mA - 0.1 0.2 V
Transfer charac-teristics
Isolation resistance Riso DC500V, 40 to 60% RH 5 x 10"> 10" - a Transfer charac-teristics
Floating capacitance Cr V=0 , f= 1MHz - 0.6 1.0 pF Transfer charac-teristics Cut-off frequency fc Vce=5V, I c=2mA, Ri= 1000, - 3dB - 80 - kHz
Transfer charac-teristics
Response time Rise time tr
Vce = 2V, I c= 2mA, Rl = 100U - 4 18 ( I S
Transfer charac-teristics
Response time Fall time t f
Vce = 2V, I c= 2mA, Rl = 100U - 3 18 U s
*4 Classification table of current transfer ratio is shown below.
Model No. Rank mark CTR (%) PC817A A 80 to 160 PC817B B 130 to 260 PC817C C 200 to 400 PC817D D 300 to 600 PC8#7AB A o r B 80 to 260 P C 8 * 7 B C B o r C 130 to 400 P C 8 # 7 C D C o r D 200 to 600 P C 8 # 7 A C A, B or C 80 to 400 PC8#7BD B, C or D 130 to 600 P C 8 # 7 A D A, B, C or D 80 to 600 P C 8 # 7 A, B,C, Dor No mark 50 to 600
Fig. 1 Forward Current vs. Ambient Temperature
60
| 40
I 30
» : 1 or 2 or 3 or 4 -25 0 25 50 75 100 125
Ambient temperature Ta (*C)
SHARP PC817 Series
- 30 0 25 50 75 100
Ambient temperature T , CC)
1 2 5 10 20 50
Forward current I p (mA)
10000
5000
2 000
1 000
5 1 0 2 5 10 "2 2 5 10 -1 2 5 1
Duty ratio
Fig. 5 Forward Current vs. Forward Vol tage
0 0.5 1.0 1.5 2.0 2.5 3.0 3.5
Forwaid voltage V p (V)
Fig. 7 Relative Current Transfer Ratio vs. Ambient Temperature
Fig. 2 Collector Power Dissipation vs. Ambient Temperature
200
0 - 30 0 25 50 75 100 125
Ambient temperature T a CC)
Fig. 4 Current Transfer Ratio vs. Forward Current
Fig. 3 Peak Forward Current vs. Duty Ratio
Fig. 6 Collector Current vs. Collector-emitter Vol tage
0 1 2 3 4 5 6 7 8
Collector-emitter voltage V ce ( v )
SHARP PC817 Series
Fig.11 Frequency Response
Ambient temperature T a ( 'C)
Fig.10 Response Time vs. Load Resistance
Fig. 8 Collector-emitter Saturation Voltage vs. Ambient Temperature
Load resistance Ri. (k£ i )
Test Circuit for Response Time
Test Circuit for Frepuency Response
Frequencyf (kHz)
Fig. 12 Collector-emitter Saturation Voltage vs. Forward Current
6 >
Input Ro Rt Output
Output
5 10
Forward current I f (mA)
10 - 2 5 0 25 50 75 100
Ambient temperature T , CC)
Fig. 9 Collector Dark Current vs. Ambient Temperature
10 '
• Please refer to the chapter "Precautions for Use "
Application Circuits
NOTICE • T h e circuit application examples in this publication are provided to explain representative applications of
SHARP devices and are not intended to guarantee any circuit design or license any intellectual property rights. SHARP takes no responsibility for any problems related to any intellectual property right of a third party resulting from the use of SHARP'S devices.
•Contact SHARP in order to obtain the latest device specification sheets before using any SHARP device. SHARP reserves the right to make changes in the specifications, characteristics, data, materials, structure, and other contents described herein at any time without notice in order to improve design or reliability. Manufacturing locations are also subject to change without notice.
•Observe the following points when using any devices in this publication. SHARP takes no responsibility for damage caused by improper use of the devices which does not meet the conditions and absolute maximum ratings to be used specified in the relevant specification sheet nor meet the following conditions: (i) The devices in this publication are designed for use in general electronic equipment designs such as: — Personal computers — Office automation equipment — Telecommunication equipment [terminal] — Test and measurement equipment — Industrial control — Audio visual equipment — Consumer electronics ©Measures such as fail-safe function and redundant design should be taken to ensure reliability and safety when SHARP devices are used for or in connection with equipment that requires higher reliability such as:
— Transportation control and safety equipment (i.e., aircraft, trains, automobiles, etc.) —Traffic signals — Gas leakage sensor breakers — Alarm equipment — Various safety devices, etc. Qii) SHARP devices shall not be used for or in connection with equipment that requires an extremely high level of reliability and safety such as:
— Space applications — Telecommunication equipment [trunk lines] — Nuclear power control equipment — Medical and other life support equipment (e.g., scuba).
•Contact a SHARP representative in advance when intending to use SHARP devices for any "specific" applications other than those recommended by SHARP or when it is unclear which category mentioned above controls the intended use.
• I f the SHARP devices listed in this publication fall within the scope of strategic products described in the Foreign Exchange and Foreign Trade Control Law of Japan, it is necessary to obtain approval to export such SHARP devices.
•This publication is the proprietary product of SHARP and is copyrighted, with all rights reserved. Under the copyright laws, no part of this publication may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, in whole or in part, without the express written permission of SHARP. Express written permission is also required before any use of this publication may be made by a third party.
•Contact and consult with a SHARP representative if there are any questions about the contents of this publication.
SHARP 115
Appendix 5.
UTC D313 NPN EPITAXIAL PLANAR TRANSISTOR
NPN EPITAXIAL PLANAR TRANSISTOR
DESCRIPTION The UTC D313 is designed for use in general purpose
amplifier and switching applications.
1:BASE 2:COLLECTOR 3: EMITTER
ABSOLUTE MAXIMUM RATINGS PARAMETER SYMBOL VALUE UNIT
Collector-Base Voltage VCBO 60 V Collector-Emitter Voltage VCEO 60 V Emitter-Base Voltage VEBO 5 V Collector Current Ic 3 A Storage Temperature Tstg -55-+150 °C Junction Temperature V 150 °C
ELECTRICAL CHARACTERISTICS(Ta=25°C) PARAMETER SYMBOL TEST CONDITIONS MiN TYP MAX UNIT
Collector-Base Breakdown Voltage BVCBO IC=1mA 60 V Collector-Emitter Breakdown Voltage BVCEO . IC=10mA 60 V Emitter-Base Breakdown Voltage BVEBO IE=100uA 5 V Collector Cut-Off Current ICBO VCB=20V, IE=0 0.1 mA Emitter Cut-Off Current IEBO VEB=4V, IC=0 1.0 mA Collector-Emitter Saturation Voltage VCE(SAT) IC=2A, IB=0.2A 1.0 V Base-Emitter On voltage VBE(ON) VCE=2V, IC=1A 1.5 V DC Current Gain hFE IC=1A VCE=2V
IC=0.1A,VCE=2V 40 40
320
CLASSIFICATION ON hFE RANK I C D E F
RANGE I 40-80 60-120 100-200 160-320
U T C UNISONIC TECHNOLOGIES CO., LTD. 1 QW-R203-001.A
U T C UNISONIC TECHNOLOGIES CO., LTD. QW-R203-001.A
UTC D313 NPN EPITAXIAL PLANAR TRANSISTOR
1000
DC CURRENT GAINT 10000
SATURATION VOLTAGE v.s. COLLECTOR CURRENT
5- 1000
100 1000 10000 Collector Current (MA)
1 0 100 1000 10000
Collector Current (MA) lc=1 OLS
10000
VBHSAT) V.S.IC
£ 1000
10 100 1000 10000 Collector Current (mA) fc=10b
10 100
Collector to Emitter Vol tage (v)
10000
1000
VB£(ON) V.S. Ic
100 10 100 1000 10000
Collector Current (MA) VCE=2V
UTC D313 NPN EPITAXIAL PLANAR TRANSISTOR
UTC assumes no responsibility for equipment failures that result from using products at values that exceed, even momentarily, rated values (such as maximum ratings, operating condition ranges, or other parameters) listed in products specifications of any and all UTC products described or contained herein. UTC products are not designed for use in life support appliances, devices or systems where malfunction of these products can be reasonably expected to result in personal injury. Reproduction in whole or in part is prohibited without the prior written consent of the copyright owner. The information presented in this document does not form part of any quotation or contract, is believed to be accurate and reliable and may be changed without notice.
U T C UNISONJC TECHNOLOGIES CO., LTD. 3 QW-R203-001, A
Appendix 6.
S D L S 0 4 6
SN5413, SN54LS13, SN7413, SN74LS13 DUAL 4-INPUT
POSITIVE-NAi\lD SCHMITT TRIGGERS DECEMBER 1983-REVISED MARCH 1988
• Operation f rom Very Slow Edges
• Improved Line-Receiving Charac-teristics
High Noise Immunity
description
Each circuit functions as a 4-input NAND gate, but because of the Schmitt action, it has different input threshold levels for positive ( V t + ) and for negative going ( V f - ) signals.
These circuits are temperature-compensated and can be triggered from the slowest of input ramps and still give clean, jitter-free output signals.
The SN5413 and SN54LS13 are characterized for oper-ation over the full military temperature range of -55°C to 125°C. The SN7413 and SN74LS13 are character-ized for operation from 0°C to 70°C.
logic symbol*
1A-
1B-
1C-
1D-
2A-
2B-
2C-
2D-
(11 &JJ
(2) v j f i ) (41
16)
<91
110) VJB) (121
(131
•TY
-2Y
SN5413. SN54LS13 . . . J OH W PACKAGE SN7413 . . . N PACKAGE
SN74LS13 . . . D OR N PACKAGE (TOP VIEW)
1A C 1 Ul4 3 Vcc IB C 2 13 3 2D NC C 3 12 3 2C icC 4 11 2 NC 1D C 6 10 2 2B 1Y C 6 9 2 2A
GND C 7 S 2 2Y
SN54LS13 . . . FK PACKAGE (TOP VIEW)
NC ] 4 NC ] 5 1C ] 6 NC ] 7 1D ] 8
•• i > I 11 11 11—l 3 2 1 20 19
10 [
. 9 10 111213 / X r n t - i ^ n n X >- Q O > <
<3
NC—No internal connection
2C
17[ NC 16[ 15t 14 [ 2B
NC NC
logic diagram (positive logic)
tThis symbol is in accordance with ANSI/IEEE Std 91-1984 and I EC Publication 617-13.
Pin numbers shown are for 0, J, N, and W packages.
ABCD
FROOUCTIOK DATA decum««ti wauin )»tar«atfoa eorrnt as el puUiulkm dais. Product! t«irt«n> to
™ - m i p» the term* »l Taiaa latfrnmenti .:»«dart wirt««tY. f—.—— — nKUMrilr inclooe tejonj of all (urimrton.
TEXAS ^ INSTRUMENTS
POST OFFICE BOX 655012 > OAU.AS, TEXAS 75265
SN5413, SN54LS13, SN7413, SN74LS13 DUAL 4 INPUT POSITIVE NAND SCHMITT TRIGGERS
schematics
Supply voltage, V c c (see Note 1) 7 v
Input voltage: '13 5 . 5 V ' L S I 3 7 V
Operating free-air temperature: SN54' _ 5 5 ° c to 125°C SN74' 0°C to 70°C
Storage temperature range - 65°C to 150° C NOTE 1: Voltage values ere with respect to network ground terminal.
, TEXAS ^ INSTRUMENTS
»OST OFFICE B O * 655012 • DALLAS. TEXAS 75265
SN5413, SN7413 DUAL 4-INPUT
POSITIVE-NAND SCHMITT TRIGGERS
recommended operating conditions
SN5413 SN7413 MIN NOM MAX MIN NOM MAX
V<;c Supply voltage 4.6 5 5.5 4.75 5 5.25 V 'OH High-level output current - 0 . 8 - a s mA 'OL Low-level output current 16 16 mA T ^ Operating free-air temperature - 5 5 125 0 70 °c
electrical characteristics over recommended operating free-air temperature range (unless otherwise noted)
PARAMETER TEST CONDITIONS* MIN TYP* MAX UNIT v T + V C C ' 5 V 1.5 1.7 2 V
v - r - V C C - 5 V 0.6 0.9 1.1 V Mysieresis
1 V T 4 . - V T _ ) V C C - 6 V 0.4 0.8 V
V|K V c c ' M I N . If • — 12 mA - 1.5 V
V 0 H V C C - M I N . V j * 0.6 V, ' O H " - 0.8 mA 2.4 3.4 V
VOL V c c = M ' N . V | - 2 V , l0 |_ = 16mA 0.2 0.4 V
IT+ v C c - s V, V, - V T + - 0 . 6 5 mA
<T- VCC " 5 V- V | " V T _ - 0 . 8 5 mA
'1 V C c = MAX, V | - 8 . 8 V 1 mA ' |H V c c " M A X . V | H - 2 . 4 V 40 f A ' lL V C C - M A X , V | L - 0 . 4 V - 1 - 1 . 6 mA
'OS ® V C C " M A X - - 18 - 55 mA
'CCH v c c - M A X 14 23 mA
>CCL V c c - M A X 20 32 mA
* f o r c o n d i t i o n * s h o w n a t M J N or M A X , use t h e a p p r o p r i a t e va lue spec i f i ed u n d e r r e c o m m e n d e d o p e r a t i n g c o n d i t i o n s . » A l l t y p i c a l va lues are a t V c c - 5 V , T A - 2 5 ° C. § N o t m o r e t h a n o n e o u t p u t s h o u l d be s n o r t e d a t a t i m e ,
switching characteristics, V c c = 5 V , T a = 2 5 ° C
PARAMETEH FROM
IINPUT) TO
(OUTPUTI TEST CONDITIONS MIN TYP MAX UNIT
«PLH Any Y R L - 4 0 0 n , C L - 1 5 p F 18 27 ns
<PHL. Any Y R L - 4 0 0 n , C L - 1 5 p F
15 22 ns
, TEXAS ^ INSTRUMENTS
»OST OFFICE BO* 655012 • DALLAS. TEXAS 75265
SN54LS13, SN74LS13 DUAL 4-INPUT POSITIVE NAND SCHMITT TRIGGERS
recommended operating conditions SN54LS13 SN74LS13
UNIT MIN NOM MAX MIN NOM MAX
UNIT
Vec Supplv voltage 4.5 S 5.5 4.75 5 5.25 V
|QH High-level output current - 0 . 4 - 0 . 4 mA
'OL Low-level output current 4 8 mA
T^ Operating free-air temperature - 5 5 125 0 70 »C
electrical characteristics over recommended operating free-air temperature range (unless otherwise noted)
PARAMETER TEST CONDITIONS^ SN54LS13 SN74LS13
PARAMETER TEST CONDITIONS^ MIN TYP* MAX MIN TYP$ MAX
v T + v C c - 5 v 1.4 1.6 1.9 1.4 1.6 1.9 V
V T - v c c - 5 v 0.5 0.8 1 0.5 0.8 1 V Hystaresis
I V T + - V T _ ) V c c - S V 0.4 0.B 0.4 0.8 V
VtK V C C - M I N . l| - - 18 mA - 1.5 - 1 . 5 V
VOH V C C " MIN. V | = 0 .5 V, IQH " - ° -4 mA 2.5 3.4 2.7 3.4 V
v o l V C C = MIN, V| - 1.9 V IOI_ = 4 m A 0.25 0.4 0.25 0.4
v o l V C C = MIN, V| - 1.9 V l 0 L " 8 m A 0.35 0.5
V
<t+ V C C " 5 V, V, = V T + - 0 . 1 4 - 0 . 1 4 mA
l T - V C C " 6 V, V | - V T _ - 0 . 1 8 - 0 . 1 8 mA
l| V C C = MAX. V| - 7 V 0.1 0.1 mA
l |H VcC - MAX, V | H - 2.7 V 2 0 20 J»A
'lL V C C - MAX, V||_ " &4 V - 0 . 4 - 0 . 4 mA
loss VCC " MAX - 2 0 - 1 0 0 - 2 0 - 1 0 0 mA
•CCH V C C » MAX 2.9 6 2.9 6 mA
'CCL V C C - M A X 4.1 7 4.1 7 mA
t For conditions shown ea MIN or MAX, t M the appropriate value specified under recommended operating condition!. t All Typical values era et VcC = 5 V, T A - 2S5°C. 5 Not more then one output should be shorted at a time, and duration of the short-circuit should not exceed ana aecond.
switching characteristics, Vcc • 5 V , T a • 25°C
PARAMETER FROM
IINPUT) TO
(OUTPUT) TEST CONDITIONS MIN TYP MAX UNIT
'PLH Y R i - 1 l> O C L - 15 pF 15 22 ru tPHL
C L - 15 pF 18 27 ns
, TEXAS ^ INSTRUMENTS
»OST OFFICE BO* 655012 • DALLAS. TEXAS 75265
S N 5 4 1 3 , S N 5 4 L S 1 3 , S N 7 4 1 3 , S N 7 4 L S 1 3
DUAL 4-IIUPUT POSITIVE -NAND SCHMITT TRIGGERS
PARAMETER MEASUREMENT INFORMATION TEST POINT VCC
FROM OUTPUT UNDEH '
TEST
tsse Nota A) W W W
INPUT
C Cl
bee Nora B)
LOAD C IRCUIT
1 OUTPUT
^ y p W f H I
>k
\ V) re<(L>
K ' f l - H
VQ-el
3 V
0 V
Vow j ^TTv
- C V O L (See Note CI
VOLTAGE W A V E F O R M S
NOTES: A. All diodes ere 1 N3064 or ectuivelent. 8 . Cj_ includes p robe e n d j i g capacitance. C. Generator character ist ics and reference voltages are:
Generator Characteristics Reference Voltages zout ™ R tr tf v l reflHI V , ref(L) v O raf
SN547SN74* SO n 1 MHz 10 ns 10 ns 1.7 V 0.9 V 1.5 V SNS4 LS7SN74LS' 50 n 1MHz 15 ns 6 ns 1.6 V 0.8 V 1.3 V
POSITIVE-GOING THRESHOLD VOLTAGE vs
FREE-AIR TEMPERATURE
TYPICAL CHARACTERISTICS OF '13 CIRCUITS NEGATIVE-GOING THRESHOLD VOLTAGE
> 1.70 J l . « | 1.68
2 '.«7
J 166 1.66
f | 164 1 163
| 1*2 I 1.61
4 r 1 so
Vc< V" -6V
> i
X (-s'
4
vs FREE-AIR TEMPERATURE
-SO 0 26 60 76 IDS 125 Ta - Free-Air Temperature - °C
FIGURE 1
0.90 0.89 0.88 0.87 0.86 O.BS 084 0 83
VC c - 5 0.90 0.89 0.88 0.87 0.86 O.BS 084 0 83
0.90 0.89 0.88 0.87 0.86 O.BS 084 0 83
0.90 0.89 0.88 0.87 0.86 O.BS 084 0 83
0.90 0.89 0.88 0.87 0.86 O.BS 084 0 83
0.90 0.89 0.88 0.87 0.86 O.BS 084 0 83
0.90 0.89 0.88 0.87 0.86 O.BS 084 0 83
0.90 0.89 0.88 0.87 0.86 O.BS 084 0 83
0.B1 080 0.B1 080 I
HYSTERESIS vs
FREE-AIR TEMPERATURE
-75 — 50 — 25 0 25 50 75 100 125 — Free-Air Temperature — °C
FIGURE 2
f . I I
£ i + i->
5 V
820
810
820
810
820
810
790 780 770 760 750
790 780 770 760 750
790 780 770 760 750
790 780 770 760 750
790 780 770 760 750
-It -50 - 25 0 26 50 75 Ta — Free-Air Temperature —
100 125 'C
FIGURE 3 Data f o r temperatures be low 0 °C ana 70° C end supp ly voltages be low 4.7S V and above 5 .25 V ere epp l icab le f o r S N 5 4 1 3 on l y .
TEXAS INSTRUMENTS
OACT / ' C t i f t ortv . AC 7C!CC
SN5413, SN7413 DUAL 4 INPUT POSITIVE-NAND SCHMITT TRIGGERS
TYPICAL CHARACTERISTICS OF '13 CIRCUITS
DISTRIBUTION OF UNITS FOR HYSTERESIS
I V c c - 6
1 V
•A ( \ 1
99% ABO
•735
J
ARE VE J
f \ 99% ABO
•735
J /
720 740 780 780 800 820 840 860 MO VT+ - V f _ - Hysteresis - mV
FIGURE 4
2.0
1.8
1.6
1.4 f »•*
0
> 1.0
U 1 0.6
> I
OA
0.2
THRESHOLD VOLTAGES vs
SUPPLY VOLTAGE
4.6 4.75 5 5.25 VT+ - Vr_ - Hyrterasii - oiV
FIGURES
TA «25°<
' ? OKtlV. •Goinj Threi hold V oltagc . VT+
Neg («>»e- joins "hreth >ld Vc Itaga, VT-
5-5
HYSTERESIS vs
SUPPLY VOLTAGE 2.0
1.8
>
1 1 1-2
f , «
0.8
' 0 6
TA 2.0
1.8
>
1 1 1-2
f , «
0.8
' 0 6
2.0
1.8
>
1 1 1-2
f , «
0.8
' 0 6
2.0
1.8
>
1 1 1-2
f , «
0.8
' 0 6
2.0
1.8
>
1 1 1-2
f , «
0.8
' 0 6
2.0
1.8
>
1 1 1-2
f , «
0.8
' 0 6
2.0
1.8
>
1 1 1-2
f , «
0.8
' 0 6
> 0 . 4 > 0 . 4
0 4.5 4.76 5 6.25 5-5
Vcc - Supply Voltage ~ V FIGURE 6
OUTPUT VOLTAGE vs
INPUT VOLTAGE 1 1
Vcc " S V . T A - 2 6 ' C 1
VT+" VT+"
1
0 0.4 0.8 1.2 1.6 2 Vcc - Supply Voltage - V
F IGURE 7
Date f o r temperatures be low 0°C and 70°C and supp ly voltages be low 4 ,75 V and above 5.25 V ere appl icable fo r S N 5 4 1 3 on l y .
TEXAS ^ INSTRUMENTS
POST OFFICE SOX €55012 • DALLAS. TEXAS 7S265
SN54LS13, SN74LS13 DUAL 4-INPUT
POSITIVE-HAND SCHMITT TRIGGERS
TYPICAL CHARACTERISTICS OF 'LS13 CIRCUITS
POSITIVE-GOING THRESHOLD VOLTAGE vs
FREE-AIR TEMPERATURE
vC( I" : - s \
- 7 5 - S O - 2 5 0 28 BO 75 100 125
T * — Free-Air Temperature _ °C
FIGURE 8
NEGATIVE-GOING THRESHOLD VOLTAGE vs
FREE-AIR TEMPERATURE 0.90
0.89
0.88
0.87
0.86
VC C - 5 r 1/
0.90
0.89
0.88
0.87
0.86
0.90
0.89
0.88
0.87
0.86
0.90
0.89
0.88
0.87
0.86
0.85
0.84
0.85
0.84
0.85
0.84
0 82
0.81
0.80
0.81
0.80 — 75 -SO - 2 5 0 25 50 75 100 125
TA — Free-Air Temperature - °C
FIGURE 9
DISTRIBUTION OF UNITS FOR HYSTERESIS
VT+ - V T - - Hysteresis _ MV
FIGURE 11
HYSTERESIS vs
FREE AIR TEMPERATURE
> E I
S
S £ i i > i
Ta — Free-Air Temperature - °C
FIGURE 10
Date f o r t e m p e r a t u r e s b e l o w 0°C and above 70° C a n d s u p p l y vo l tages Be low 4 , 7 6 V e n a above 6 . 2 5 V are aoo l ieeb le f o r S N 5 4 L S 1 3 o n l y .
, TEXAS ^ INSTRUMENTS
»OST OFFICE BO* 655012 • DALLAS. TEXAS 75265
SN54LS13, SN74LS13 DUAL 4-INPUT P0SIT1VE-NAND SCHMITT TRIGGERS
TYPICAL CHARACTERISTICS OF XS13 CIRCUITS
THRESHOLD VOLTAGES AND HYSTERESIS vs
SUPPLY VOLTAGE
Vcc - Supply Voltage - V FIGURE 12
OUTPUT VOLTAGE v s
INPUT VOLTAGE
i — r ™ Vcc " 5 V
° 0 0.4 0.8 1.2 1.6 2 V| - Input Voltage - V
FIGURE 13
Data f o r t e m p e r a t u r e s b e l o w 0°C a n d above 70° C a n d s u p p l y vo l tages b e l o w 4 . 7 5 V e n d above 5 . 2 5 V are app l i cab le t o r S N S 4 L S 1 3 o n l y .
, TEXAS ^ INSTRUMENTS
»OST OFFICE BO* 655012 • DALLAS. TEXAS 75265
SN5413, SN54LS13, SN7413, SN74LS13 DUAL 4-INPUT
POSITIVE-NAND SCHIVHTT TRIGGERS
TYPICAL APPLICATION DATA
CMOS n r CMOS 1 >
) I TTL SYSTEM
SINE-WAVE J T OSCILLATOR J T
TTL SYSTEM INTERFACE FOR SLOW INPUT WAVEFORMS
PULSE SHAPER
0.1 H i to 10 MHz
MULTIVIBRATOR THRESHOLD DETECTOR
OUTPUT
INPUT
Open-collector outpu r
I ! INPUT | ^
J V
— I
I - I - - I
I You-OUTPUT INPU
PULSE STRETCHER
TEXAS INSTRUMENTS
POST OFFICE SOX 655012 • DALLAS. TEXAS 752E5
Appendix 7. MICROPROCESSOR PROGRAM FOR 'PI' CONTROLLER STRATEGY II
config _LVP_OFF & _XT_OSC & _WDT_OFF & _PWRTE_ON & _CP_OFF & _BODEN_OFF & _DEBUG_OFF
; for PID listp=16F877A Sinclude pl6F877a.inc
cblock 0x40 CEBPulselengthH CEBPulselengthL GENPulselengthH GENPuIselengthL errorL errorH errorfrequ INT TERM_H INTTERML PROP_TERM_H PROP_TERM_L PID_RES_H PID_RES_L PWM flags ;0-low frequency 1 -error neg 2-cal over 3-start new cycle
;4-gen ok 5-ceb ok endc
AARGBO equ 0x50 AARGB1 equ 0x51 AARGB5 equ 0x52 BARGB0 equ 0x53 BARGB1 equ 0x54 REMB0 equ 0x55 REMB1 equ 0x56 TEMP equ 0x57 LOOPCOUNT equ 0x58 TEMP2 equ 0x59
org 0x00 goto start
org 0x04 banksel INTCON bcf INTCON,0 btfss INTCON,2
; goto chk_Iow_fteq retfie bcf INTCON^ banksel flags btfss flags,4 ;chk gen ok goto setlowfreq btfsc flags,5 goto setoutput banksel flags bsf flags,0 bsf flags,3 goto setoutput
setlowfreq banksel flags bsf flags,0 bsf flags,3 call calculate retfie
setoutput call calculate banksel flags bsf flags,3
;chk_low_freq ; banksel PIR1 ; btfss PIR1,0 ; retfie ; Banksel flags
bsf retfie
flags,0; low frequency or
start
configprocessor banksel PR2 movlw 0xC7 ;199 movwf PR2 banksel CCPR1L movlw 0x00 ;at initilize 0 movwf CCPR1L bcf CCPlCON,CCPlX bcf CCP1 CON,CCP 1Y banksel TRISC bcf TRISC.2 banksel T2CON movlw b'00000100' ; TMR2 = on, prescale =1:1 movwf T2CON banksel CCP ICON movlw b'OOOOllH' ; and enable PWM mode movwf CCP1CON
banksel TRISB ; bit 5 for desable CEB reading movfw b'l 1100000' ;B,7 B,6 and B,5 are input banksel INTCON bsf INTCON,7 bsf INTCON,6 bsf INTCON,5 banksel T1CON bcf TlCON,4 bcf TICON,5 ;PS 1:1 minFz=16Hz BSF STATUS, RPO CLRF PIEl bcf PIE 1,0 ; timer 1 interupt enable desabled BCF STATUS, RPO CLRF PIRl
banksel OPTION_REG bcf OPTION_REG,5 bcf OPTION REG,3 bsf OPTION~REG,0 bsf OPTION_REG,l bsf OPTIONREG^ bank3el INTCON bsf INTCON,7 bsf INTCON,6 bsf INTCON,5 bcf INTCON,2 .
banksel INT_TERM_H clrf I N T T E R M H clrf INT_TERM_L clrf flags call setdefoultpwm
main Banksel flags btfsc flags,4 goto gen_read_ok
clrf flags; new cycle banksel TMRO clrf TMRO banksel OPTION_REG bsf OPTION_REG,0 ; bsf OPTION_REG,1 ; bsf OPTION_REG,2 ;timerO ps= 1:256
call readGEN banksel PIRl btfss PIR1,0 ;check if the timer lx>0ms goto $+6
Banksel flags bsf flags,0; low frequency flag bcf PIR1,0 goto setdefoultpwm ; goto set defoult pwm
g e n r e a d o k nop nop call readCEB btfsc flags ,2 bcf flags,2
btfsc flags,3 goto main goto $-2
goto main
readCEB Banksel flags bcf flags,3;: banksel PORTB btfsc PORTB,5 goto CEB freq_set banksel TMR1H CLRF ™ R I H CLRF TMR1L banksel CEBPulselengthH clrf CEBPulselengthH clrf CEBPulselengthL banksel PORTB btfsc flags,3 goto main btfsc PORTB,7 goto $-3 btfsc flags,3 goto main btfss PORTB,7 goto $-3 BSF TICON, btfsc flags,3 goto main btfsc PORTB,7 goto $-3 btfsc flags,3 goto main btfss PORTB,7 goto $-3 BcF TICON, banksel TMR1H movfw TMR1H banksel CEBPulselengthH movwf CEBPulselengthH banksel TMR1L movfw TMR1L banksel CEBPulselengthL movwf CEBPulselengthL banksel flags bsf flags,5 bcf nop return
; flag for new cycle
flags,0 ;flag for low frequency
CEB_freq_set movlw 0x4E banksel CEBPulselengthH movwf CEBPulselengthH movlw 0x20 banksel CEBPulselengthL movwf CEBPulselengthL banksel flags bsf flags,5 bcf nop return
flags,0 ;flag for low frequency
readGEN banksel TMR1H CLRF TMR1H CLRF TMR1L banksel GENPulselengthH clrf GENPulselengthH clrf GENPulselengthL banksel PORTB
btfsc flags,3 goto main btfsc PORTB,6 goto $-4 btfsc flags,3 goto main btfts PORTB,6 goto $-3 BSF TICON. btfsc flags,3 goto main btfsc PORTB,6 goto $-3 btfsc flags,3 goto main btfss PORTB,6 goto $-3 BcF TICON, btfsc flags,2 return banksel TMR1H movfw TMR1H banksel GENPulselengthH movwf GENPulselengthH banksel TMR1L movfw TMR1L banksel GENPulselengthL movwf GENPulselengthL banksel flags bsf flags,4 nop return
calculate TimeError ;(ceb-gen)
errorfre
btfsc flags,0 goto setdefoultpwm banksel GENPulselengthH movfw GENPulselengthL subwf CEBPulselengthL.w movwf errorL btfsc STATUS,0 goto $+5 comf errorL, 1 incf errorL,0 sublw Oxff movwf errorL incf GENPulselengthH,0 goto $+2 movfw GENPulselengthH subwf CEBPulselengthH.w movwf errorH btfss STATUS,0 goto setdefoultpwm nop
movfw errorH movwf AARGBO movfw errorL movwf AARGB1 movlw 0x08 movwf BARGBO call UDIV1608L nop
;if error is minus ;error minus
;error ok
movfw AARGBO addlw Oxff btfsc goto movfw
integral
STATUS,0 setdefoultpwm AARGB1
movwf errorfrequ
movfw sublw btfsc goto nop movlw OxOA MOVWF BARGBO CALL UDIV1608L
INT_TERM_H 0x01 STATUS, Z PLD add
;;add to previous results MOVF AARGBl.W ADDWF INT TERM L, F BTFSC STATUS, C INCF INT TERM H, F MOVF AARGBO, W ADDWF INT TERM H, F GOTO PID add
SUME_NEG BTFSS GOTO MOVLW ADDWF MOVWF BTFSS GOTO GOTO
CHECK_2 BIG ~ MOVLW
ADDWF MOVWF BTFSC GOTO
flag, 1 ADDJNT TERM B'00010100' INT_TERM_H, TEMP2 TEMP2, 7 ADDJNTTERM PIDadd
B'l 1101100' INT_TERM_H, TEMP2 TEMP2, 7 ADD INT TERM
W
W
PID_add clrf clrf
;set intigeal term movfw movwf movfw movwf movlw MOVWF call movfw addwf movfw addwf
P i D R E S H PID_RES_L
INT_TERM_L; AARGB1 INTTERM H AARGBO 0x05 BARGBO UDIV1608L AARGB1 PID_RES_L,1 AARGBO PID RES H,1
clrf AARGBO movfw errorfrequ movwf AARGB1 movlw 0x02 movwf BARGBO call UDIV1608L
movfw AARGB1 movwf AARGBO movlw 0x05
movwf call
BARGBO UMUL0808L
movfw AARGBO movwf PROP_TERM_H movfw AARGB1 movwf PROP_TERM_L
addwf PID_RES_L,l BTFSC STATUS, C INCF PID_RES_H, F movfw PROP_TERM_H addwf PID_RES_H,1
movfw PIDRES L banksel CCPR1L~ movwf CCPR1L
banksel flags bcf flags,5 bcf flags,4 return
set_defoult_para movlw 0x20 movwf PWM banksel CCPR1L movwf CCPR1L return
PID btfsc flags,0 goto setdefoultpwm
setdefoultpwm banksel BSF movlw movwf return
T2CON T2CON,2
0x28 ; L= duty*2 CCPR1L
=div
UDIV1608L
REMBO MOVLW MOVWF
GLOBAL CLRF
8 LOOPCOUNT
UD1V1608L
LOOPUI6O8A RLF MOVF SUBWF
RLF AARGBO,W REMBO, F
BARGBO,W REMBO, F
BTFSC GOTO ADDWF BCF
UOK68A RLF
STATUS,0 UOK68A
REMBO, F STATUS,0
AARGBO, F
DECFSZ GOTO
LOOPCOUNT, F LOOPUI6O8A
CLRF
MOVLW
TEMP
MOVWF LOOPCOUNT
LOOPUI6O8B RLF AARGB1,W RLF REMB0, F RLF TEMP, F MOVF BARGBO,W SUBWF REMB0, F CLRF AARGB5 CLRW BTFSS STATUS,0 INCFSZ AARGB5,W SUBWF TEMP, F
BTFSC STATUS,0 GOTO UOK68B MOVF BARGBO,W ADDWF REMB0, F CLRF AARGB5 CLRW BTFSC STATUS,0 INCFSZ AARGB5,W ADDWF TEMP, F
BCF STATUS,0 UOK68B RLF AARGB1,F
DECFSZ LOOPCOUNT, F GOTO LOOPUI6O8B
return
UMUL0808L CLRF AARGB1
MOVLW 0x08 MOVWF LOOPCOUNT MOVF AARGBO,W
LOOPUMO8O8A RRF BARGBO, F BTFSC STATUS,0 GOTO LUM0808NAP DECFSZ LOOPCOUNT, F GOTO LOOPUMO8O8A
CLRF AARGBO RETLW 0x00
LUM0808NAP BCF STATUS,0 GOTO LUM0808NA
LOOPUMO8O8 RRF BARGBO, F BTFSC STATUS,0 ADDWF AARGBO, F
LUM0808NA RRF AARGBO, F RRF AARGB1, F DECFSZ LOOPCOUNT, F GOTO LOOPUMO8O8
return