发表于:2006-08-01 11:00:00
楼主
本文为BALDOR x,y 轴运动控制程序的一部分,有性趣的能否解读一下,发给我。
'MotionWorx
'Ontario,Ca. 91761
'909-390-9405
'Start Date 10/05/04
'last revision: 5/11/04
'Inputs:
'Input 1 is
'Input 2 is
'Input 3 is
'Input 4 is Spray Glue Valve
'Input 5 is Finger switches wired in series
'Input 6 is Auto Manual
'Input 7 is
'Input 8 is Test
'Input 9 is Home Switch
'Input 10 is Zero Out current postion
'Input 11 is Teach
'Input 12 is Y Axis Home
'Input 13 is X Axis Home
'Input 14 is Y axis Back Limit
'Input 15 is X Axis Left limit
'Input 16 is Y Axis Front Limit
'Input 17 is X Axis Right Limit
'Input 18 is Faster Button
'Input 19 is Slower button
'Outputs:
'Output 0 is Glue Head Solenoid
'Output 1 is
'Output 12 is Yellow Light/ teach
'Analog Inputs
'Analog input 0 is Y joystick signal
'Analog input 1 is X joystick signal
'Notes:
'Axis 5 X Axis(Bottom Axis/26070 pulses per inch
'FDH2A05TBR20 Drive / BSM63N-375AA Motor/ 2.82 Amp Motor
'Axis 4 Y Axis/34760 pulses per inch
'FDH2A05TBR20 Drive / BSM63N-233AA Motor/ 3.93 Amp Motor
'Drive setup select motor / drive from above.
'set max speed to 2,000,000 PPS
'set in1 / Low Signal / Motor overtemp
'Simulated encoder output of FDH2 Drives is 4096 Pulse per rev.
'Declare variables
Dim ADCXTotal As Float
Dim ADCYTotal As Float
Dim CrashXPosition As Float
Dim CrashYPosition As Float
Dim Homing As Integer 'Homing active/inactive
Dim I As Integer 'Counter variable for smoothing
Dim JoggingX As Integer 'Jogging active/ inactive
Dim JoggingY As Integer 'Jogging active/ inactive
Dim Pathspeed As Float
Const Ramp=60 'Accel/ decel rate
Dim Teachpoint As Integer '
Dim TeachpointPlus As Integer<