Beruflich Dokumente
Kultur Dokumente
Start
Start
Yes
Limit Switches Set?
ERR = POSR - POSA
ERR = POSR - POSA
No
New Position No
KPERR ← Min. of
Requested?
[KPKperr
• ERR←or
Min. of
100]
[Kp • ERR or 100]
Yes
Get New Position
= POSR SUM ← SUM + KPERR
SUM ← SUM + Kperr
ACCM = ACCM - KI
Determine PID term ACCM = ACCM
Direction = CCW- KI
= PENT and direction Fig. 3 Direction = CCW
PCH ← PCNT;
PCL ← 100 - PCNT de/dt = ERR - OLD_ERR
de/dt = ERR - OLD_ERR
KDERR = KD • de/dt
Drive Motor Hi; Kderr = KD • de/dt
PCH ← PCH - 1
Set Bridge
SetCCW
for Bridge
No for CW
PCH = 0?
Yes
PCNT = Min. of
PCNTor= 100]
Min. of
CNT ← CNT - 1 [SUM
[SUM or 100]
No
CNT = 0? End
End
Yes
Microwire
Port +5
5
4 U1
1 RA2 RA1 18
3 0.1 µF 10 µF
2 RA3 RA0 17
2
3 T0CKI OSC1 16
1
4 MCLR OSC2 15
5 Vss VDD 14 20 pF 20 pF U2
6 RB0 RB7 13 1 8
CS Vcc
7 RB1 RB6 12 5
DI 3
CH1
8 RB2 RB5 11 6 DO 2
CH0
9 RB3 RB4 10 7 CLK 4
GND Position
Feedback
PIC16C56 ADC0832
+PWR +5
1N4001 +5
100
+PWR Vi Vo 10k x 3
10 µF GND 0.1 µF
1N4750 35V P U3
LM7805 Input
RTN Switches
+PWR
0.1 x 3
P
1k 1000 µF
1k
+PWR +PWR 35V
MTP23PO6
P
1k 10k 1k +PWR 1k 10k 1k
+PWR
Motor
1k 1k
P 1k 1k P
10k 10k 0.01 µF
1k MTP25NO5E 1k
P P
0.01 µF P
P 5 LM358 1N914 0.01 µF +5
7
0.04 6 U4B 3 8
5 watt
1N914 1
2
U4A
P
LM358
47k 4
Note 1: All pnp transistors are 2N3906. 1k 1 µF
2: All npn transistors are 2N3904.
3: All diodes 1N914 unless otherwise specified.
4: All zeners are 1N4742.
APPENDIX A: MWPOS.ASM
MPASM 01.40 Released MWPOS.ASM 1-16-1997 13:16:02 PAGE 1
Errors : 0
Warnings : 0 reported, 0 suppressed
Messages : 0 reported, 0 suppressed
M
All rights reserved. © 1997, Microchip Technology Incorporated, USA. 6/97
Information contained in this publication regarding device applications and the like is intended for suggestion only and may be superseded by updates. No representation or
warranty is given and no liability is assumed by Microchip Technology Incorporated with respect to the accuracy or use of such information, or infringement of patents or other
intellectual property rights arising from such use or otherwise. Use of Microchip’s products as critical components in life support systems is not authorized except with express
written approval by Microchip. No licenses are conveyed, implicitly or otherwise, under any intellectual property rights. The Microchip logo and name are registered trademarks
of Microchip Technology Inc. in the U.S.A. and other countries. All rights reserved. All other trademarks mentioned herein are the property of their respective companies.