// Geo Brick LV Setup Assistant 2.4 Auto-Generated Parameters
CLOSE
DEL GAT
// Clock Setup Parameters
I7100=1498 // 19.6608kHz PWM frequency
I7101=1 // 19.6608kHz Phase frequency
I7102=3 // 4.9152kHz Servo Clock
I6800=1498
I6801=1
I6802=3
I7000=1498
I7001=1
I7002=3
I10=1706097 // 0.20338 msec Servo Period
I7004=0
I7104=0
#define timer32 I6612
#define msec32 *8388608/I10WHILE(I6612>0)ENDWHILE
// initialization PLC
OPEN PLC 1 CLEAR
DISABLE PLC 2..31
timer32 = 50 msec32
CMD"WX:$78114,$F8CCFE" //Motor #5 CLRF
timer32 = 50 msec32
CMD"WX:$78114,$F84CFE" // Motor #5 Type
timer32 = 50 msec32
CMD"WX:$78114,$F00CFE" // Motor #5 Protection
timer32 = 50 msec32
DISABLE PLC 1
CLOSE
I5=2
// Encoder Conversion Table Setup
//WY:$3501,$78000,$78008,$78010,$78018,$78100,$78108,$78110,$78118
//WY:$3509,$6800BF,$018018,$EC0009,$68013F,$018018,$EC000C,$6801BF,$018018,$EC000F,$68023F,$018018,$EC0012,$6802BF,$018018,$EC0015,$68033F,$018018,$EC0018,$6803BF,$018018,$EC001B,$68043F,$018018,$EC001E
WY:$3505,$78100
// Activation Control
I500=1
// Commutation Enable
I501=1
// Output Address
I502=$078102
// Position feedback
I503=$3505
// Velocity feedback
I504=$3505
// Current Loop Settings
I582=$078106
// ADC Mask
I584=$FFFC00
// Phase offset
I572=683
// PWM Scale Factor
I566=1123
// Current Loop Gains
I561=0.014722487194824 I562=0 I576=0.271337423932804
// I2T Protection Settings
I557=4742 I558=1852 I569=14226
// Flag Settings
I525=$078100
I524=$820001
// Commutation Parameters
// On-going Phase Position
I583=$78101
// Number of pole pairs per revolution
I570=3
// Number of encoder counts per revolution
I571=32768
// Motor Phasing Parameters
// Phase Search method
I580=0
// Phase Search Magnitude
I573=0
// Phase Search Time
I574=0
// Absolute Phase Position Source Address
I581=$78100
// Absolute Phase Position Format
I591=$800000
// Magnetization Current
I577=0
// Quadrature current loop calculation only (brushed motors)
I596=0
// PID values for Stepper Motors Only
网友评论