Hi Tom,
I have a milling machine with KFLOP and KANALOG, the front end is Mach3. All axes have servos and glass scales and are in closed loop. An additional probe (incremental glass ruler) is installed on the Z axis concentrically (as a ring) to the endmill, total stroke approx. 20 mm. The measured value from this probe is input to a free channel (6). The probe touches the milling surface a few millimeters before the endmill. If I make use of this probe in a dual loop, I can always achieve a consistent milling depth on uneven surfaces. But to raise the milling cutter and drive rapids, I would have to edit the G-code by hand and insert additional M-codes etc. I would like to avoid that.
The following idea:
1.) Z-axis is raised. The regular Z encoder is active.
2.) X and Y are in milling position, Z destination is a negative value, Z axis moves downwards until the additional Z probe touches the surface. The software recognizes that the surface has been reached because the additional Z encoder is now providing values. Automatic switching to dual loop, milling process with height control.
3.) If a positive Z value is received via G-code, dual loop is terminated, the loop is closed via the regular Z encoder, axis moves upwards.
Would that work? What query in the INI file would be necessary to recognize that the additional encoder has reached the surface in order to switch to dual loop? How can I detect positive Values for Z and change the loop-control with this condition?
Best regards Thomas
Switching loop control on certain conditions
Moderators: TomKerekes, dynomotion
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Switching loop control on certain conditions
Hi McScotty,
I can't think of an easy way to do that. KFLOP doesn't know the GCode Destinations. All it can monitor is the Z motion in real-time. Also GCode expects motions to be deterministic ahead of time, but the time to move down to make contact could vary, as well as back upto resume absolute height control.
The best I can think of is to make a tiny Z motion negative to enter relative following mode and then a tiny positive Z motion to return to absolute mode. GCode could command a dummy Z axis. KFLOP could monitor the dummy axis and if it detect downward motion it could Feedhold in order to pause the GCode while it lowers to make contact and so forth using the real motor axis. Then release the Feedhold when ready to follow the XY path. Something similar to raise and switch back to absolute mode.
Can't you change your CAD post processor to automatically add the required MCodes and such?
I can't think of an easy way to do that. KFLOP doesn't know the GCode Destinations. All it can monitor is the Z motion in real-time. Also GCode expects motions to be deterministic ahead of time, but the time to move down to make contact could vary, as well as back upto resume absolute height control.
The best I can think of is to make a tiny Z motion negative to enter relative following mode and then a tiny positive Z motion to return to absolute mode. GCode could command a dummy Z axis. KFLOP could monitor the dummy axis and if it detect downward motion it could Feedhold in order to pause the GCode while it lowers to make contact and so forth using the real motor axis. Then release the Feedhold when ready to follow the XY path. Something similar to raise and switch back to absolute mode.
Can't you change your CAD post processor to automatically add the required MCodes and such?
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Switching loop control on certain conditions
Hi Tom,
thanks for your advice. I understand why my idea wouldn't be a really good solution. I'll follow your advice and focus on postprocessors rather than a "tweak" that will probably end up causing problems. I was looking for a universal method because the follow mode for the Z axis would be needed for different applications and each application has its own postprocessor -Insulation milling of PCBs, foil cutting, plasma cutting. And then I still have to figure out how to make this work with the M-codes on the Mach3 side and with the KFLOP. Your advice was helpful, because at least I now know which direction I have to go and which one has a dead end.
Many thanks and regards
Thomas
thanks for your advice. I understand why my idea wouldn't be a really good solution. I'll follow your advice and focus on postprocessors rather than a "tweak" that will probably end up causing problems. I was looking for a universal method because the follow mode for the Z axis would be needed for different applications and each application has its own postprocessor -Insulation milling of PCBs, foil cutting, plasma cutting. And then I still have to figure out how to make this work with the M-codes on the Mach3 side and with the KFLOP. Your advice was helpful, because at least I now know which direction I have to go and which one has a dead end.
Many thanks and regards
Thomas