I've set about writing a macro for Mach4 that will take 5 axis Gcode, interpret it and return Gcode that Mach4 can read. The intent is for there to be an M11 call on every line of the 5 axis Gcode program and the custom macro will translate the line that it's currently on, there's a number of advantages to this that I won't bore you with now.
The problem is that I've recently learned that Mach has a 500ms delay before executing an M code. That means every 1mm or less my machine will pause and start as it delays for the M code, this is completely unacceptable. Will writing a plugin be a better solution? If so, where do I start with that? There's not much documentation that I can find, but there's obviously people writing them for their motion controllers, can anyone shed some light on how I'd get started writing a plug in?
Just to make myself seem more credible - I've already written a complete working 5 axis Gcode interpreter and machine simulator in Blender (the 3D modelling program), but that's in Blender and written in Python. I just need to translate the logic to work with Mach4 (or Mach3 if absolutely necessary).
That's excellent. I've decided to write a Wizard for Mach4 that does exactly the same as that Mach3 plugin, but Mach3FiveAxis will certainly be a plan B. I'm still trying to wrap my head around whether Mach3FiveAxis will work with my rotating BC head configuration, I think it would work pretty much the same as far as maths and how it compensates for rotation.
Hi ChristianLL,
I saw your 5 Axis CNC Plastic Cutting Router, great job
If you want use it with my plugin, it is completely possible, i have just to add a additional configuration. The problem will be rather for the simulator, a new algorithm for the removal of material although the principle remains the same. I'll have a little cogitating
Meanwhile i think you can test the plugin with your machine just inverting the X axis with the Y axis, and the Y axis with the X axis in your mach3 ports and pins configuration and activate the right direction for all your axis. Then you have to find her RTCP, probe the workpiece origin and test some moves with the command "SPS..", see the tutorial for that.
I can't help you more because because i don't have B/C head machine, but i await your test.
I'll be sure to test it out and report back to you when I get the rotary head built and operational. Right now I've just got the bearings and harmonic drive units sitting around.
In fact, it was not so easy as that, but since the last time i worked on it and here is the first videos.
a plugin for 5 axis B/C head doughty drive type:
Sorry for the delayed reply, I wasn't aware you'd posted anything more.
That looks really awesome! I love the possibility of having a 3D simulation on screen! I have designed my control panel to work with a portrait display orientation and an optimised Mach4 screen layout for touchscreen, so I'll be trying to stick with that if I can. I'm still working on my Gcode interpreter and Mach4 has a problem with the mc.mcCntlGetGcodeLine() function that I'm waiting for Artsoft to fix. I'm also not putting it in a wizard anymore, I'm going to make it a simple process of:
> Import 5 axis Gcode with I, J, K vector values
> Insert tool and set tool length
> Click a button called "RTCP" on the Program Run screen to translate Gcode
> Register part zero location
> Click Cycle Start
I like the this idea a lot because it's well integrated into Mach4 and it's easy. One click and the program is ready again. Even if you have to change tools mid-program, just click the RTCP button and it will adjust the tool length compensation for the entire program for the new tool.
I would also like to continue with my original idea of having a custom macro that applies RTCP compensation for when I'm working in MDI mode.
I would like to ask you one question - does Mach3FiveAxis have an unwind feature to stop the wires of the BC head getting twisted too far? I'm trying to figure out how to program it, I have an idea in mind, but it's proving to be difficult to implement.
Doesn't Mach4 have ability to use kinematics which takes care for TCP in real time (for 5axis)?
I use Lcnc on my 5-axis (BC head) and everything is solved with kinematcs module, I don't have automatic tool changer, but I use tool length sensor, so every time I change tool, it automatically measure its length which is then compensated real time, big advantage as I can use multiple tools in same g-code!