5-axis CNC/FDM: Tool vs Machine Coordinates (Inverse Kinematics)
-
I post this piece in CNC section, as it deals with 5-axis setup but with FDM in mind.
Issue
I have a simple 5-axis FDM setup, 3-axis X,Y,Z plus Z-rotation and tilt of the FDM nozzle; and due to the actual setup I need to do an inverse kinematic (IK) calculation. I can add this IK to the firmware of Duet itself, but I also can post-process G-code from tool coordinates to machine coordinates (I just did this as an experiment).
Advantages:
- no change in firmware (no recompiling)
- simple profiling (change setup needs no change in firmware required), each setup/machine has its own profile (a JSON file describing the inv kinematics)
- simple calibration of actual (physical) offsets and angles
Disadvantages:
- machine dependent G-code
- another step to convert G-code
- risk of doing stupid things (e.g. running tool into the bed) as firmware doesn't prevent it
To any experienced CNC machinist and multi-axis wizard, what are your thoughts? I don't know how CNC industry in general deals tool vs machine coords/g-code, and I like to get to know some good practices. Thanks.
If you like to see the actual setup https://xyzdims.com/2021/02/08/3d-printing-penta-axis-pax-5-axis-printing-option/ (work in progress)
-
@xyzdims impressive progress! From what I understand, 5 axis machining is mostly a slicing/tool path generation problem, and the firmware doesn’t resolve the input coordinates; it just goes where the Gcode tells it to. So it’s slicing where the heavy lifting happens. But I haven’t played around with it, and I’m not a programmer.
As for tools to generate 5-axis Gcode, Fusion 360 has it built in I think, but it’s only available for paid-for versions, and is limited to machining rather than 3D printing afaik. I’m sure there are other professional tools on the CNC side, but haven’t looked recently. 5 axis 3D printing seems very much in its infancy!
Ian
-
long time lurker here i have 2 duet 2's. one printer other is on small router im building. im also cnc machinist/programmer for 20 yrs. Mastercam, Featurecam, Powermill and WorkNC. 9 axis lathe w live toolng part transfer mill horiz and vert. lately doing lights out programming on 3 spindle horizontal mill cell with a thousand tool magazine.
F360 is based on the powermill/ feature cam engine but i dont use F360 i have a seat of featurecam i got from doing beta testing years ago. and im making my own post proccessor.
in 5 axis world it comes down to does the workpiece tilt or does the head tilt. the simplest solution is fixed spindle and a roll tilt trunion(yaw) holding workpiece. xyzab(c) sometimes axes. this is what most of my experience is on.
if the head tilts it ges interesting cause you have to know the length of the tool sticking out so you can figure out the cosign of the tool tip. most machines use something called tool tip comp(TCRP) where the controll uses the gage length and figures out for you behind the scenes where it should be. this magic number comes from a very expensive tool setter or a tool setter in the machine itself.
would start with 5 axis positioning establish a WCS from there and use 3 axis code you will be able to do most things his way from a cnc point of view. if you want to use a 4th axis to engrave a cylinder use axis substitution ad wrap the x or y around the a or b.
the biggest hurdle is lack of cutter comp G40 G41 G42.
your going to have t cough up big money for 5 axis cam software and having a good post processor. but most 3 axis freemiums will let you tilt the part establish a wcs and make 3 axis code
then there is programming in euler angles...... but thats a different story
-
@Miss-Rebekah @droftarts thanks for the feedback.
I realize in CNC world the CAM software does the heavy lifting, whereas with 5-axis FDM in its infancy I'm currently bootstrap all myself: planar/non-planar slicing (works) and now I reach the decision whether to implement inverse kinemantic (tooltip coord vs machine coord) in the firmware or leave to the post-processor (prototype exists already).
I might end up doing both approaches and then see which one is more usable in real life.
-
@droftarts said in 5-axis CNC/FDM: Tool vs Machine Coordinates (Inverse Kinematics):
@xyzdims impressive progress! From what I understand, 5 axis machining is mostly a slicing/tool path generation problem, and the firmware doesn’t resolve the input coordinates; it just goes where the Gcode tells it to. So it’s slicing where the heavy lifting happens. But I haven’t played around with it, and I’m not a programmer.
As for tools to generate 5-axis Gcode, Fusion 360 has it built in I think, but it’s only available for paid-for versions, and is limited to machining rather than 3D printing afaik. I’m sure there are other professional tools on the CNC side, but haven’t looked recently. 5 axis 3D printing seems very much in its infancy!
Ian
Its completely the opposite. Most industrial machines do the kinematics on the controller itself. The gcode is tool center point data and you use a specific g code to turn inverse kinematics on and off. They can also jog in these coordinate systems and have dynamic work offsets where the program origin can be anywhere on the part. This also means programs are machine agnostic. Mostly.
The biggest obstacle for 5 axis printing is Indeed the slicing side. There’s currently vety little information and research in 5 axis slicing algorithms. Its much more complex than 3 axis. We even havent made any progress on non-planar slicing.
-
@roiki11 You might look at my blog post https://xyzdims.com/2021/04/19/3d-printing-sub-volume-segmenting-non-planar-slicing/ regarding 4- and 5-axis FDM and non-planar slicing.
-
@xyzdims said in 5-axis CNC/FDM: Tool vs Machine Coordinates (Inverse Kinematics):
@roiki11 You might look at my blog post https://xyzdims.com/2021/04/19/3d-printing-sub-volume-segmenting-non-planar-slicing/ regarding 4- and 5-axis FDM and non-planar slicing.
I have seen it, It’s good work.
-
@xyzdims I read a bit in your blogs and wanted to add the possibility to tilt the bed instead of the nozzle. The kinematics should be similar (or same), the bed being tilted by two actuators. The advantage to tilt the bed is, you can print overhangs even better, because the nozzle print direction can be oriented to be vertical always. The bed should be small, so it is not in the way.
-
@joergs5 I'm aware of head/head vs head/bed vs bed/bed 3 + 2-axis combination, I even mentioned in the article on PAX printhead: https://xyzdims.com/2021/02/08/3d-printing-penta-axis-pax-5-axis-printing-option/#Taking_Advantage_of_5_Axis and also in the References of the same article I list Epit3D Delta with rotating & tilting bed doing that - I might later explore the head/bed or bed/bed option too for tilt/rotation, but I first want to study the head/head tilt/rotation option thoroughly to really study the edge cases and feasibility overall.
-
@xyzdims said in 5-axis CNC/FDM: Tool vs Machine Coordinates (Inverse Kinematics):
I even mentioned in the article
which is the prove that I read it only "a bit" Anyway, I think your work is very valuable
-
@xyzdims Got any answers to this "inverse kinematics" query ? I have a similar situation, for which Iam trying to get fusion to work:
4 axis machining with tilting milling head
I want to do 4-axis machining.
But I have a tilting milling head ( not a rotary table).
My tool tip is 100mm away from the pivot axis of the tilt head.
So I believe some forward/inverse kinematics has to be done to get the XY position of the pivot point, given the tool tip point.
( some basic Rcos(theta), Rsin(theta) calculation etc. for 4-axis )Will fusion do this automatically and output gcode ?
How to achieve this ?I tried giving : offset:[100,0,0] in :
var aAxis = createAxis({coordinate:0, table:false, axis:[1, 0, 0],offset:[100,0,0], cyclic:true, preference:0});
machineConfiguration = new MachineConfiguration(aAxis);setMachineConfiguration(machineConfiguration);
optimizeMachineAngles2(1); // map tip modeBut this is simply doing a "translational offset " in X axis !
Is there any other setting I need to do for this ?
-
@ecncshop xyzdims may be busy, please let me answer some of your questions.
I am currently developing robot kinematics, which will cover your use case. Your tilting 4th rotary axis is not as simple as it seems:
when the axis rotates, it changes XYZ as well, especially if this rotation is segmented by the firmware into small linear movements. While rotating, every segment must be recalculated and the XYZ positions must be recalculated. This is sometimes named RTCP (rotation tool center point).
An example is https://infosys.beckhoff.com/index.php?content=../content/1031/tccncprogramming/html/rotationtoolcenterpointrtcp.htm&id=When robot kinematics is ready, you may want to consider to use it. Documentation starting point is https://docs.duet3d.com/User_manual/Machine_configuration/Configuring_RepRapFirmware_for_a_Robot_printer
I will test it with table configurations, but head configurations are possible.
-
@JoergS5 hmm .. ok. Does that mean fusion 360 does not have this option to calculate the RTCP and output gcode ?! I do have the Fusion360 "machining extension" for multi-axis machining activated.
For 4-axis, the calculation is not so complicated: Rcos, Rsin will do I think. Hope this should be available in Fusion360 machining extension! My eventual plan is to rotate the job for A-xis and tilt the head for B-axis, to get a full 5-axis machining capability. -
@ecncshop said in 5-axis CNC/FDM: Tool vs Machine Coordinates (Inverse Kinematics):
Does that mean fusion 360 does not have this option to calculate the RTCP and output gcode
I didn't know that there is a "machine extension" in Fusion and that you're using it. Maybe it can support RTCP mode, it looks like a powerful extension.