Dust Collection Shoe with independent Z control
31 Jan 2024 05:53 - 31 Jan 2024 06:01 #292045
by finnstrom
Replied by finnstrom on topic Dust Collection Shoe with independent Z control
I did it! Man I was right at the finish line and then I fried the 7i76e joint 4 (my W axis). PCW is one of the fastest and most responsive people I've ever had the pleasure to work with, he got me back in action within days.
Just to recap, these were my goals:
Here's what I did:
Hopefully this is of some help GW. Oh and I should say, the reason I didn't do the post processor method is because I am not familiar enough where I feel comfortable always keeping control of W when Z is moving. Eg. when in a drilling operation you just list Z once and then a bunch of X/Y for your holes, and LinuxCNC knows to move up/down between those operations.
Just to recap, these were my goals:
- Get my dust shoe (that sits on its own axis (W) on top of my Z axis) to move such that it is at a fixed location with reference to the work piece.
- Have it retract fully when not in air/vacuum mode so that the ATC isn't blocked.
- Able to set the offset from Z zero (work table) on the fly in GUI
Here's what I did:
- The first being normal W axis operation just like any other axis. This lets linuxcnc home the axis properly and myself control W independently if I ever debug or run my own slab planer code (where I actively move the dust shoe down after every pass)
- In the second mode, I muxed the joint.4.motor-pos so that linuxcnc no longer controlled it and used instead the negative of joint.3.motor-pos together with some offsets (details below)
- Sum the absolute negative value of Z joint.3.pos-cmd with two offsets:
- The W-Z offset (zero to zero) and the Z to table offset
- The end work table to W offset (how high I want the shoe to hover over the work table)
- Limit the potential output of this to the W axis min/max, as there are no checks around this in LinuxCNC (I think the checks come earlier)
- Convert the absolute pos-cmd to motor-pos-cmd using motor-offset because that's what the PID uses (NOTE: I'm missing extra steps here, since generally it's not just offset, but it is for me. See joint.N.pos-cmd here .)
- Mux the input so that a digital in from coolant mist activates the shoe (I'm using air and vacuum, so to be pedantic I changed the Fusion 360 post processor so that air and vacuum output M7)
- Mux the feedback output so that when coolant mist is active, the feedback is shorted (ie. joint.4.motor-pos-fb is connected to joint.4.motor-pos-cmd)
- I would have preferred to make Wvel just -Zvel and circumvent the W PID all together, but then I wouldn't be able to alter the W to work table offset on the fly
Hopefully this is of some help GW. Oh and I should say, the reason I didn't do the post processor method is because I am not familiar enough where I feel comfortable always keeping control of W when Z is moving. Eg. when in a drilling operation you just list Z once and then a bunch of X/Y for your holes, and LinuxCNC knows to move up/down between those operations.
# The position command is joint4 minus an offset to the surface, plus the height of the workpiece
setp joint_3_following_pos_cmd_calc.gain0 1.0
setp joint_3_following_pos_cmd_calc.gain1 -1.0
setp joint_3_following_pos_cmd_calc.offset -225.0 # -(W-to-Z offset + Z-to-Table offset)
net w_axis_work_offset => joint_3_following_pos_cmd_calc.in0
net joint_3_pos_cmd joint_3_following_pos_cmd_calc.in1 <= joint.3.pos-cmd
net joint_3_following_pos_cmd_calc_out <= joint_3_following_pos_cmd_calc.out
# Limit where joint_3_pos_cmd can go (MIN/MAX limits from ini file)
setp joint_4_limit.min [JOINT_4]MIN_LIMIT
setp joint_4_limit.max [JOINT_4]MAX_LIMIT
net joint_3_following_pos_cmd_calc_out => joint_4_limit.in
net joint_3_following_pos_cmd_calc_out_limited <= joint_4_limit.out
# Convert joint_3_pos_cmd to joint_3_motor_pos_cmd
setp joint_3_following_motor_pos_cmd_calc.gain0 1.0
setp joint_3_following_motor_pos_cmd_calc.gain1 1.0
net joint_3_following_pos_cmd_calc_out_limited => joint_3_following_motor_pos_cmd_calc.in0
net joint_4_motor_offset joint_3_following_motor_pos_cmd_calc.in1 <= joint.4.motor-offset
net joint_3_following_motor_pos_cmd_calc_out <= joint_3_following_motor_pos_cmd_calc.out
# Feed the set work offset to NGC code during shoe extend
net w_axis_work_offset => motion.analog-in-00
net joint_4_motor_pos_cmd <= joint.4.motor-pos-cmd
net coolant-mist => joint_4_control_mux.sel
net joint_4_motor_pos_cmd => joint_4_control_mux.in0
net joint_3_following_motor_pos_cmd_calc_out => joint_4_control_mux.in1
net w-pos-cmd <= joint_4_control_mux.out
net w-vel-cmd <= joint.4.vel-cmd # Only used for debugging
net w-output => hm2_7i76e.0.stepgen.04.velocity-cmd
# Mux the feedback. Short it if the PID is not in control.
net w-pos-fb <= hm2_7i76e.0.stepgen.04.position-fb
net coolant-mist => joint_4_feedback_mux.sel
net w-pos-fb => joint_4_feedback_mux.in0
net joint_4_motor_pos_cmd => joint_4_feedback_mux.in1
net joint_4_motor_pos_fb joint_4_feedback_mux.out => joint.4.motor-pos-fb
Last edit: 31 Jan 2024 06:01 by finnstrom.
Please Log in or Create an account to join the conversation.
31 Jan 2024 06:23 #292049
by finnstrom
Replied by finnstrom on topic Dust Collection Shoe with independent Z control
Ok that didn't quite work. Turns out that when I was deactivating M7 (ie. M9) I was in juuuust the right spot for motor feedback to be in the right place.
I solved this the way Andy originally suggested; I have a three states:
I solved this the way Andy originally suggested; I have a three states:
- Not homed where all works as normal
- Homed and shoe active (feedback off and move shoe reverse of Z with offset)
- Homed and shoe not active (feedback still off and move shoe to W0)
# The position command is joint4 minus an offset to the surface, plus the height of the workpiece
setp joint_3_following_pos_cmd_calc.gain0 1.0
setp joint_3_following_pos_cmd_calc.gain1 -1.0
setp joint_3_following_pos_cmd_calc.offset -225.0 # -(W-to-Z offset + Z-to-Table offset)
net w_axis_work_offset => joint_3_following_pos_cmd_calc.in0
net joint_3_pos_cmd joint_3_following_pos_cmd_calc.in1 <= joint.3.pos-cmd
net joint_3_following_pos_cmd_calc_out <= joint_3_following_pos_cmd_calc.out
# Limit where joint_3_pos_cmd can go (MIN/MAX limits from ini file)
setp joint_4_limit.min [JOINT_4]MIN_LIMIT
setp joint_4_limit.max [JOINT_4]MAX_LIMIT
net joint_3_following_pos_cmd_calc_out => joint_4_limit.in
net joint_3_following_pos_cmd_calc_out_limited <= joint_4_limit.out
# Convert joint_3_pos_cmd to joint_3_motor_pos_cmd
setp joint_3_following_motor_pos_cmd_calc.gain0 1.0
setp joint_3_following_motor_pos_cmd_calc.gain1 1.0
net joint_3_following_pos_cmd_calc_out_limited => joint_3_following_motor_pos_cmd_calc.in0
net joint_4_motor_offset joint_3_following_motor_pos_cmd_calc.in1 <= joint.4.motor-offset
net joint_3_following_motor_pos_cmd_calc_out <= joint_3_following_motor_pos_cmd_calc.out
# Feed the set work offset to NGC code during shoe extend
net w_axis_work_offset => motion.analog-in-00
net joint_4_motor_pos_cmd <= joint.4.motor-pos-cmd
net coolant-mist => joint_4_control_mux.sel0
net joint_4_homed joint_4_control_mux.sel1 <= joint.4.homed
net joint_4_motor_pos_cmd => joint_4_control_mux.in0 # Shoe is off and we're not homed
net joint_4_motor_pos_cmd => joint_4_control_mux.in1 # Shoe is on but we're not homed
net joint_4_motor_offset => joint_4_control_mux.in2 # Shoe is off and we're homed, move to home (W0)
net joint_3_following_motor_pos_cmd_calc_out => joint_4_control_mux.in3 # Shoe is on and we're homed
net w-pos-cmd <= joint_4_control_mux.out
net w-vel-cmd <= joint.4.vel-cmd # Only used for debugging
net w-output => hm2_7i76e.0.stepgen.04.velocity-cmd
# Mux the feedback. Short it if the PID is not in control.
net w-pos-fb <= hm2_7i76e.0.stepgen.04.position-fb
# Short the feedback once we're homed.
net joint_4_homed => joint_4_feedback_mux.sel
net w-pos-fb => joint_4_feedback_mux.in0
net joint_4_motor_pos_cmd => joint_4_feedback_mux.in1
net joint_4_motor_pos_fb joint_4_feedback_mux.out => joint.4.motor-pos-fb
Please Log in or Create an account to join the conversation.
Time to create page: 0.058 seconds