CNC Machine with built in radius compensation

Here's the place for discussion related to CAM/CNC and the development of the Path module.
thomas-huber
Posts: 13
Joined: Wed Jan 26, 2022 4:02 pm
Location: Oberneukirchen, Bavaria

CNC Machine with built in radius compensation

Post by thomas-huber »

Hello Everyone,

I'm working on a postprocessor for our SCM Record 110 (xilog based) maschine. This maschine does not read g-code, but it's own type of instruction which is inpired by g-code but more advanced.

One of it's features is a built in radius compensation. Meaning codes have a parameter R that controls the compensation (it can be set to right and center.)

This has the advantage that maschine-programmes adapt to changes of tool diameteres. After tool sharping we don't have to recreate or programmes but only change the diameter in the maschines config.

So it would be nice if our PostProcessor would produce maschine code that has not radius compensation but leave it to the maschine.
But inside FreeCAD we want radius compensation active to see correct results in the simulation and design process.

In order to do this I would need the path inside the post processor but without any compensation. Something like this:
was_compensated = path.radius_compensation
path.radius_compensation = false
//do my things
path.radius_compensation = was_compensated
I don't need a complete solution, but some hints would help me alot. Thanks!

Best
Thomas
herbk
Veteran
Posts: 2426
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: CNC Maschine with built in radius compensation

Post by herbk »

Hi Thomas,
you can create a path, which is not compensated, just uncheck "use compensation" at the operation settings.
At least at LinuxCNC postprozessor it works like expected for me.
Gruß Herbert
thomas-huber
Posts: 13
Joined: Wed Jan 26, 2022 4:02 pm
Location: Oberneukirchen, Bavaria

Re: CNC Maschine with built in radius compensation

Post by thomas-huber »

Hi Herbert,
yes, but that's not quite what I want. During design I want compensation to be active zu see how the path will look like and to have a proper simulation. Only the code for the maschine should have no compensation.

For sure, i could uncheck before postprocessing and than check again. But with many operations it becomes unhandy and error prone. Also some profiles could be intended to be without compensation (in FreeCAD and maschine code)
User avatar
sliptonic
Veteran
Posts: 2947
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: CNC Maschine with built in radius compensation

Post by sliptonic »

thomas-huber wrote: Wed May 04, 2022 2:01 pm Hi Herbert,
yes, but that's not quite what I want. During design I want compensation to be active zu see how the path will look like and to have a proper simulation. Only the code for the maschine should have no compensation.

For sure, i could uncheck before postprocessing and than check again. But with many operations it becomes unhandy and error prone. Also some profiles could be intended to be without compensation (in FreeCAD and maschine code)
FreeCAD's visualization and simulation is of the Path Commands that it is generating. It isn't possible for FreeCAD to simulate or visualize correctly the gcode that gets modified downstream. The Path commands are not recomputed at postprocessing. They are only sequenced and converted to the final gcode.

What you describe is very similar to LinuxCNC cutter compensation but you didn't say where the R word comes from. Is it programmed into the control ahead of time or is it supposed to be passed in each Feed move?
chrisb
Veteran
Posts: 43422
Joined: Tue Mar 17, 2015 9:14 am

Re: CNC Maschine with built in radius compensation

Post by chrisb »

thomas-huber wrote: Wed May 04, 2022 2:01 pm But with many operations it becomes unhandy and error prone.
At least this one can be solved: You can use Expressions to make the switching dependent on a single compensation property. And when you switch that one, all others will follow.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
thomas-huber
Posts: 13
Joined: Wed Jan 26, 2022 4:02 pm
Location: Oberneukirchen, Bavaria

Re: CNC Maschine with built in radius compensation

Post by thomas-huber »

The Path commands are not recomputed at postprocessing. They are only sequenced and converted to the final gcode.
Ok, but since prostprocessors are python code it sould be possible to manuelly recompute the path, right? But I guess this is not how it was intended and probably difficult do.
What you describe is very similar to LinuxCNC cutter compensation but you didn't say where the R word comes from. Is it programmed into the control ahead of time or is it supposed to be passed in each Feed move?
That's interesting and really very similar. The R parameter is part of the starting point of a path. Xilog has a notion of paths and not just single command movements.
At least this one can be solved: You can use Expressions to make the switching dependent on a single compensation property. And when you switch that one, all others will follow.
That's a good idea. Maybe I can make our own macro for this: Switch compensation off, postprocess, switch compensation on

Thank's so far, that was very helpful
eajmarceau
Posts: 73
Joined: Tue Feb 22, 2022 9:16 pm

Re: CNC Maschine with built in radius compensation

Post by eajmarceau »

Hi thomas-huber,

If I understood correctly, you wish to program the cutter's measured radius directly into the CNC.

Normally, the compensation register is for the difference between the "design value" and the "actual" value of the tool's radius. With that approach, you don't need to have a separate step of generating code other than the default Path values generated by FreeCAD for the "ideal" tool.

The way I see it, using the register for the "correction" value might be a safer approach, but you might have a different opinion on that, given what you are asking for (desire to use actual radius).

One thing I would have you think about is the number of path points at sharp corners, whether you are doing an arc around that corner or if you are cutting past to tangent for the next cut. If you have the system generate a number of points which all end up on top of each other, your control might not be able to distinguish (zero-distances involved) which side of the Path is on the right side, and the cutter might gouge the part. For that reason, I believe programming a Path for cutter "center" position is safest. Anyhow, you're the one at the control and making the final choice. Best of luck!
JanneK
Posts: 13
Joined: Sun Feb 01, 2015 9:30 pm

Re: CNC Machine with built in radius compensation

Post by JanneK »

I think this is the same question/problem as I have with the Sinumerik 840D controller. Just like in LinuxCNC, the codes G41/G42 set cutter radius path compensation. Have I understood this discussion correctly that FreeCAD isn't capable of generating paths with this in mind?
I.e. generating paths "without offset", YET calculating the correct number of runs to do a pocket with the "ideal tool" in mind?

In other words: Is the "correct working approach" to make sure that radius-compensation is always turned off on my machine and let Path generate the path for fixed tool information?
Not that I personally need this "professional feature" of controlling / tweaking the run of the program at the machine (instead of regenerating the gcode), but this realization hurts my heart.

Unless I've completely misunderstood something.
JanneK
Posts: 13
Joined: Sun Feb 01, 2015 9:30 pm

Re: CNC Machine with built in radius compensation

Post by JanneK »

I think this is the same question/problem as I have with the Sinumerik 840D controller. Just like in LinuxCNC, the codes G41/G42 set cutter radius path compensation. Have I understood this discussion correctly that FreeCAD isn't capable of generating paths with this in mind?
I.e. generating paths "without offset", YET calculating the correct number of runs to do a pocket with the "ideal tool" in mind?

In other words: Is the "correct working approach" to make sure that radius-compensation is always turned off on my machine and let Path generate the path for fixed tool information?
Not that I personally need this "professional feature" of controlling / tweaking the run of the program at the machine (instead of regenerating the gcode), but this realization hurts my heart.

Unless I've completely misunderstood something.
User avatar
sliptonic
Veteran
Posts: 2947
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: CNC Machine with built in radius compensation

Post by sliptonic »

JanneK wrote: Tue May 10, 2022 7:23 am I think this is the same question/problem as I have with the Sinumerik 840D controller. Just like in LinuxCNC, the codes G41/G42 set cutter radius path compensation. Have I understood this discussion correctly that FreeCAD isn't capable of generating paths with this in mind?
I.e. generating paths "without offset", YET calculating the correct number of runs to do a pocket with the "ideal tool" in mind?
Path (and CAM in general) is about calculating gcode. Cutter radius compensation is about the controller interpreting and moving those gcode coordinates. Therefore there's nothing for Path to do in this regard, (other than spitting out a G41/2 during a tool change.)
In other words: Is the "correct working approach" to make sure that radius-compensation is always turned off on my machine and let Path generate the path for fixed tool information?
Not that I personally need this "professional feature" of controlling / tweaking the run of the program at the machine (instead of regenerating the gcode), but this realization hurts my heart.
You can certainly use this feature, in multiple ways. You can have Path calculate all moves 'on the line' and use CRC to set the final offset. Or you can do offsetting with path and use CRC for the final adjustment to compensate for the difference between programmed tool diameter and actual diameter.

I find it most useful to not use CRC at all and use Path to do all offsetting. I only make one-off and small run parts so that works for me. If I need to adjust the offsetting value, it's easy enough to change the tool in Path and re-post the file. If I was running a production shop and needed the operator to make fine tuning adjustments to the path, I would use CRC but only for the wear compensation. As others have noted, using CRC for full tool radius offsetting is dangerous.
Post Reply