Still being a bit of a Noobie I had struggled to change the ini. and hal. files from an A axis to a C axis.
I have finally succeeded. Why was it necessary? On a PnP the picking head needs to orient the part to
the pad on the PCB. A axis is the wrong plane of opperation for this application.
Right now it's more of a principle of the thing ( making sure the correct axis is
represented ) does it truly matter ? Well it hasn't yet. I am sure it will in the future in my project.
I tried looking around the forum and the manual and I didn't find anything helpful.
Maybe this will help someone in the future. These codes may require some tweaking for individuals applications.
With that said This is " AS IS " use at your own risk I would suggest saving a backup copy of your system before making changes.
Below is the codes I had to change
the ini. file
Code:
in INI file
replace
[KINS]
JOINTS = 4
KINEMATICS = trivkins coordinates=XYZC
with
[KINS]
JOINTS = 4
KINEMATICS = trivkins coordinates=XYZC
[TRAJ]
COORDINATES = XYZC
add
[AXIS_C]
instead of
[AXIS_A]
The hal. file
Code:
in hal file
comment out
#loadrt pid names=pid.x,pid.y,pid.z,pid.a,pid.s
and add
loadrt pid names=pid.x,pid.y,pid.z,pid.c,pid.s
comment out
#addf pid.a.do-pid-calcs servo-thread
and add
addf pid.c.do-pid-calcs servo-thread
#*******************
# AXIS C JOINT 3
#*******************
setp pid.c.Pgain [JOINT_3]P
setp pid.c.Igain [JOINT_3]I
setp pid.c.Dgain [JOINT_3]D
setp pid.c.bias [JOINT_3]BIAS
setp pid.c.FF0 [JOINT_3]FF0
setp pid.c.FF1 [JOINT_3]FF1
setp pid.c.FF2 [JOINT_3]FF2
setp pid.c.deadband [JOINT_3]DEADBAND
setp pid.c.maxoutput [JOINT_3]MAX_OUTPUT
setp pid.c.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp pid.c.maxerror 0.000500
net c-index-enable <=> pid.c.index-enable
net c-enable => pid.c.enable
net c-pos-cmd => pid.c.command
net c-pos-fb => pid.c.feedback
net c-output <= pid.c.output
# Step Gen signals/setup
setp [HMOT](CARD0).stepgen.03.dirsetup [JOINT_3]DIRSETUP
setp [HMOT](CARD0).stepgen.03.dirhold [JOINT_3]DIRHOLD
setp [HMOT](CARD0).stepgen.03.steplen [JOINT_3]STEPLEN
setp [HMOT](CARD0).stepgen.03.stepspace [JOINT_3]STEPSPACE
setp [HMOT](CARD0).stepgen.03.position-scale [JOINT_3]STEP_SCALE
setp [HMOT](CARD0).stepgen.03.step_type 0
setp [HMOT](CARD0).stepgen.03.control-type 1
setp [HMOT](CARD0).stepgen.03.maxaccel [JOINT_3]STEPGEN_MAXACCEL
setp [HMOT](CARD0).stepgen.03.maxvel [JOINT_3]STEPGEN_MAXVEL
# ---closedloop stepper signals---
net c-pos-cmd <= joint.3.motor-pos-cmd
net c-vel-cmd <= joint.3.vel-cmd
net c-output <= [HMOT](CARD0).stepgen.03.velocity-cmd
net c-pos-fb <= [HMOT](CARD0).stepgen.03.position-fb
net c-pos-fb => joint.3.motor-pos-fb
net c-enable <= joint.3.amp-enable-out
net c-enable => [HMOT](CARD0).stepgen.03.enable
# ---setup home / limit switch signals---
net c-home-sw => joint.3.home-sw-in
net c-neg-limit => joint.3.neg-lim-sw-in
net c-pos-limit => joint.3.pos-lim-sw-in
compare the below and replace as necessary
#******************************
# connect miscellaneous signals
#******************************
# ---HALUI signals---
net axis-select-c halui.axis.c.select
net jog-c-pos halui.axis.c.plus
net jog-c-neg halui.axis.c.minus
net jog-c-analog halui.axis.c.analog
net c-is-homed halui.joint.3.is-homed