Import LinuxCNC source tree
This commit is contained in:
1
configs/by_interface/pluto/lathe-pluto/README
Normal file
1
configs/by_interface/pluto/lathe-pluto/README
Normal file
@@ -0,0 +1 @@
|
||||
This configuration is for a hobby sized (Sherline) servo-operated lathe based on the Pluto servo driver. The hardware is a Pluto FPGA board ($60) which counts the encoders and generates up/down PWM at high frequency in order to drive H bridges for the lathe's servos. On this prototype machine both servos are driven with one L298 dual H bridge (which is usually used to drive one stepper.) This is an example of (very) inexpensive servo use on a hobby machine and it gives very good performance.
|
||||
9
configs/by_interface/pluto/lathe-pluto/emc.tbl
Normal file
9
configs/by_interface/pluto/lathe-pluto/emc.tbl
Normal file
@@ -0,0 +1,9 @@
|
||||
T1 P1 D0.100000 Z+0.100000 I+95.000000 J+155.000000 Q1 ;
|
||||
T2 P2 D0.100000 I+85.000000 J+25.000000 Q2 ;
|
||||
T3 P3 D0.100000 I+275.000000 J+335.000000 Q3 ;
|
||||
T4 P4 D0.100000 I+265.000000 J+205.000000 Q4 ;
|
||||
T5 P5 D0.100000 I+210.000000 J+150.000000 Q5 ;
|
||||
T6 P6 D0.100000 X+0.500000 Z+0.500000 I+120.000000 J+60.000000 Q6 ;
|
||||
T7 P7 D0.100000 I-30.000000 J+30.000000 Q7 ;
|
||||
T8 P8 D0.100000 I+240.000000 J+300.000000 Q8 ;
|
||||
T9 P9 D0.100000 Q9 ;
|
||||
107
configs/by_interface/pluto/lathe-pluto/lathe-pluto.hal
Normal file
107
configs/by_interface/pluto/lathe-pluto/lathe-pluto.hal
Normal file
@@ -0,0 +1,107 @@
|
||||
# load realtime modules
|
||||
loadrt [KINS]KINEMATICS
|
||||
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
|
||||
loadrt pid num_chan=2 debug=1
|
||||
loadrt ddt count=4
|
||||
loadrt pluto_servo
|
||||
loadrt scale
|
||||
loadrt mux2
|
||||
loadrt debounce cfg=1
|
||||
loadrt limit1 count=1
|
||||
|
||||
# define the order of execution for RT code
|
||||
addf pluto-servo.read servo-thread
|
||||
addf motion-command-handler servo-thread
|
||||
addf motion-controller servo-thread
|
||||
addf pid.0.do-pid-calcs servo-thread
|
||||
addf pid.1.do-pid-calcs servo-thread
|
||||
addf pluto-servo.write servo-thread
|
||||
|
||||
addf ddt.0 servo-thread
|
||||
addf ddt.1 servo-thread
|
||||
addf ddt.2 servo-thread
|
||||
addf ddt.3 servo-thread
|
||||
addf scale.0 servo-thread
|
||||
addf mux2.0 servo-thread
|
||||
addf debounce.0 servo-thread
|
||||
addf limit1.0 servo-thread
|
||||
|
||||
setp pluto-servo.encoder.0.scale [JOINT_0]INPUT_SCALE
|
||||
setp pluto-servo.encoder.1.scale [JOINT_2]INPUT_SCALE
|
||||
setp pluto-servo.encoder.2.scale -4096
|
||||
|
||||
setp pluto-servo.pwm.0.scale 26 # volts supply
|
||||
setp pluto-servo.pwm.1.scale 26
|
||||
|
||||
setp pid.0.maxoutput 26 # volts at motor
|
||||
setp pid.1.maxoutput 26
|
||||
|
||||
# the values below come from the ini
|
||||
setp pid.0.Pgain [JOINT_0]P
|
||||
setp pid.0.Igain [JOINT_0]I
|
||||
setp pid.0.Dgain [JOINT_0]D
|
||||
setp pid.0.bias [JOINT_0]BIAS
|
||||
setp pid.0.FF0 [JOINT_0]FF0
|
||||
setp pid.0.FF1 [JOINT_0]FF1
|
||||
setp pid.0.FF2 [JOINT_0]FF2
|
||||
setp pid.0.deadband [JOINT_0]DEADBAND
|
||||
|
||||
setp pid.1.Pgain [JOINT_2]P
|
||||
setp pid.1.Igain [JOINT_2]I
|
||||
setp pid.1.Dgain [JOINT_2]D
|
||||
setp pid.1.bias [JOINT_2]BIAS
|
||||
setp pid.1.FF0 [JOINT_2]FF0
|
||||
setp pid.1.FF1 [JOINT_2]FF1
|
||||
setp pid.1.FF2 [JOINT_2]FF2
|
||||
setp pid.1.deadband [JOINT_2]DEADBAND
|
||||
|
||||
net Xpos-fb pluto-servo.encoder.0.position => pid.0.feedback joint.0.motor-pos-fb
|
||||
net Zpos-fb pluto-servo.encoder.1.position => pid.1.feedback joint.2.motor-pos-fb
|
||||
|
||||
net Xpos-cmd joint.0.motor-pos-cmd => pid.0.command ddt.0.in
|
||||
net Zpos-cmd joint.2.motor-pos-cmd => pid.1.command ddt.2.in
|
||||
|
||||
net Xvel-cmd pid.0.output => pluto-servo.pwm.0.value
|
||||
net Zvel-cmd pid.1.output => pluto-servo.pwm.1.value
|
||||
|
||||
net Xvel ddt.0.out => ddt.1.in
|
||||
net Xacc ddt.1.out
|
||||
|
||||
net Zvel ddt.2.out => ddt.3.in
|
||||
net Zacc ddt.3.out
|
||||
|
||||
# machine ON
|
||||
net Xenable joint.0.amp-enable-out => pid.0.enable pluto-servo.pwm.0.enable pluto-servo.dout.09
|
||||
net Zenable joint.2.amp-enable-out => pid.1.enable pluto-servo.pwm.1.enable
|
||||
|
||||
net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
|
||||
|
||||
# spindle SSR
|
||||
# net spindle-fwd spindle.0.forward pluto-servo.dout.00
|
||||
|
||||
setp debounce.0.delay 3
|
||||
net Xswitch pluto-servo.din.00-not => debounce.0.0.in
|
||||
net Xswitch-debounced debounce.0.0.out => joint.0.home-sw-in joint.0.pos-lim-sw-in
|
||||
|
||||
# tool loading loopback
|
||||
net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
|
||||
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
|
||||
|
||||
# spindle speed control
|
||||
setp pluto-servo.pwm.3.enable 1
|
||||
|
||||
# this needs scale/offset to give the right speeds, but 0 should be 0
|
||||
net spindle-speed-cmd spindle.0.speed-out => limit1.0.in
|
||||
net spindle-speed-cmd-limited limit1.0.out => scale.0.in
|
||||
setp scale.0.gain 0.00026315789 # 1/3800
|
||||
setp scale.0.offset 0.105
|
||||
setp mux2.0.in0 0
|
||||
setp limit1.0.max 1300
|
||||
net spindle-speed-scaled scale.0.out => mux2.0.in1
|
||||
net spindle-fwd spindle.0.forward => mux2.0.sel pluto-servo.dout.00
|
||||
net spindle-pwm mux2.0.out => pluto-servo.pwm.3.value
|
||||
|
||||
# spindle position, for threading
|
||||
net spindle-index spindle.0.index-enable <=> pluto-servo.encoder.2.index-enable
|
||||
net spindle-pos pluto-servo.encoder.2.position => spindle.0.revs
|
||||
net spindle-speed-fb pluto-servo.encoder.2.velocity => spindle.0.speed-in
|
||||
127
configs/by_interface/pluto/lathe-pluto/lathe-pluto.ini
Normal file
127
configs/by_interface/pluto/lathe-pluto/lathe-pluto.ini
Normal file
@@ -0,0 +1,127 @@
|
||||
[EMC]
|
||||
VERSION = 1.1
|
||||
MACHINE = LATHE-PLUTO
|
||||
DEBUG = 0
|
||||
|
||||
[DISPLAY]
|
||||
PYVCP = vcp.xml
|
||||
DISPLAY = axis
|
||||
LATHE = 1
|
||||
CYCLE_TIME = 0.200
|
||||
POSITION_OFFSET = RELATIVE
|
||||
POSITION_FEEDBACK = ACTUAL
|
||||
MAX_FEED_OVERRIDE = 1.5
|
||||
PROGRAM_PREFIX = ../../nc_files/
|
||||
# Editor to be used with Axis
|
||||
#EDITOR = geany
|
||||
|
||||
[FILTER]
|
||||
PROGRAM_EXTENSION = .py Python Script
|
||||
PROGRAM_EXTENSION = .NGC rs274ngc files
|
||||
py = python3
|
||||
|
||||
[RS274NGC]
|
||||
PARAMETER_FILE = emc.var
|
||||
|
||||
[EMCMOT]
|
||||
EMCMOT = motmod
|
||||
COMM_TIMEOUT = 1.0
|
||||
SERVO_PERIOD = 500000
|
||||
|
||||
[TASK]
|
||||
TASK = milltask
|
||||
CYCLE_TIME = 0.001
|
||||
|
||||
[HAL]
|
||||
HALFILE = lathe-pluto.hal
|
||||
HALFILE = axis_manualtoolchange.hal
|
||||
POSTGUI_HALFILE = postgui.hal
|
||||
|
||||
[HALUI]
|
||||
#No Content
|
||||
|
||||
[TRAJ]
|
||||
COORDINATES = X Z
|
||||
HOME = 0 0 0
|
||||
LINEAR_UNITS = mm
|
||||
ANGULAR_UNITS = deg
|
||||
DEFAULT_LINEAR_VELOCITY = 10
|
||||
MAX_LINEAR_VELOCITY = 32.5
|
||||
DEFAULT_LINEAR_ACCELERATION = 400
|
||||
MAX_LINEAR_ACCELERATION = 707
|
||||
|
||||
[EMCIO]
|
||||
TOOL_TABLE = emc.tbl
|
||||
TOOL_CHANGE_POSITION = 40 0 20
|
||||
|
||||
[KINS]
|
||||
KINEMATICS = trivkins
|
||||
JOINTS = 3
|
||||
|
||||
[AXIS_X]
|
||||
MIN_LIMIT = -10.0
|
||||
MAX_LIMIT = 40.50001
|
||||
MAX_VELOCITY = 23
|
||||
MAX_ACCELERATION = 500
|
||||
|
||||
[JOINT_0]
|
||||
TYPE = LINEAR
|
||||
UNITS = 1.0
|
||||
HOME = 40.5
|
||||
MAX_VELOCITY = 23
|
||||
MAX_ACCELERATION = 500
|
||||
BACKLASH = 0.06
|
||||
CYCLE_TIME = 0.001000
|
||||
INPUT_SCALE = 6000
|
||||
OUTPUT_SCALE = 1.000
|
||||
MIN_LIMIT = -10.0
|
||||
MAX_LIMIT = 40.50001
|
||||
FERROR = .1
|
||||
MIN_FERROR = .03
|
||||
HOME_OFFSET = 41.14
|
||||
HOME_SEARCH_VEL = 12
|
||||
HOME_LATCH_VEL = -0.2
|
||||
HOME_USE_INDEX = NO
|
||||
HOME_IGNORE_LIMITS = YES
|
||||
P = 1000
|
||||
I = 30000
|
||||
D = 7
|
||||
BIAS = 0
|
||||
FF0 = 0
|
||||
FF1 = 1
|
||||
FF2 = 0.025
|
||||
DEADBAND=.00009
|
||||
|
||||
[AXIS_Z]
|
||||
MIN_LIMIT = -1.0
|
||||
MAX_LIMIT = 90.0
|
||||
MAX_VELOCITY = 23
|
||||
MAX_ACCELERATION = 500
|
||||
|
||||
[JOINT_2]
|
||||
TYPE = LINEAR
|
||||
UNITS = 1.0
|
||||
HOME = 0.000
|
||||
MAX_VELOCITY = 23
|
||||
MAX_ACCELERATION = 500
|
||||
BACKLASH = 0.00
|
||||
CYCLE_TIME = 0.001000
|
||||
INPUT_SCALE = -6000
|
||||
OUTPUT_SCALE = 1.000
|
||||
MIN_LIMIT = -1.0
|
||||
MAX_LIMIT = 90.0
|
||||
FERROR = 0.35
|
||||
MIN_FERROR = 0.20
|
||||
HOME_OFFSET = 0.0
|
||||
HOME_SEARCH_VEL = 0.0
|
||||
HOME_LATCH_VEL = 0.0
|
||||
HOME_USE_INDEX = NO
|
||||
HOME_IGNORE_LIMITS = NO
|
||||
P = 1000
|
||||
I = 30000
|
||||
D = 7
|
||||
BIAS = 0
|
||||
FF0 = 0
|
||||
FF1 = 1
|
||||
FF2 = 0.025
|
||||
DEADBAND=.00009
|
||||
4
configs/by_interface/pluto/lathe-pluto/postgui.hal
Normal file
4
configs/by_interface/pluto/lathe-pluto/postgui.hal
Normal file
@@ -0,0 +1,4 @@
|
||||
net Xvel-cmd pyvcp.xpid-bar
|
||||
net Zvel-cmd pyvcp.zpid-bar
|
||||
|
||||
net spindle-speed-cmd pyvcp.spindle-bar
|
||||
13
configs/by_interface/pluto/lathe-pluto/vcp.xml
Normal file
13
configs/by_interface/pluto/lathe-pluto/vcp.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<pyvcp>
|
||||
|
||||
<label><text>"X PID"</text></label>
|
||||
<bar><halpin>"xpid-bar"</halpin><min_>-26</min_><max_>26</max_></bar>
|
||||
|
||||
<label><text>"Z PID"</text></label>
|
||||
<bar><halpin>"zpid-bar"</halpin><min_>-26</min_><max_>26</max_></bar>
|
||||
|
||||
<label><text>"Spindle"</text></label>
|
||||
<bar><halpin>"spindle-bar"</halpin><min_>0</min_><max_>1500</max_></bar>
|
||||
|
||||
</pyvcp>
|
||||
Reference in New Issue
Block a user