7i76e+8i20 pncconf issues

More
24 Mar 2018 23:05 #107787 by blazini36
Working on setting up a 7i76e (which runs fine by itself) with a 8i20 to control a brushless DC motor with hall sensors. The 8i20 is connected to the 7i76e serial TB. Pncconf generated a hal file with some errors, some of which I can fix, some I'm not sure about, LinuxCNC won't start with this HAL file, likes to complain about missing pins:
# Generated by PNCconf at Sat Mar 24 17:52:21 2018
# If you make changes to this file, they will be
# overwritten when you run PNCconf again

loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hostmot2
loadrt hm2_eth board_ip="10.10.10.10" config="firmware=hm2/7i76/7i76e.BIT num_encoders=1 num_pwmgens=0 num_stepgens=5 sserial_port_0=00xxxx" 
setp    hm2_7i76e.0.watchdog.timeout_ns 5000000
loadrt pid names=pid.x,pid.y,pid.z,pid.s
loadrt bldc cfg=h
loadrt abs names=abs.spindle
loadrt lowpass names=lowpass.spindle
loadrt scale names=scale.gear
loadrt near
loadrt mux16 names=ratio_select

addf hm2_7i76e.0.read          servo-thread
addf motion-command-handler   servo-thread
addf motion-controller        servo-thread
addf pid.x.do-pid-calcs       servo-thread
addf pid.y.do-pid-calcs       servo-thread
addf pid.z.do-pid-calcs       servo-thread
addf pid.s.do-pid-calcs       servo-thread
addf bldc.0 servo-thread
#addf bldc.1 servo-thread
addf ratio_select             servo-thread
addf scale.gear               servo-thread
addf abs.spindle              servo-thread
addf lowpass.spindle          servo-thread
addf near.0                   servo-thread
addf hm2_7i76e.0.write         servo-thread
setp hm2_7i76e.0.dpll.01.timer-us -50
setp hm2_7i76e.0.stepgen.timer-number 1

# external output signals


# --- MACHINE-IS-ENABLED ---
net machine-is-enabled hm2_7i76e.0.7i76.0.0.output-00
setp hm2_7i76e.0.7i76.0.0.output-00-invert true

# external input signals


# --- MAX-HOME-X ---
net max-home-x     <=  hm2_7i76e.0.7i76.0.0.input-00

# --- MIN-X ---
net min-x     <=  hm2_7i76e.0.7i76.0.0.input-01

# --- MIN-HOME-Y ---
net min-home-y     <=  hm2_7i76e.0.7i76.0.0.input-02

# --- MAX-Y ---
net max-y     <=  hm2_7i76e.0.7i76.0.0.input-03

# --- MAX-HOME-Z ---
net max-home-z     <=  hm2_7i76e.0.7i76.0.0.input-04

# --- MIN-Z ---
net min-z     <=  hm2_7i76e.0.7i76.0.0.input-05

# --- MAX-A ---
net max-a     <=  hm2_7i76e.0.7i76.0.0.input-07

# --- S-HALL1-IN ---
net s-hall1-in     <=  hm2_7i76e.0.7i76.0.0.input-16

# --- S-HALL2-IN ---
net s-hall2-in     <=  hm2_7i76e.0.7i76.0.0.input-17

# --- S-HALL3-IN ---
net s-hall3-in     <=  hm2_7i76e.0.7i76.0.0.input-18

#*******************
#  JOINT X
#*******************

setp   pid.x.Pgain     [JOINT_0]P
setp   pid.x.Igain     [JOINT_0]I
setp   pid.x.Dgain     [JOINT_0]D
setp   pid.x.bias      [JOINT_0]BIAS
setp   pid.x.FF0       [JOINT_0]FF0
setp   pid.x.FF1       [JOINT_0]FF1
setp   pid.x.FF2       [JOINT_0]FF2
setp   pid.x.deadband  [JOINT_0]DEADBAND
setp   pid.x.maxoutput [JOINT_0]MAX_OUTPUT
setp   pid.x.error-previous-target true
setp   pid.x.maxerror .0005

net x-index-enable  <=> pid.x.index-enable
net x-enable        =>  pid.x.enable
net x-pos-cmd       =>  pid.x.command
net x-vel-cmd       =>  pid.x.command-deriv
net x-pos-fb        =>  pid.x.feedback
net x-output        =>  pid.x.output

# Step Gen signals/setup

setp   hm2_7i76e.0.stepgen.00.dirsetup        [JOINT_0]DIRSETUP
setp   hm2_7i76e.0.stepgen.00.dirhold         [JOINT_0]DIRHOLD
setp   hm2_7i76e.0.stepgen.00.steplen         [JOINT_0]STEPLEN
setp   hm2_7i76e.0.stepgen.00.stepspace       [JOINT_0]STEPSPACE
setp   hm2_7i76e.0.stepgen.00.position-scale  [JOINT_0]STEP_SCALE
setp   hm2_7i76e.0.stepgen.00.step_type        0
setp   hm2_7i76e.0.stepgen.00.control-type     1
setp   hm2_7i76e.0.stepgen.00.maxaccel         [JOINT_0]STEPGEN_MAXACCEL
setp   hm2_7i76e.0.stepgen.00.maxvel           [JOINT_0]STEPGEN_MAXVEL

# ---closedloop stepper signals---

net x-pos-cmd    <= joint.0.motor-pos-cmd
net x-vel-cmd    <= joint.0.vel-cmd
net x-output     <= hm2_7i76e.0.stepgen.00.velocity-cmd
net x-pos-fb     <= hm2_7i76e.0.stepgen.00.position-fb
net x-pos-fb     => joint.0.motor-pos-fb
net x-enable     <= joint.0.amp-enable-out
net x-enable     => hm2_7i76e.0.stepgen.00.enable

# ---setup home / limit switch signals---

net max-home-x     =>  joint.0.home-sw-in
net min-x     =>  joint.0.neg-lim-sw-in
net max-home-x     =>  joint.0.pos-lim-sw-in

#*******************
#  JOINT Y
#*******************

setp   pid.y.Pgain     [JOINT_1]P
setp   pid.y.Igain     [JOINT_1]I
setp   pid.y.Dgain     [JOINT_1]D
setp   pid.y.bias      [JOINT_1]BIAS
setp   pid.y.FF0       [JOINT_1]FF0
setp   pid.y.FF1       [JOINT_1]FF1
setp   pid.y.FF2       [JOINT_1]FF2
setp   pid.y.deadband  [JOINT_1]DEADBAND
setp   pid.y.maxoutput [JOINT_1]MAX_OUTPUT
setp   pid.y.error-previous-target true
setp   pid.y.maxerror .0005

net y-index-enable  <=> pid.y.index-enable
net y-enable        =>  pid.y.enable
net y-pos-cmd       =>  pid.y.command
net y-vel-cmd       =>  pid.y.command-deriv
net y-pos-fb        =>  pid.y.feedback
net y-output        =>  pid.y.output

# Step Gen signals/setup

setp   hm2_7i76e.0.stepgen.01.dirsetup        [JOINT_1]DIRSETUP
setp   hm2_7i76e.0.stepgen.01.dirhold         [JOINT_1]DIRHOLD
setp   hm2_7i76e.0.stepgen.01.steplen         [JOINT_1]STEPLEN
setp   hm2_7i76e.0.stepgen.01.stepspace       [JOINT_1]STEPSPACE
setp   hm2_7i76e.0.stepgen.01.position-scale  [JOINT_1]STEP_SCALE
setp   hm2_7i76e.0.stepgen.01.step_type        0
setp   hm2_7i76e.0.stepgen.01.control-type     1
setp   hm2_7i76e.0.stepgen.01.maxaccel         [JOINT_1]STEPGEN_MAXACCEL
setp   hm2_7i76e.0.stepgen.01.maxvel           [JOINT_1]STEPGEN_MAXVEL

# ---closedloop stepper signals---

net y-pos-cmd    <= joint.1.motor-pos-cmd
net y-vel-cmd    <= joint.1.vel-cmd
net y-output     <= hm2_7i76e.0.stepgen.01.velocity-cmd
net y-pos-fb     <= hm2_7i76e.0.stepgen.01.position-fb
net y-pos-fb     => joint.1.motor-pos-fb
net y-enable     <= joint.1.amp-enable-out
net y-enable     => hm2_7i76e.0.stepgen.01.enable

# ---setup home / limit switch signals---

net min-home-y     =>  joint.1.home-sw-in
net min-home-y     =>  joint.1.neg-lim-sw-in
net max-y     =>  joint.1.pos-lim-sw-in

#*******************
#  JOINT Z
#*******************

setp   pid.z.Pgain     [JOINT_2]P
setp   pid.z.Igain     [JOINT_2]I
setp   pid.z.Dgain     [JOINT_2]D
setp   pid.z.bias      [JOINT_2]BIAS
setp   pid.z.FF0       [JOINT_2]FF0
setp   pid.z.FF1       [JOINT_2]FF1
setp   pid.z.FF2       [JOINT_2]FF2
setp   pid.z.deadband  [JOINT_2]DEADBAND
setp   pid.z.maxoutput [JOINT_2]MAX_OUTPUT
setp   pid.z.error-previous-target true
setp   pid.z.maxerror .0005

net z-index-enable  <=> pid.z.index-enable
net z-enable        =>  pid.z.enable
net z-pos-cmd       =>  pid.z.command
net z-vel-cmd       =>  pid.z.command-deriv
net z-pos-fb        =>  pid.z.feedback
net z-output        =>  pid.z.output

# Step Gen signals/setup

setp   hm2_7i76e.0.stepgen.02.dirsetup        [JOINT_2]DIRSETUP
setp   hm2_7i76e.0.stepgen.02.dirhold         [JOINT_2]DIRHOLD
setp   hm2_7i76e.0.stepgen.02.steplen         [JOINT_2]STEPLEN
setp   hm2_7i76e.0.stepgen.02.stepspace       [JOINT_2]STEPSPACE
setp   hm2_7i76e.0.stepgen.02.position-scale  [JOINT_2]STEP_SCALE
setp   hm2_7i76e.0.stepgen.02.step_type        0
setp   hm2_7i76e.0.stepgen.02.control-type     1
setp   hm2_7i76e.0.stepgen.02.maxaccel         [JOINT_2]STEPGEN_MAXACCEL
setp   hm2_7i76e.0.stepgen.02.maxvel           [JOINT_2]STEPGEN_MAXVEL

# ---closedloop stepper signals---

net z-pos-cmd    <= joint.2.motor-pos-cmd
net z-vel-cmd    <= joint.2.vel-cmd
net z-output     <= hm2_7i76e.0.stepgen.02.velocity-cmd
net z-pos-fb     <= hm2_7i76e.0.stepgen.02.position-fb
net z-pos-fb     => joint.2.motor-pos-fb
net z-enable     <= joint.2.amp-enable-out
net z-enable     => hm2_7i76e.0.stepgen.02.enable

# ---setup home / limit switch signals---

net max-home-z     =>  joint.2.home-sw-in
net min-z     =>  joint.2.neg-lim-sw-in
net max-home-z     =>  joint.2.pos-lim-sw-in

#*******************
#  SPINDLE S
#*******************

# -- BLDC setup --
setp   bldc.0.drive-offset       0
setp   bldc.0.rev                0
net s-a-value       bldc.0.A-value
net s-b-value       bldc.0.B-value
net s-c-value       bldc.0.C-value

#net s-pos-rawcounts      bldc.0.rawcounts
#net s-index-enable      bldc.0.index-enable
net s-bldc-current      bldc.0.out
net s-meas-angle        bldc.0.phase-angle
net s-output             bldc.0.value
#net s-enable             bldc.0.init
#net s-is-init           bldc.0.init-done

setp   pid.s.Pgain     [SPINDLE_9]P
setp   pid.s.Igain     [SPINDLE_9]I
setp   pid.s.Dgain     [SPINDLE_9]D
setp   pid.s.bias      [SPINDLE_9]BIAS
setp   pid.s.FF0       [SPINDLE_9]FF0
setp   pid.s.FF1       [SPINDLE_9]FF1
setp   pid.s.FF2       [SPINDLE_9]FF2
setp   pid.s.deadband  [SPINDLE_9]DEADBAND
net ratio_select.out   pid.s.maxoutput 
setp   pid.s.error-previous-target true

net spindle-index-enable  <=> pid.s.index-enable
net spindle-enable        =>  pid.s.enable
net spindle-vel-cmd-rpm-abs     => pid.s.command
net spindle-vel-fb-rpm-abs      => pid.s.feedback
net spindle-pid-out  pid.s.output    => scale.gear.in
net gear-ratio       ratio_select.out-f => scale.gear.gain
setp ratio_select.in00 0.000286
setp ratio_select.in01 0.000571
net gear-select-a         =>  ratio_select.sel0
net spindle-output        <=  scale.gear.out

# ---8i20 amplifier card signals/setup---

setp       hm2_7i76e.0.8i20.0.1..max_current 0.000
net s-meas-angle =>       hm2_7i76e.0.8i20.0.1..angle
net s-bldc-current =>     hm2_7i76e.0.8i20.0.1..current
net s-enable =>            hm2_7i76e.0.8i20.0.1..amp_enable

# ---setup spindle control signals---

net spindle-vel-cmd-rps        <=  motion.spindle-speed-out-rps
net spindle-vel-cmd-rps-abs    <=  motion.spindle-speed-out-rps-abs
net spindle-vel-cmd-rpm        <=  motion.spindle-speed-out
net spindle-vel-cmd-rpm-abs    <=  motion.spindle-speed-out-abs
net spindle-enable             <=  motion.spindle-on
net spindle-cw                 <=  motion.spindle-forward
net spindle-ccw                <=  motion.spindle-reverse
net spindle-brake              <=  motion.spindle-brake
net spindle-revs               =>  motion.spindle-revs
net spindle-at-speed           =>  motion.spindle-at-speed
net spindle-vel-fb-rps         =>  motion.spindle-speed-in
net spindle-index-enable      <=>  motion.spindle-index-enable

# ---Setup spindle at speed signals---

sets spindle-at-speed true


#******************************
# connect miscellaneous signals
#******************************

#  ---HALUI signals---

net axis-select-x  halui.axis.x.select
net jog-x-pos      halui.axis.x.plus
net jog-x-neg      halui.axis.x.minus
net jog-x-analog   halui.axis.x.analog
net x-is-homed     halui.joint.0.is-homed
net axis-select-y  halui.axis.y.select
net jog-y-pos      halui.axis.y.plus
net jog-y-neg      halui.axis.y.minus
net jog-y-analog   halui.axis.y.analog
net y-is-homed     halui.joint.1.is-homed
net axis-select-z  halui.axis.z.select
net jog-z-pos      halui.axis.z.plus
net jog-z-neg      halui.axis.z.minus
net jog-z-analog   halui.axis.z.analog
net z-is-homed     halui.joint.2.is-homed
net jog-selected-pos      halui.axis.selected.plus
net jog-selected-neg      halui.axis.selected.minus
net spindle-manual-cw     halui.spindle.forward
net spindle-manual-ccw    halui.spindle.reverse
net spindle-manual-stop   halui.spindle.stop
net machine-is-on         halui.machine.is-on
net jog-speed             halui.axis.jog-speed
net MDI-mode              halui.mode.is-mdi

#  ---coolant signals---

net coolant-mist      <=  iocontrol.0.coolant-mist
net coolant-flood     <=  iocontrol.0.coolant-flood

#  ---probe signal---

net probe-in     =>  motion.probe-input

#  ---motion control signals---

net in-position               <=  motion.in-position
net machine-is-enabled        <=  motion.motion-enabled

#  ---digital in / out signals---

#  ---estop signals---

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

#  ---manual tool change signals---

loadusr -W hal_manualtoolchange
net tool-change-request     iocontrol.0.tool-change       =>  hal_manualtoolchange.change
net tool-change-confirmed   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

Pncconf originally generated the wrong BLDC "personality" and used encoder commutation. this was likely my error running through the wizard but I commented the unused pins out and changed personallity to =h. For some reason "addf bldc.1 servo-thread" was generated which I commented out, I'm not sure why that second bldc function got added. All of the pins generated referred to "bldc.9.pinname" which linuxCNC complained about until they were changed to "bldc.0.pinname" At the moment it's complaining about:
setp       hm2_7i76e.0.8i20.0.1..max_current 0.000
net s-meas-angle =>       hm2_7i76e.0.8i20.0.1..angle
net s-bldc-current =>     hm2_7i76e.0.8i20.0.1..current
net s-enable =>            hm2_7i76e.0.8i20.0.1..amp_enable

Pins not found. I'm not sure why they came out with 2 dots after the channel, or if the pins are not found because the 8i20 was not found. Is there any way to check for communication between boards?

Please Log in or Create an account to join the conversation.

More
24 Mar 2018 23:10 #107788 by blazini36
Replied by blazini36 on topic 7i76e+8i20 pncconf issues
this can be moved to the pncconf section if it's more appropriate there.

Please Log in or Create an account to join the conversation.

Time to create page: 0.149 seconds
Powered by Kunena Forum