[solved] Using motorless B-axis in HAL only
19 Apr 2020 11:54 - 19 Apr 2020 16:54 #164629
by Aciera
[solved] Using motorless B-axis in HAL only was created by Aciera
I'm working on a mill with a manual swivel head, an indexing b-axis without a motor. We use this with 5-axis xyzbc-kinematics to mill pockets at preset angles of the tool in reference to the table like in the image below but without the rotary table.
It's all working with the B-axis connected to a stepgen on a MESA 7i76e that does not have an actual motor connected to that particular output connector. I can command say G0 B30 and the DRO for the B-axis counts up to 30 and that is then used in the kinematic to calculate the movement of the X- and Z-axis.
So as it is the loop gets closed on the MESA board.
Now I would like to use that stepgen on the MESA board for another axis and have the b-axis working only in software.
I'm guessing I need to somehow provide the pid with a position feedback to get the DRO to function.
Does anybody have an idea if it is possible to close that loop in HAL and get the DRO to function?
It's all working with the B-axis connected to a stepgen on a MESA 7i76e that does not have an actual motor connected to that particular output connector. I can command say G0 B30 and the DRO for the B-axis counts up to 30 and that is then used in the kinematic to calculate the movement of the X- and Z-axis.
#*******************
# AXIS B
#*******************
setp pid.b.Pgain [JOINT_3]P
setp pid.b.Igain [JOINT_3]I
setp pid.b.Dgain [JOINT_3]D
setp pid.b.bias [JOINT_3]BIAS
setp pid.b.FF0 [JOINT_3]FF0
setp pid.b.FF1 [JOINT_3]FF1
setp pid.b.FF2 [JOINT_3]FF2
setp pid.b.deadband [JOINT_3]DEADBAND
setp pid.b.maxoutput [JOINT_3]MAX_OUTPUT
setp pid.b.error-previous-target true
setp pid.b.maxerror .0005
net b-index-enable <=> pid.b.index-enable
net b-enable => pid.b.enable
net b-pos-cmd => pid.b.command
net b-vel-cmd => pid.b.command-deriv
net b-pos-fb <= pid.b.feedback
net b-output => pid.b.output
# Step Gen signals/setup
setp hm2_7i76e.0.stepgen.04.dirsetup [JOINT_3]DIRSETUP
setp hm2_7i76e.0.stepgen.04.dirhold [JOINT_3]DIRHOLD
setp hm2_7i76e.0.stepgen.04.steplen [JOINT_3]STEPLEN
setp hm2_7i76e.0.stepgen.04.stepspace [JOINT_3]STEPSPACE
setp hm2_7i76e.0.stepgen.04.position-scale [JOINT_3]STEP_SCALE
setp hm2_7i76e.0.stepgen.04.step_type 0
setp hm2_7i76e.0.stepgen.04.control-type 1
setp hm2_7i76e.0.stepgen.04.maxaccel [JOINT_3]STEPGEN_MAXACCEL
setp hm2_7i76e.0.stepgen.04.maxvel [JOINT_3]STEPGEN_MAXVEL
# ---closedloop stepper signals---
net b-pos-cmd <= joint.3.motor-pos-cmd
net b-vel-cmd <= joint.3.vel-cmd
net b-output => hm2_7i76e.0.stepgen.04.velocity-cmd
net b-pos-fb <= hm2_7i76e.0.stepgen.04.position-fb
net b-pos-fb => joint.3.motor-pos-fb
net b-enable <= joint.3.amp-enable-out
net b-enable => hm2_7i76e.0.stepgen.04.enable
So as it is the loop gets closed on the MESA board.
Now I would like to use that stepgen on the MESA board for another axis and have the b-axis working only in software.
I'm guessing I need to somehow provide the pid with a position feedback to get the DRO to function.
Does anybody have an idea if it is possible to close that loop in HAL and get the DRO to function?
Last edit: 19 Apr 2020 16:54 by Aciera.
Please Log in or Create an account to join the conversation.
19 Apr 2020 12:01 - 19 Apr 2020 12:10 #164631
by bbsr_5a
Replied by bbsr_5a on topic Using motorless B-axis in HAL only
as you say manuel it is not a 5Axis Kinetics
just 3+2 as of Fusion360
so Just use Trivial kinetics as it cand move on Auto at all
a Post 5Axis will move all axis simultan like Powermill
and as you set 5axis kinetics it uses RTCP Rotating Tool Center Pos that the machine cand do
so you will be in real trouble if the joints are not there
YOU shoudt go for a 4AXIs only
use GEOMETRY XYZC and you are fine
you can try to HACK with a own component
LOOK at THCUD it hacks the Z axis
z_pos_out = z_pos_in;
z_fb_out = z_pos_in; // keep axis motor position fb from being confused
just feed the Component with your B Axis
just 3+2 as of Fusion360
so Just use Trivial kinetics as it cand move on Auto at all
a Post 5Axis will move all axis simultan like Powermill
and as you set 5axis kinetics it uses RTCP Rotating Tool Center Pos that the machine cand do
so you will be in real trouble if the joints are not there
YOU shoudt go for a 4AXIs only
use GEOMETRY XYZC and you are fine
you can try to HACK with a own component
LOOK at THCUD it hacks the Z axis
z_pos_out = z_pos_in;
z_fb_out = z_pos_in; // keep axis motor position fb from being confused
just feed the Component with your B Axis
Attachments:
Last edit: 19 Apr 2020 12:10 by bbsr_5a. Reason: false info
Please Log in or Create an account to join the conversation.
19 Apr 2020 12:15 - 19 Apr 2020 12:27 #164632
by Aciera
Replied by Aciera on topic Using motorless B-axis in HAL only
I know my setup is not 5 axis simultaneous but rather 3+1.
However using trivial kinematics does not work here. It would work if the table were tilted as in your example. Then the tool would be perpendicular to the x and y joint/axis and circular interpolation would be possible with trivial kinematics.
But since we are tilting the tool in reference to the joints of the x and y- axis the interpolation plane is tilted by the angle of the swivel head and movements in x require two joints as do movements in z.
But anyway that was just to illustrate what I'm working on. The question was if it is possible to close the stepper loop in HAL or software and thus free up the needed step generator on the MESA board.
However using trivial kinematics does not work here. It would work if the table were tilted as in your example. Then the tool would be perpendicular to the x and y joint/axis and circular interpolation would be possible with trivial kinematics.
But since we are tilting the tool in reference to the joints of the x and y- axis the interpolation plane is tilted by the angle of the swivel head and movements in x require two joints as do movements in z.
But anyway that was just to illustrate what I'm working on. The question was if it is possible to close the stepper loop in HAL or software and thus free up the needed step generator on the MESA board.
Last edit: 19 Apr 2020 12:27 by Aciera.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19209
- Thank you received: 6438
19 Apr 2020 12:44 #164635
by tommylight
Replied by tommylight on topic Using motorless B-axis in HAL only
This should work, you can set up a software stepgen with a base thread and use that for the axis that has not motor.
The following user(s) said Thank You: Aciera
Please Log in or Create an account to join the conversation.
19 Apr 2020 21:49 #164675
by PCW
Replied by PCW on topic [solved] Using motorless B-axis in HAL only
You do not need the PID or stepgen to get the DRO to function
if you are displaying actual positions, you just need to loop the
commanded position back to the feedback position for the B axis:
net b-pos-loopback <= joint.3.motor-pos-cmd => joint.3.motor-pos-fb
if you are displaying actual positions, you just need to loop the
commanded position back to the feedback position for the B axis:
net b-pos-loopback <= joint.3.motor-pos-cmd => joint.3.motor-pos-fb
The following user(s) said Thank You: Aciera
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19209
- Thank you received: 6438
19 Apr 2020 23:07 #164688
by tommylight
Thank you for confirming that.
Replied by tommylight on topic [solved] Using motorless B-axis in HAL only
I thought so but i was not sure, so i did not mention it.You do not need the PID or stepgen to get the DRO to function
if you are displaying actual positions, you just need to loop the
commanded position back to the feedback position for the B axis:
net b-pos-loopback <= joint.3.motor-pos-cmd => joint.3.motor-pos-fb
Thank you for confirming that.
Please Log in or Create an account to join the conversation.
28 Aug 2020 11:34 #179815
by andypugh
I have been meaning to do this for years. How is it working out?
It might be worth configuring the swivel head as a locking indexer. Then you could use a slightly-modified hal_manualtoolchange to pop up a dialog box to ask for a new angle, and then continue the G-code.
See the joint-unlock pins here: linuxcnc.org/docs/2.8/html/man/man9/axis.9.html which would be used a bit like tool-change / tool-changed
Replied by andypugh on topic [solved] Using motorless B-axis in HAL only
I'm working on a mill with a manual swivel head, an indexing b-axis without a motor.
I have been meaning to do this for years. How is it working out?
It might be worth configuring the swivel head as a locking indexer. Then you could use a slightly-modified hal_manualtoolchange to pop up a dialog box to ask for a new angle, and then continue the G-code.
See the joint-unlock pins here: linuxcnc.org/docs/2.8/html/man/man9/axis.9.html which would be used a bit like tool-change / tool-changed
Please Log in or Create an account to join the conversation.
Time to create page: 0.126 seconds