Z axis oscillating motion for routing marble and granite

14 Jul 2017 19:23 - 14 Jul 2017 19:26 #95801 by danilom
Marble router Ravelli used NUM controller, and it had M50 to start the Z axis oscillation and M51 to stop it. It had parameters for amplitude and frequency of this oscillation.

the motion can be seen in this video https://youtu.be/mkbBQISoKhc?t=16

I would like to implement the same feature in Linuxcnc retrofit of that particular machine, the oscillating motion helps clear the marble and wears the endmill more equally.
If any CAM software had this feature to turn on while profiling it would make things easier, but non of the stone marble granite CAD/CAM packages list this as a feature and I downloaded couple of demos to check.

So the question is where to start, would it be achievable trough simple macro or maybe activating realtime component input with macro which would then handle Z axis motion up and down, something like THC comp

Thanks !
Last edit: 14 Jul 2017 19:26 by danilom.
14 Jul 2017 20:12 - 14 Jul 2017 20:16 #95804 by Todd Zuercher
I believe that the function is achievable without too much effort. But... M50 and M51 are already used, so you would have to choose other M-codes to control it.
Your choices are to use a custom M-code (M100-M199) or use remapping with an unallocated M-code. (Using Remapping would allow you to use more parameter inputs.)

I think I would just use M150,M151, to control a couple of halcomponents
Use the P and Q values to set the amplitude and frequency of the oscillations.
Then use a siggen component to create the oscillation (it can do several different wave patterns.)
and an offset component to add that to the Z position command.
Last edit: 14 Jul 2017 20:16 by Todd Zuercher.
14 Jul 2017 23:59 #95807 by rodw
This might be a bit out of left field but this could be a candidate for the experimental external offsets branch and a custom component that accepted the siggen (or generated its own) to apply a varying offset on the Z axis to create the oscillation. You could use an M64/M65 to enable and disable the oscillation. See github.com/LinuxCNC/linuxcnc/tree/dgarr/external_offsets

So under this model, you'd simply set the tool height and enable the oscillation feature. You could control the amplitude and Z speed from the console or from Gcode. There are some good code examples for components that allow setting various parameters in the Plasma and laser section on this forum.
16 Jul 2017 08:03 #95835 by danilom
Thanks for the suggestions and ideas , will get back soon as I have some results.
16 Jul 2017 14:17 #95847 by danilom
Looked at External Offsets branch and it does exactly what is needed but I have no time to experiment right now, if there is a simpler solution.
loadrt offset count=1
loadrt siggen num_chan=1

addf offset.0.update-output servo-thread
addf siggen.0.update servo-thread

setp siggen.0.amplitude 5
setp siggen.0.frequency 0.01

unlinkp axis.2.motor-pos-cmd
unlinkp axis.2.motor-pos-fb

net offset_sine siggen.0.sine offset.0.offset 
net offset_from_axis axis.2.motor-pos-cmd offset.0.in
net offset_to_axis offset.0.out axis.2.motor-pos-fb

This works but I have two problems, offset is adding the sine value but I need difference from the last offset and other is, because I have to unlink the axis.2.motor-pos signals I have to link them back again somehow.
I successfully started and stopped the motion with user M150 and M151 controlling some integer value which I multiplied with offset (1/0) but getting other strange results along and the siggen has to be started when the M150 is issued so it starts from 0.

I am just starting with advanced Linuxcnc configurations, first were the tool changers on couple of machines but thanks to the carousel comp I got those going with minor adjustments.
More to come...
16 Jul 2017 20:35 #95861 by Todd Zuercher
You can use a couple of mux components to switch between two different signals
16 Jul 2017 20:49 - 16 Jul 2017 20:51 #95862 by Todd Zuercher
If you are having trouble with a step in the commanded output caused by where in the wave pattern the signal from the sigen is connected or disconnected from the position command. perhaps you may need to run it through a limit2 component as well.

So the hal arrangement might look something like this.
     joint-pos-cmd \
joint-pos-cmd \      > mux -> limit2 -> stepgen
    sigen -> offset /
Last edit: 16 Jul 2017 20:51 by Todd Zuercher.
16 Jul 2017 21:00 #95863 by rodw
You could consider writing your own hal component. This would let you save the current position in a static variable so it can be referenced on the next pass through the servo loop.There are some included in the external offset branch but look at some of the simpler examples to understand how this works.
halcompile --install mycomponent.comp
compiles and installs a component
13 Aug 2017 06:43 #97405 by Yannis
the oscillation of the tool is something common in alphacam stone
check in the you tube for example videos
13 Aug 2017 08:33 #97407 by danilom
Yes I found it out eventually in Alphacam, so I gave up on doing it trough Linuxcnc .

Thanks Yannis
Time to create page: 0.079 seconds
Powered by Kunena Forum