Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INI File:
- # EMC controller parameters for generic controller. Make these what you need
- # for your system.
- # General note: Comments can either be preceded with a # or ; - either is
- # acceptable, although # is in keeping with most linux config files.
- # General section -------------------------------------------------------------
- [EMC]
- # Version of this INI file
- VERSION = $Revision$
- # Name of machine, for use with display, etc.
- MACHINE = Hardinge 1
- # Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others
- DEBUG = 0
- # DEBUG = 0x00000007
- DEBUG = 0x7FFFFFFF
- # Sections for display options ------------------------------------------------
- [DISPLAY]
- # Name of display program, e.g., xemc
- DISPLAY = axis
- LATHE = 1
- EDITOR = gedit
- # DISPLAY = usrmot
- # DISPLAY = tkemc
- # Cycle time, in seconds, that display will sleep between polls
- CYCLE_TIME = 0.100
- # Path to help file
- HELP_FILE = tkemc.txt
- # Initial display setting for position, RELATIVE or MACHINE
- POSITION_OFFSET = RELATIVE
- # Initial display setting for position, COMMANDED or ACTUAL
- POSITION_FEEDBACK = ACTUAL
- # Highest value that will be allowed for feed override, 1.0 = 100%
- MAX_FEED_OVERRIDE = 1.2
- # Prefix to be used
- PROGRAM_PREFIX = /home/nick/linuxcnc/nc_files
- PROGRAM_PREFIX = /home/nick/linuxcnc/m_files
- # Introductory graphic
- INTRO_GRAPHIC = emc2.gif
- INTRO_TIME = 2
- PYVCP = spindle.xml
- # Enable popup balloon help
- BALLOON_HELP = 1
- # Task controller section -----------------------------------------------------
- [TASK]
- # Name of task controller program, e.g., milltask
- TASK = milltask
- # Cycle time, in seconds, that task controller will sleep between polls
- CYCLE_TIME = 0.010
- # Part program interpreter section --------------------------------------------
- [RS274NGC]
- # File containing interpreter variables
- PARAMETER_FILE = univpwm.var
- RS274NGC_STARTUP_CODE = G18 M9
- # Motion control section ------------------------------------------------------
- [EMCMOT]
- EMCMOT = motmod
- # Timeout for comm to emcmot, in seconds
- COMM_TIMEOUT = 1.0
- # Interval between tries to emcmot, in seconds
- COMM_WAIT = 0.010
- # Servo task period, in nanoseconds
- SERVO_PERIOD = 1000000
- # Hardware Abstraction Layer section --------------------------------------------------
- [HAL]
- # The run script first uses halcmd to execute any HALFILE
- # files, and then to execute any individual HALCMD commands.
- #
- # list of hal config files to run through halcmd
- # files are executed in the order in which they appear
- HALFILE = univpwm_load.hal
- HALFILE = univpwm_servo.hal
- HALFILE = univpwm_motion.hal
- HALFILE = univpwm_io.hal
- POSTGUI_HALFILE = post-gui.hal
- HALUI = halui
- [HALUI]
- # MDI commands
- MDI_COMMAND = T1 M6 G43
- MDI_COMMAND = T2 M6 G43
- MDI_COMMAND = T3 M6 G43
- MDI_COMMAND = T4 M6 G43
- MDI_COMMAND = T5 M6 G43
- MDI_COMMAND = T6 M6 G43
- MDI_COMMAND = T7 M6 G43
- MDI_COMMAND = T8 M6 G43
- #MDI_COMMAND = M102
- #MDI_COMMAND = M103
- #uncomment the following line to enable the pendant function
- #HALFILE = pendant.hal
- #uncomment the following line to enable the spindle speed display
- POSTGUI_HALFILE = spindle.hal
- #You need to remove axis 3 or provide another path for a spindle encoder to
- # feed into EMC for this to work.
- # Trajectory planner section --------------------------------------------------
- [TRAJ]
- AXES = 3
- # COORDINATES = X Y Z R P W
- COORDINATES = X Z
- HOME = 0 0 0 0
- LINEAR_UNITS = inch
- ANGULAR_UNITS = degree
- CYCLE_TIME = 0.010
- DEFAULT_VELOCITY = 0.5
- MAX_VELOCITY = 4.0
- DEFAULT_ACCELERATION = 3.0
- MAX_ACCELERATION = 3.0
- # Axes sections ---------------------------------------------------------------
- # Scaling: The OUTPUT_SCALE should be the speed
- # in UNITS/second (inches/sec or mm/sec) that would be
- # reached if the PWM duty cycle was 100%. It depends on
- # the power supply voltage, motor RPM/Volt factor, and
- # gearing/screw pitch. For example:
- #
- # Power supply voltage 50V
- # Motor RPM/V 1000RPM/24V
- # Gearing: 2 motor revs per 1 screw rev
- # Screw pitch: 0.2" per turn
- #
- # Max motor speed = 50V * 1000RPM/24V = 2083 RPM
- # Max screw speed = 2083RPM * 1(screw)/2(motor) = 1041RPM
- # Max table speed = 1041RPM * 0.2"/turn = 208 in/min
- # Max table speed = 208 in/min / 60 seconds = 3.47 inches/sec
- #
- # Since max speed is reached at 100% duty cycle, OUTPUT_SCALE
- # should be 3.47
- # First axis X Axis
- [AXIS_0]
- TYPE = LINEAR
- HOME = 0.0000
- MAX_VELOCITY = 3.0
- MAX_ACCELERATION = 3.0
- PID_MAX_VEL = 150
- BACKLASH = 0.000
- INPUT_SCALE = -40000
- OUTPUT_SCALE = 1
- MIN_LIMIT = -12.0
- MAX_LIMIT = 10.0
- FERROR = 0.2
- MIN_FERROR = 0.2
- HOME_OFFSET = 0.0
- HOME_SEARCH_VEL = -0.1
- HOME_LATCH_VEL = -0.1
- HOME_USE_INDEX = YES
- HOME_IGNORE_LIMITS = NO
- DEADBAND = 0
- P = 270
- I = 0
- D = 2
- BIAS = 0.0
- FF0 = 0
- FF1 = 0.26
- FF2 = 0.006
- # Second axis
- [AXIS_1]
- TYPE = LINEAR
- HOME = 0.000
- MAX_VELOCITY = 3.0
- MAX_ACCELERATION = 20.0
- PID_MAX_VEL = 1.25
- BACKLASH = 0.000
- INPUT_SCALE = 4000
- OUTPUT_SCALE = 5.0
- MIN_LIMIT = -10.0
- MAX_LIMIT = 10.0
- FERROR = 0.010
- MIN_FERROR = 0.001
- HOME_OFFSET = 0.0
- HOME_SEARCH_VEL = 0.0
- HOME_LATCH_VEL = 0.0
- HOME_USE_INDEX = NO
- HOME_IGNORE_LIMITS = NO
- DEADBAND = 0.000126
- P = 175
- I = 100
- D = 0.1
- BIAS = 0.0
- FF0 = 0
- FF1 = 1
- FF2 = 0.0
- # Third axis Z Axis
- [AXIS_2]
- TYPE = LINEAR
- HOME = 0.0000
- MAX_VELOCITY = 3.0
- MAX_ACCELERATION = 3.0
- PID_MAX_VEL = 100
- BACKLASH = 0.000
- INPUT_SCALE = -40000
- OUTPUT_SCALE = 1
- MIN_LIMIT = -10.0
- MAX_LIMIT = 10.0
- FERROR = 0.250
- MIN_FERROR = 0.010
- HOME_OFFSET = 0.0
- HOME_SEARCH_VEL = -0.1
- HOME_LATCH_VEL = -0.1
- HOME_USE_INDEX = YES
- HOME_IGNORE_LIMITS = NO
- DEADBAND = 0
- P = 260
- I = 0
- D = 2
- BIAS = 0
- FF0 = 0
- FF1 = 0.275
- FF2 = 0.006
- # Fourth axis
- #[AXIS_3]
- #TYPE = ANGULAR
- #HOME = 0.0
- #MAX_VELOCITY = 65
- #MAX_ACCELERATION = 20.0
- #PID_MAX_VEL = 66
- #BACKLASH = 0.000
- #INPUT_SCALE = 11.11111111
- #OUTPUT_SCALE = 5.0
- #MIN_LIMIT = -3600.0
- #MAX_LIMIT = 3600.0
- #FERROR = 0.010
- #MIN_FERROR = 0.001
- #HOME_OFFSET = 0.0
- #HOME_SEARCH_VEL = 0.0
- #HOME_LATCH_VEL = 0.0
- #HOME_USE_INDEX = NO
- #HOME_IGNORE_LIMITS = NO
- #DEADBAND = 0.046
- #P = 150
- #I = 100
- #D = 0.1
- #BIAS = 0.0
- #FF0 = 0
- #FF1 = 1
- #FF2 = 0.0
- # section for main IO controller parameters -----------------------------------
- [EMCIO]
- TOOL_CHANGE_WITH_SPINDLE_ON = 1
- # Name of IO controller program, e.g., io
- EMCIO = io
- # cycle time, in seconds
- CYCLE_TIME = 0.100
- # tool table file
- TOOL_TABLE = univpwm.tbl
- #Turret inserted Info
- [TURRET]
- STOP_SETTLE = 500
- PARK_SETTLE = 500
- HAL File:
- # HAL config file for Pico Systems USC board
- #
- # Connect motion controller I/Os
- #
- # connect limit/home switch outputs to motion controller
- newsig Xminlim bit
- newsig Xmaxlim bit
- newsig Xhome bit
- linksp Xminlim <= ppmc.0.din.01.in-not
- linksp Xminlim => axis.0.neg-lim-sw-in
- linksp Xmaxlim <= ppmc.0.din.02.in-not
- linksp Xmaxlim => axis.0.pos-lim-sw-in
- linksp Xhome <= ppmc.0.din.00.in
- linksp Xhome => axis.0.home-sw-in
- #newsig Yminlim bit
- #newsig Ymaxlim bit
- #newsig Yhome bit
- #linksp Yminlim <= ppmc.0.din.05.in
- #linksp Yminlim => axis.1.neg-lim-sw-in
- #linksp Ymaxlim <= ppmc.0.din.06.in
- #linksp Ymaxlim => axis.1.pos-lim-sw-in
- #linksp Yhome <= ppmc.0.din.04.in
- #linksp Yhome => axis.1.home-sw-in
- newsig Zminlim bit
- newsig Zmaxlim bit
- newsig Zhome bit
- linksp Zminlim <= ppmc.0.din.04.in-not
- #linksp Zminlim <= ppmc.0.din.09.in
- linksp Zminlim => axis.2.neg-lim-sw-in
- linksp Zmaxlim <= ppmc.0.din.05.in-not
- #linksp Zmaxlim <= ppmc.0.din.10.in
- linksp Zmaxlim => axis.2.pos-lim-sw-in
- linksp Zhome <= ppmc.0.din.03.in
- #linksp Zhome <= ppmc.0.din.08.in
- linksp Zhome => axis.2.home-sw-in
- #newsig Aminlim bit
- #newsig Amaxlim bit
- #newsig Ahome bit
- #linksp Aminlim <= ppmc.0.din.12.in
- #linksp Aminlim => axis.3.neg-lim-sw-in
- #linksp Amaxlim <= ppmc.0.din.13.in
- #linksp Amaxlim => axis.3.pos-lim-sw-in
- #linksp Ahome <= ppmc.0.din.11.in
- #linksp Ahome => axis.3.home-sw-in
- # connect index pulses to motion controller
- # uncomment these lines only if you have a Rev 3 UPC board
- # The ppmc.x.encoder.xx.index-enable pin is ONLY exported by the driver
- # if the UPC has rev 3 or above firmware
- newsig Xindex bit
- #newsig Yindex bit
- newsig Zindex bit
- linksp Xindex <= ppmc.0.encoder.00.index-enable
- linksp Xindex => axis.0.index-enable
- #linksp Yindex <= ppmc.0.encoder.01.index-enable
- #linksp Yindex => axis.1.index-enable
- linksp Zindex <= ppmc.0.encoder.02.index-enable
- linksp Zindex => axis.2.index-enable
- #
- # Connect I/O controller I/Os
- #
- # connect e-stop write/sense to I/O controller
- # and univpwm's fault with estop's output, so estop FF is reset, but
- # prevent continued estop signal from univpwm from holding FF cleared
- newsig ppmcEstop bit
- linksp ppmcEstop ppmc.0.din.15.in-not
- linksp ppmcEstop and2.0.in0
- newsig EstopOkIn bit
- linksp EstopOkIn estop-latch.0.fault-in
- linksp EstopOkIn and2.0.out
- newsig EstopOkOut bit
- linksp EstopOkOut <= ppmc.0.dout.07.out
- linksp EstopOkOut iocontrol.0.emc-enable-in
- linksp EstopOkOut estop-latch.0.ok-out
- linksp EstopOkOut and2.0.in1
- newsig emc-estop-out bit
- linksp emc-estop-out iocontrol.0.user-enable-out
- linksp emc-estop-out estop-latch.0.ok-in
- newsig emc-estop-reset bit
- linksp emc-estop-reset iocontrol.0.user-request-enable
- linksp emc-estop-reset estop-latch.0.reset
- ### TURRET ###
- # create signals for tool loading loopback
- net ToolPrep iocontrol.0.tool-prepare iocontrol.0.tool-prepared
- net ToolChange iocontrol.0.tool-change turret.0.position-change
- net ToolChanged turret.0.position-changed iocontrol.0.tool-changed
- # decode turret encoder inputs
- newsig ones bit
- newsig twos bit
- newsig fours bit
- newsig eights bit
- linksp ones ppmc.0.din.06.in
- linksp ones wsum.0.bit.0.in
- linksp twos ppmc.0.din.07.in
- linksp twos wsum.0.bit.1.in
- linksp fours ppmc.0.din.08.in
- linksp fours wsum.0.bit.2.in
- linksp eights ppmc.0.din.09.in
- linksp eights wsum.0.bit.3.in
- # wsum.N.hold bit in
- newsig TurretCurrentPosition s32
- linksp TurretCurrentPosition wsum.0.sum
- linksp TurretCurrentPosition turret.0.position-current
- newsig TurretRequestedPosition s32
- linksp TurretRequestedPosition iocontrol.0.tool-prep-number
- linksp TurretRequestedPosition turret.0.position-requested
- setp turret.0.settle-stop [TURRET]STOP_SETTLE
- setp turret.0.settle-park [TURRET]PARK_SETTLE
- # connect turret to parallel port
- newsig TurretSeek bit
- linksp TurretSeek turret.0.seek
- linksp TurretSeek ppmc.0.dout.05.out
- newsig TurretStop bit
- linksp TurretStop turret.0.stop
- linksp TurretStop ppmc.0.dout.06.out
- #addf turret.0 servo-thread
- #Turret Info End
- # connect spindle fwd/rev to I/O controller
- newsig SpindleFwd bit
- newsig SpindleRev bit
- linksp SpindleFwd <= ppmc.0.dout.00.out
- linksp SpindleFwd => motion.spindle-forward
- linksp SpindleRev <= ppmc.0.dout.01.out
- linksp SpindleRev => motion.spindle-reverse
- # connect spindle brake to I/O controller
- newsig SpindleBrakeOn bit
- linksp SpindleBrakeOn <= ppmc.0.dout.02.out
- linksp SpindleBrakeOn => motion.spindle-brake
- # connect mist/flood coolant to I/O controller
- newsig MistOn bit
- newsig FloodOn bit
- linksp MistOn <= ppmc.0.dout.03.out
- linksp MistOn => iocontrol.0.coolant-mist
- linksp FloodOn <= parport.0.pin-02-out
- setp parport.0.pin-02-out-invert 1
- linksp FloodOn => iocontrol.0.coolant-flood
- # Line 159 ppmc.0.dout.04.out
- #parport.0.pin-02-out
- setp parport.0.pin-05-out-invert 1
- setp parport.0.pin-06-out-invert 1
- #Connect Verticle Slide switch
- #setp parport.0.pin-10-in
- net slide-input motion.digital-in-00 <= parport.0.pin-10-in
- # pull the CR-1 relay in when the Power Button is on JT
- net machine-power <= motion.motion-enabled =>
- # CR-1 Control Power
- net machine-power => parport.0.pin-01-out
- setp parport.0.pin-01-out-invert 1
- net brake-off => parport.0.pin-07-out
- #setp parport.0.pin-07-out-invert 1
- #File from email
- #set scale for 5000 RPM MAX and connect spindle speed to USC DAC
- setp ppmc.0.DAC8.00.scale 410.0
- net spinspeed motion.spindle-speed-out ppmc.0.DAC8.00.value
- #new info
- # These 3 lines from Andy
- net spindle-revs-in ppmc.0.encoder.03.velocity => motion.spindle-speed-in
- net spindle-pos ppmc.0.encoder.03.position => motion.spindle-revs
- net spindle-index-enable motion.spindle-index-enable <=> ppmc.0.encoder.03.index-enable
- # 2 commented out lines from inputing 3 above lines
- #net spinraw ppmc.0.encoder.03.delta conv-s32-float.0.in
- net spinfloat conv-s32-float.0.out mult2.0.in0
- setp mult2.0.in1 0.273066667
- #net SpindleRPM mult2.0.out motion.spindle-speed-in
- # 4.096 0.06826667 0.273066667
- #File from spin
- #set scale for 5000 RPM MAX and connect spindle speed to USC DAC
- #setp ppmc.0.DAC8.00.scale 500.0
- #newsig spinspeed float
- #linksp spinspeed <= motion.spindle-speed-out
- #linksp spinspeed => ppmc.0.DAC8.00.value
- #File from 2.3.5
- #setp ppmc.0.DAC8.00.scale 390.0
- #net spinspeed motiom.spindle-speed-out ppmc.0.DAC8.00.value
- #newsig spinspeed float
- #linksp spinspeed <= motion.spindle-speed-out
- #linksp spinspeed => ppmc.0.DAC8.00.value
- loadrt classicladder_rt
- addf classicladder.0.refresh servo-thread
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement