[Home]KX3

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

Showing revision 11

Sieg KX3

The KX3 is a relatively common mini-mill available through several distributors, including Arc Eurotrade [1] and Harbor Freight [2]

The purpose of this howto is to provide sufficient information to allow KX3 owners to control their mill using EMC2. This howto is not complete, and should be considered guidance only.

Installing EMC2

This is described under the section Installing EMC2. This howto will assume EMC version 2.2.7 is installed.

Configuring the Beast

KX3.INI configuration file

Notes

[EMC]
MACHINE = KX3
NML_FILE = emc.nml
DEBUG = 0

[DISPLAY]
DISPLAY = axis
EDITOR = gedit
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 1.2
INTRO_GRAPHIC = emc2.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/USERNAME/emc2/nc_files
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm
PYVCP = panel.xml

[TASK]
TASK = milltask
CYCLE_TIME = 0.010

[RS274NGC]
PARAMETER_FILE = emc.var

[EMCMOT]
EMCMOT = motmod
SHMEM_KEY = 111
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
BASE_PERIOD = 29000
SERVO_PERIOD = 1000000

[HAL]
HALFILE = KX3.hal
HALFILE = custom.hal
POSTGUI_HALFILE = custom_postgui.hal

[TRAJ]
AXES = 3
COORDINATES = X Y Z
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 7.00
MAX_LINEAR_VELOCITY = 70.00

[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl

[AXIS_0]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 65.5172413793
MAX_ACCELERATION = 200.0
STEPGEN_MAXACCEL = 250.0
SCALE = 500.0
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = -2.5
MAX_LIMIT = 280.0
HOME_OFFSET = -3.000000
HOME_SEARCH_VEL = -30.000000
HOME_LATCH_VEL = 1.000000
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1

[AXIS_1]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 65.5172413793
MAX_ACCELERATION = 200.0
STEPGEN_MAXACCEL = 250.0
SCALE = 500.0
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = -2.5
MAX_LIMIT = 110.0
HOME_OFFSET = -3.000000
HOME_SEARCH_VEL = -30.000000
HOME_LATCH_VEL = 1.000000
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 2

[AXIS_2]
TYPE = LINEAR
HOME = 275.0
MAX_VELOCITY = 65.5172413793
MAX_ACCELERATION = 200.0
STEPGEN_MAXACCEL = 250.0
SCALE = 500.0
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = 0.0
MAX_LIMIT = 275.001
HOME_OFFSET = 275.000000
HOME_SEARCH_VEL = 40.000000
HOME_LATCH_VEL = -1.000000
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 0

KX3.HAL configuration file

Notes

loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD traj_period_nsec=[EMCMOT]SERVO_PERIOD key=[EMCMOT]SHMEM_KEY num_joints=[TRAJ]AXES
loadrt probe_parport
loadrt hal_parport cfg=0x378
setp parport.0.reset-time 3000
loadrt stepgen step_type=0,0,0
loadrt charge_pump
net estop-out iocontrol.0.user-enable-out
net charge-pump <= charge-pump.out
loadrt pwmgen output_type=0

addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf charge-pump base-thread
addf pwmgen.make-pulses base-thread
addf parport.0.write base-thread
addf parport.0.reset base-thread

addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
addf pwmgen.update servo-thread

net spindle-cmd <= motion.spindle-speed-out => pwmgen.0.value
net spindle-enable <= motion.spindle-on => pwmgen.0.enable
net spindle-pwm <= pwmgen.0.pwm
setp pwmgen.0.pwm-freq 500.0
setp pwmgen.0.scale 47500.0
setp pwmgen.0.offset 0.00789473684211
setp pwmgen.0.dither-pwm true
net spindle-cw <= motion.spindle-forward

setp parport.0.pin-01-out-invert 1
net spindle-cw => parport.0.pin-01-out
net xstep => parport.0.pin-02-out
setp parport.0.pin-02-out-reset 1
net xdir => parport.0.pin-03-out
net ystep => parport.0.pin-04-out
setp parport.0.pin-04-out-reset 1
net ydir => parport.0.pin-05-out
net zstep => parport.0.pin-06-out
setp parport.0.pin-06-out-reset 1
net zdir => parport.0.pin-07-out
net astep => parport.0.pin-08-out
setp parport.0.pin-08-out-reset 1
net adir => parport.0.pin-09-out
setp parport.0.pin-14-out-invert 1
net spindle-pwm => parport.0.pin-14-out
net charge-pump => parport.0.pin-17-out

net estop-ext <= parport.0.pin-10-in
net both-home-x <= parport.0.pin-11-in-not
net both-home-y <= parport.0.pin-12-in-not
net both-home-z <= parport.0.pin-13-in-not

setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 40000
setp stepgen.0.dirsetup 21000
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable axis.0.amp-enable-out => stepgen.0.enable
net both-home-x => axis.0.home-sw-in
net both-home-x => axis.0.neg-lim-sw-in
net both-home-x => axis.0.pos-lim-sw-in

setp stepgen.1.position-scale [AXIS_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 40000
setp stepgen.1.dirsetup 21000
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
net ystep <= stepgen.1.step
net ydir <= stepgen.1.dir
net yenable axis.1.amp-enable-out => stepgen.1.enable
net both-home-y => axis.1.home-sw-in
net both-home-y => axis.1.neg-lim-sw-in
net both-home-y => axis.1.pos-lim-sw-in

setp stepgen.2.position-scale [AXIS_2]SCALE
setp stepgen.2.steplen 1
setp stepgen.2.stepspace 0
setp stepgen.2.dirhold 40000
setp stepgen.2.dirsetup 21000
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
net zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
net zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
net zstep <= stepgen.2.step
net zdir <= stepgen.2.dir
net zenable axis.2.amp-enable-out => stepgen.2.enable
net both-home-z => axis.2.home-sw-in
net both-home-z => axis.2.neg-lim-sw-in
net both-home-z => axis.2.pos-lim-sw-in

net estop-out <= iocontrol.0.user-enable-out
net estop-ext => iocontrol.0.emc-enable-in

loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared

Starting the Beast

That's it! You should now have basic control of the three axes and the spindle from EMC2. It is advisable to do all initial testing with a "safe" Z-axis height, and with one hand close to the emergency stop.

Contributions

This page was originally written by Thorium?. Feel free to improve the content, or contact me if you would like to discuss.


LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions | View current revision
Edited April 28, 2009 10:10 am by Thorium (diff)
Search:
Published under a Creative Commons License