Please Help - How to Configure a 5 Axis Head-Head
- tommylight
- Away
- Moderator
Less
More
- Posts: 19188
- Thank you received: 6432
31 Jul 2023 14:51 #276638
by tommylight
Why?
Replied by tommylight on topic Please Help - How to Configure a 5 Axis Head-Head
Really?
I'm not sure this is correct for a 5 axis machine with custom kinematics. Aceria will know.Try to keep things simple
Stepgen.0 = joint.0
Stepgen.1 = joint.1
Makes editing much easier.
If you already have 5 axis set in hal and ini, changing from say C to W is easy, just ini file in Display, Traj, and AXIS W.
If you need to add another axis/joint, copy an existing one in hal and ini, add it to Display, Traj sections and paste and edit axis letter, joint number and stepgen number and joint number in hal.
Why?
The following user(s) said Thank You: IronManDylan
Please Log in or Create an account to join the conversation.
- IronManDylan
- Offline
- Premium Member
Less
More
- Posts: 115
- Thank you received: 19
31 Jul 2023 18:23 #276652
by IronManDylan
Replied by IronManDylan on topic Please Help - How to Configure a 5 Axis Head-Head
Aciera
Wow, thats really exciting! Thank you for doing that! I have provided some pictures to give you a better idea of how the machine moves, I can't upload a video.. Note: the axis are labeled how I initial designed the machine, not where the axis is for the bridgemill modification or where they are in the hal and ini files. You are right, given the inaccuracy of the machining, the axis are of course not perfectly aligned. But right now I do not have a good idea on how to measure how misaligned it is anyway so. I am sure there is a way if I think about it but for now was planning to make the assumption that the two axis are perfectly aligned.
I tried to compile the kins file using halcompile as you suggest and got the following error:
"sh: 1: make: not found"
I will also post my .ini and .hal files for where they stand right now. I haven't changed them at all but can delete W when I get you kins up and running!
Tommy
Idk either but it seems like ordering of the joints is important to how the kins files interpret the TCP, that was the case when Aciera initial helped me modify the vismach model.
Wow, thats really exciting! Thank you for doing that! I have provided some pictures to give you a better idea of how the machine moves, I can't upload a video.. Note: the axis are labeled how I initial designed the machine, not where the axis is for the bridgemill modification or where they are in the hal and ini files. You are right, given the inaccuracy of the machining, the axis are of course not perfectly aligned. But right now I do not have a good idea on how to measure how misaligned it is anyway so. I am sure there is a way if I think about it but for now was planning to make the assumption that the two axis are perfectly aligned.
I tried to compile the kins file using halcompile as you suggest and got the following error:
"sh: 1: make: not found"
I will also post my .ini and .hal files for where they stand right now. I haven't changed them at all but can delete W when I get you kins up and running!
Tommy
Idk either but it seems like ordering of the joints is important to how the kins files interpret the TCP, that was the case when Aciera initial helped me modify the vismach model.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
31 Jul 2023 18:40 #276653
by Aciera
$ sudo apt install build-essential
Replied by Aciera on topic Please Help - How to Configure a 5 Axis Head-Head
Run this in a terminal and try again:I tried to compile the kins file using halcompile as you suggest and got the following error:
"sh: 1: make: not found"
$ sudo apt install build-essential
The following user(s) said Thank You: IronManDylan
Please Log in or Create an account to join the conversation.
- IronManDylan
- Offline
- Premium Member
Less
More
- Posts: 115
- Thank you received: 19
31 Jul 2023 19:13 - 31 Jul 2023 19:19 #276654
by IronManDylan
Replied by IronManDylan on topic Please Help - How to Configure a 5 Axis Head-Head
That works! So awesome! Really excited to be able to use my machine how I intended to. Thanks so much! So is TCP spinning around some offset point (which would likely be the surface of the spindle?) and "tool" is spinning around the tip of the tool? Also, I ran the gcode, everything looks good on vismach, but the preview is doing something weird. It goes to the tool path for the positioning moves, but then jumps way off the toolpath for the cutting moves. Kinda weird, not sure what this gcode is supposed to do but thought I would point that out.
Also, I was going to ask about this at some point, but I cannot see the bottom of axis gui on my laptop. And I can't even seem to drag the screen up. Going to full screen does nothing. Right now I cannot see all of your "C Rotation Axis Offset" window. Is there a good way to fix this?
Lastly, I tried launching that configuration from my last post to see if it works and would move the axis around and I got the error that I posted a picture of. Note: I copied and pasted all the code from 'hackbot.hal' to 'test2.hal'. This is because I was using Visual Studio Code on my main computer to edit the files and I had changed the name to hackbot there.
Also, I was going to ask about this at some point, but I cannot see the bottom of axis gui on my laptop. And I can't even seem to drag the screen up. Going to full screen does nothing. Right now I cannot see all of your "C Rotation Axis Offset" window. Is there a good way to fix this?
Lastly, I tried launching that configuration from my last post to see if it works and would move the axis around and I got the error that I posted a picture of. Note: I copied and pasted all the code from 'hackbot.hal' to 'test2.hal'. This is because I was using Visual Studio Code on my main computer to edit the files and I had changed the name to hackbot there.
Last edit: 31 Jul 2023 19:19 by IronManDylan.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19188
- Thank you received: 6432
31 Jul 2023 19:39 #276655
by tommylight
I said to keep things simple, first editing the ini file, then hal file then kinematics file would be my choice as it is the order of loading in LinuxCNC. Makes it easier to follow everything.
But i did not mention kinematics on purpose as Aciera knows a lot more about it than i do.
Replied by tommylight on topic Please Help - How to Configure a 5 Axis Head-Head
Of course it is, but still does not make my info incorrect in any way.Tommy
Idk either but it seems like ordering of the joints is important to how the kins files interpret the TCP, ..
I said to keep things simple, first editing the ini file, then hal file then kinematics file would be my choice as it is the order of loading in LinuxCNC. Makes it easier to follow everything.
But i did not mention kinematics on purpose as Aciera knows a lot more about it than i do.
The following user(s) said Thank You: IronManDylan
Please Log in or Create an account to join the conversation.
- IronManDylan
- Offline
- Premium Member
Less
More
- Posts: 115
- Thank you received: 19
31 Jul 2023 19:54 - 31 Jul 2023 19:57 #276657
by IronManDylan
Replied by IronManDylan on topic Please Help - How to Configure a 5 Axis Head-Head
Tommy
Yeah that's what I am trying to do with my files right now. Just get the machine moving. But I am getting that interesting error. I have my kins file set to 5axiskins because I was afraid trivkins would throw up an error for having too many axis. But that is all I've done to the kinematics. The test file from pncconf will move 4 of my axis but when I tried modifying that file to move all 6 I got said error.
edit: btw I searched though my file for ' ' and couldn't find that anywhere, so kind of weird.
Yeah that's what I am trying to do with my files right now. Just get the machine moving. But I am getting that interesting error. I have my kins file set to 5axiskins because I was afraid trivkins would throw up an error for having too many axis. But that is all I've done to the kinematics. The test file from pncconf will move 4 of my axis but when I tried modifying that file to move all 6 I got said error.
edit: btw I searched though my file for ' ' and couldn't find that anywhere, so kind of weird.
Last edit: 31 Jul 2023 19:57 by IronManDylan.
Please Log in or Create an account to join the conversation.
31 Jul 2023 19:55 #276658
by Aciera
Replied by Aciera on topic Please Help - How to Configure a 5 Axis Head-Head
TCP kinematics keeps the tooltip on the same position on the workpiece while the tool is being reoriented (ie while the rotary axes A and B move). This is basically the same as the 'bridgemill' mode in the bridgemill config.
TOOL kinematics let's you position (move) the tool in the current tool orientation. The demo gcode shows how you can mill a circular pocket in any tool orientation using regular gcode written for a 3 axis mill. This is somewhat similar to the virtual W axis in the bridgemill mode but much better because it tilts the XY workplane to be perpendicular to the tool rotational axis.
Note that it is best NOT to move A or B rotary axes while in Tool kinematics because the rotational center in this mode remains in the machine reference point which can make the effects of such rotations rather surprising to the machine operator.
The preview window is of limited use when using these kinematics because the current work offset is transformed when switching from tcp to tool kinematics (hence why the moves in tool kinematics are done in relative mode).
The screen issue is likely because the custom panel in axis is too long and forces the axis window to extend past the bottom of your screen.
Also the 'C Rotation Axis Offset' is a remnant of the original config I modified this one from and I will remove that tomorrow and post an update that will hopefully also fix the issue of the window not fitting on the screen.
TOOL kinematics let's you position (move) the tool in the current tool orientation. The demo gcode shows how you can mill a circular pocket in any tool orientation using regular gcode written for a 3 axis mill. This is somewhat similar to the virtual W axis in the bridgemill mode but much better because it tilts the XY workplane to be perpendicular to the tool rotational axis.
Note that it is best NOT to move A or B rotary axes while in Tool kinematics because the rotational center in this mode remains in the machine reference point which can make the effects of such rotations rather surprising to the machine operator.
The preview window is of limited use when using these kinematics because the current work offset is transformed when switching from tcp to tool kinematics (hence why the moves in tool kinematics are done in relative mode).
The screen issue is likely because the custom panel in axis is too long and forces the axis window to extend past the bottom of your screen.
Also the 'C Rotation Axis Offset' is a remnant of the original config I modified this one from and I will remove that tomorrow and post an update that will hopefully also fix the issue of the window not fitting on the screen.
Please Log in or Create an account to join the conversation.
31 Jul 2023 20:14 #276659
by Aciera
Replied by Aciera on topic Please Help - How to Configure a 5 Axis Head-Head
Some comments on HAL connections for this. You will want to set up an A axis (which should work using pncconf). It will look something like you already had for B axis:
Now to create the B axis you will need to modify more than just the title. You also need to change the signal names and the pins (ie change the 'a' to 'b' and the joint number from 'joint.3' to 'joint.4'). I don't have time to do all the lines but I indicated a how to change on a few of them. So continue as inicated:
#*******************
# AXIS B JOINT 4
#*******************
#
should be changed like this:
setp pid.b.Pgain [JOINT_4]P
setp pid.b.Igain [JOINT_4]I
setp pid.b.Dgain [JOINT_4]D
setp pid.b.bias [JOINT_4]BIAS
# change the lines below in the same manner
setp pid.a.FF0 [JOINT_3]FF0
setp pid.a.FF1 [JOINT_3]FF1
setp pid.a.FF2 [JOINT_3]FF2
setp pid.a.deadband [JOINT_3]DEADBAND
setp pid.a.maxoutput [JOINT_3]MAX_OUTPUT
setp pid.a.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp pid.a.maxerror 0.000500
net a-index-enable => pid.a.index-enable
net a-enable => pid.a.enable
net a-pos-cmd => pid.a.command
net a-pos-fb => pid.a.feedback
net a-output <= pid.a.output
# Step Gen signals/setup
#
should be changed like this
setp hm2_7i96s.0.stepgen.04.dirsetup [JOINT_4]DIRSETUP
setp hm2_7i96s.0.stepgen.04.dirhold [JOINT_4]DIRHOLD
# continue as above
setp hm2_7i96s.0.stepgen.03.steplen [JOINT_3]STEPLEN
setp hm2_7i96s.0.stepgen.03.stepspace [JOINT_3]STEPSPACE
setp hm2_7i96s.0.stepgen.03.position-scale [JOINT_3]STEP_SCALE
setp hm2_7i96s.0.stepgen.03.step_type 0
setp hm2_7i96s.0.stepgen.03.control-type 1
setp hm2_7i96s.0.stepgen.03.maxaccel [JOINT_3]STEPGEN_MAXACCEL
setp hm2_7i96s.0.stepgen.03.maxvel [JOINT_3]STEPGEN_MAXVEL
# ---closedloop stepper signals---
net a-pos-cmd <= joint.3.motor-pos-cmd
net a-vel-cmd <= joint.3.vel-cmd
net a-output => hm2_7i96s.0.stepgen.03.velocity-cmd
net a-pos-fb <= hm2_7i96s.0.stepgen.03.position-fb
net a-pos-fb => joint.3.motor-pos-fb
net a-enable <= joint.3.amp-enable-out
net a-enable => hm2_7i96s.0.stepgen.08.enable
# ---setup home / limit switch signals---
net a-home-sw => joint.3.home-sw-in
net a-neg-limit => joint.3.neg-lim-sw-in
net a-pos-limit => joint.3.pos-lim-sw-in
Don't start to copy/paste stuff in willy nilly from other hal files or you are going to LOOSE YOUR MIND!!
Hope that helps for now.
Warning: Spoiler!
#*******************
# AXIS A JOINT 3
#*******************
setp pid.a.Pgain [JOINT_3]P
setp pid.a.Igain [JOINT_3]I
setp pid.a.Dgain [JOINT_3]D
setp pid.a.bias [JOINT_3]BIAS
setp pid.a.FF0 [JOINT_3]FF0
setp pid.a.FF1 [JOINT_3]FF1
setp pid.a.FF2 [JOINT_3]FF2
setp pid.a.deadband [JOINT_3]DEADBAND
setp pid.a.maxoutput [JOINT_3]MAX_OUTPUT
setp pid.a.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp pid.a.maxerror 0.000500
net a-index-enable => pid.a.index-enable
net a-enable => pid.a.enable
net a-pos-cmd => pid.a.command
net a-pos-fb => pid.a.feedback
net a-output <= pid.a.output
# Step Gen signals/setup
setp hm2_7i96s.0.stepgen.03.dirsetup [JOINT_3]DIRSETUP
setp hm2_7i96s.0.stepgen.03.dirhold [JOINT_3]DIRHOLD
setp hm2_7i96s.0.stepgen.03.steplen [JOINT_3]STEPLEN
setp hm2_7i96s.0.stepgen.03.stepspace [JOINT_3]STEPSPACE
setp hm2_7i96s.0.stepgen.03.position-scale [JOINT_3]STEP_SCALE
setp hm2_7i96s.0.stepgen.03.step_type 0
setp hm2_7i96s.0.stepgen.03.control-type 1
setp hm2_7i96s.0.stepgen.03.maxaccel [JOINT_3]STEPGEN_MAXACCEL
setp hm2_7i96s.0.stepgen.03.maxvel [JOINT_3]STEPGEN_MAXVEL
# ---closedloop stepper signals---
net a-pos-cmd <= joint.3.motor-pos-cmd
net a-vel-cmd <= joint.3.vel-cmd
net a-output => hm2_7i96s.0.stepgen.03.velocity-cmd
net a-pos-fb <= hm2_7i96s.0.stepgen.03.position-fb
net a-pos-fb => joint.3.motor-pos-fb
net a-enable <= joint.3.amp-enable-out
net a-enable => hm2_7i96s.0.stepgen.08.enable
# ---setup home / limit switch signals---
net a-home-sw => joint.3.home-sw-in
net a-neg-limit => joint.3.neg-lim-sw-in
net a-pos-limit => joint.3.pos-lim-sw-in
# AXIS A JOINT 3
#*******************
setp pid.a.Pgain [JOINT_3]P
setp pid.a.Igain [JOINT_3]I
setp pid.a.Dgain [JOINT_3]D
setp pid.a.bias [JOINT_3]BIAS
setp pid.a.FF0 [JOINT_3]FF0
setp pid.a.FF1 [JOINT_3]FF1
setp pid.a.FF2 [JOINT_3]FF2
setp pid.a.deadband [JOINT_3]DEADBAND
setp pid.a.maxoutput [JOINT_3]MAX_OUTPUT
setp pid.a.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp pid.a.maxerror 0.000500
net a-index-enable => pid.a.index-enable
net a-enable => pid.a.enable
net a-pos-cmd => pid.a.command
net a-pos-fb => pid.a.feedback
net a-output <= pid.a.output
# Step Gen signals/setup
setp hm2_7i96s.0.stepgen.03.dirsetup [JOINT_3]DIRSETUP
setp hm2_7i96s.0.stepgen.03.dirhold [JOINT_3]DIRHOLD
setp hm2_7i96s.0.stepgen.03.steplen [JOINT_3]STEPLEN
setp hm2_7i96s.0.stepgen.03.stepspace [JOINT_3]STEPSPACE
setp hm2_7i96s.0.stepgen.03.position-scale [JOINT_3]STEP_SCALE
setp hm2_7i96s.0.stepgen.03.step_type 0
setp hm2_7i96s.0.stepgen.03.control-type 1
setp hm2_7i96s.0.stepgen.03.maxaccel [JOINT_3]STEPGEN_MAXACCEL
setp hm2_7i96s.0.stepgen.03.maxvel [JOINT_3]STEPGEN_MAXVEL
# ---closedloop stepper signals---
net a-pos-cmd <= joint.3.motor-pos-cmd
net a-vel-cmd <= joint.3.vel-cmd
net a-output => hm2_7i96s.0.stepgen.03.velocity-cmd
net a-pos-fb <= hm2_7i96s.0.stepgen.03.position-fb
net a-pos-fb => joint.3.motor-pos-fb
net a-enable <= joint.3.amp-enable-out
net a-enable => hm2_7i96s.0.stepgen.08.enable
# ---setup home / limit switch signals---
net a-home-sw => joint.3.home-sw-in
net a-neg-limit => joint.3.neg-lim-sw-in
net a-pos-limit => joint.3.pos-lim-sw-in
Now to create the B axis you will need to modify more than just the title. You also need to change the signal names and the pins (ie change the 'a' to 'b' and the joint number from 'joint.3' to 'joint.4'). I don't have time to do all the lines but I indicated a how to change on a few of them. So continue as inicated:
Warning: Spoiler!
#*******************
# AXIS B JOINT 4
#*******************
#
should be changed like this:
setp pid.b.Pgain [JOINT_4]P
setp pid.b.Igain [JOINT_4]I
setp pid.b.Dgain [JOINT_4]D
setp pid.b.bias [JOINT_4]BIAS
# change the lines below in the same manner
setp pid.a.FF0 [JOINT_3]FF0
setp pid.a.FF1 [JOINT_3]FF1
setp pid.a.FF2 [JOINT_3]FF2
setp pid.a.deadband [JOINT_3]DEADBAND
setp pid.a.maxoutput [JOINT_3]MAX_OUTPUT
setp pid.a.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp pid.a.maxerror 0.000500
net a-index-enable => pid.a.index-enable
net a-enable => pid.a.enable
net a-pos-cmd => pid.a.command
net a-pos-fb => pid.a.feedback
net a-output <= pid.a.output
# Step Gen signals/setup
#
should be changed like this
setp hm2_7i96s.0.stepgen.04.dirsetup [JOINT_4]DIRSETUP
setp hm2_7i96s.0.stepgen.04.dirhold [JOINT_4]DIRHOLD
# continue as above
setp hm2_7i96s.0.stepgen.03.steplen [JOINT_3]STEPLEN
setp hm2_7i96s.0.stepgen.03.stepspace [JOINT_3]STEPSPACE
setp hm2_7i96s.0.stepgen.03.position-scale [JOINT_3]STEP_SCALE
setp hm2_7i96s.0.stepgen.03.step_type 0
setp hm2_7i96s.0.stepgen.03.control-type 1
setp hm2_7i96s.0.stepgen.03.maxaccel [JOINT_3]STEPGEN_MAXACCEL
setp hm2_7i96s.0.stepgen.03.maxvel [JOINT_3]STEPGEN_MAXVEL
# ---closedloop stepper signals---
net a-pos-cmd <= joint.3.motor-pos-cmd
net a-vel-cmd <= joint.3.vel-cmd
net a-output => hm2_7i96s.0.stepgen.03.velocity-cmd
net a-pos-fb <= hm2_7i96s.0.stepgen.03.position-fb
net a-pos-fb => joint.3.motor-pos-fb
net a-enable <= joint.3.amp-enable-out
net a-enable => hm2_7i96s.0.stepgen.08.enable
# ---setup home / limit switch signals---
net a-home-sw => joint.3.home-sw-in
net a-neg-limit => joint.3.neg-lim-sw-in
net a-pos-limit => joint.3.pos-lim-sw-in
Don't start to copy/paste stuff in willy nilly from other hal files or you are going to LOOSE YOUR MIND!!
Hope that helps for now.
Please Log in or Create an account to join the conversation.
- IronManDylan
- Offline
- Premium Member
Less
More
- Posts: 115
- Thank you received: 19
31 Jul 2023 20:21 #276660
by IronManDylan
Replied by IronManDylan on topic Please Help - How to Configure a 5 Axis Head-Head
Aciera
Ahhh I see about TOOL now, I was confused because I was moving the rotary axis in that mode. So it is like what W was doing but way better because it allows all the linear axis. That's too cool haha. Now I am curious, so it looks like you added a few lines to the 3 axis gcode to a) kick the head over to whatever angle you had the head set to and b) switch the machine from TCP to TOOL mode? Guessing here because I can't view the gcode. The switching modes seems to explain some of what is going on with the preview be a little weird. Makes sense with the work offset being changed.
Yeah, the panel is too long. But this has been the case with every configuration I have opened. Some of each of them have been chopped of at the bottom. I really have not been able to view the gcode that is being sent to the machine because this interface is what is being obscured.
Awesome thanks for posting an update. Really appreciate your help.
Ahhh I see about TOOL now, I was confused because I was moving the rotary axis in that mode. So it is like what W was doing but way better because it allows all the linear axis. That's too cool haha. Now I am curious, so it looks like you added a few lines to the 3 axis gcode to a) kick the head over to whatever angle you had the head set to and b) switch the machine from TCP to TOOL mode? Guessing here because I can't view the gcode. The switching modes seems to explain some of what is going on with the preview be a little weird. Makes sense with the work offset being changed.
Yeah, the panel is too long. But this has been the case with every configuration I have opened. Some of each of them have been chopped of at the bottom. I really have not been able to view the gcode that is being sent to the machine because this interface is what is being obscured.
Awesome thanks for posting an update. Really appreciate your help.
Please Log in or Create an account to join the conversation.
31 Jul 2023 20:35 #276662
by Aciera
Replied by Aciera on topic Please Help - How to Configure a 5 Axis Head-Head
Yes, you got it.
The next step would be to implement 'tilted work plane' functionality which gives the operator a set of GCodes to define the orientation of the xy plane and the controller then orients the tool automatically. I made an experimental sim config using a rotating-nutating head which kind of worked as a proof of concept but would still need a lot of work.
'demo.ngc' gcode is located in the 'demos' folder of the sim config.
What resolution is your screen?
The next step would be to implement 'tilted work plane' functionality which gives the operator a set of GCodes to define the orientation of the xy plane and the controller then orients the tool automatically. I made an experimental sim config using a rotating-nutating head which kind of worked as a proof of concept but would still need a lot of work.
'demo.ngc' gcode is located in the 'demos' folder of the sim config.
What resolution is your screen?
Please Log in or Create an account to join the conversation.
Time to create page: 0.097 seconds