Author Topic: hsm pocket (hsm experts anyone ?)  (Read 33053 times)

Offline jk

  • Wookie
  • ****
  • Posts: 265
    • View Profile
hsm pocket (hsm experts anyone ?)
« on: October 07, 2016, 16:10:28 pm »
---

The ideas from this topic are now a complete MOP plugin, please see it: http://www.cambam.co.uk/forum/index.php?topic=6209.0

---

While using the Voronoi builder plugin I've realized there is a ready implementation of the Voronoi partitioning,
which can be used for approximating the medial axis of region (aka skeleton).

If we roll an inscribed circle of maximum diameter along the axis, it will cover the whole pocket.
If we connect the circles in a right way, a hsm-like slicing would be possible - I've seen toolpaths like this in a video :-)

So I've hacked crude demo plugin, creating the medial axis with the Voronoi code from the Builder and rolling the ball along it.

Any ideas what to do next ?
How the arcs may be connected and air time reduced ?
Lead in ? Spiral seems to be ok.
If we output a bunch of arcs, may cambam engrave them without retracts ?

Maybe it's a way to have a fun hsm pocketing in cambam :-)

Demo plugin and playground project attached.
How to use: select polylines and click MAT under plugins menu. Processing time may be long, that's ok.

« Last Edit: November 25, 2016, 15:37:26 pm by jk »

Offline jk

  • Wookie
  • ****
  • Posts: 265
    • View Profile
Re: hsm pocket (hsm experts anyone ?)
« Reply #1 on: October 07, 2016, 16:11:40 pm »
.

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7564
    • View Profile
    • Cambam V1.0 French Doc
Re: hsm pocket (hsm experts anyone ?)
« Reply #2 on: October 07, 2016, 17:06:30 pm »
Hello,

Maybe you'll be interested by this topic

http://www.cambam.co.uk/forum/index.php?topic=1968.0

currently there is a way to do that with an engrave mop.

use the Draw/plus menu to draw the arcs (note: the CAD extra plugin is integrated in CB now, no need to install it)

- the arcs must be selected in the order they must be machined
- the optimization mode must be set to none to insure that the arcs are machined in the order they have been selected.
- the Max Crossover Distance value must be set so the max displacement allowed is > to the the arc chord, so the Z axis do not raise.

a video on the french doc
http://www.atelier-des-fougeres.fr/Cambam/Aide/cad/Entities.htm#flatspiral

an example in attachment

++
David
« Last Edit: October 07, 2016, 17:40:30 pm by dh42 »

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7564
    • View Profile
    • Cambam V1.0 French Doc
Re: hsm pocket (hsm experts anyone ?)
« Reply #3 on: October 07, 2016, 17:36:52 pm »
You can also use a profile mop instead an engrave mop with the same settings except that you need to set the Roughing clearance to - radius of the tool (so to -5 for a tool Ø10)

The 2 advantages with a profile mop is that you can set a different feedrate for the arc chord, example in the file, the arc is machined at 1000 mm/min and the chord at 2000. the other advantage is that you can use spiral lead in if necessary.

the pb that can appears if the arcs are of different sizes is with the  Max Crossover Distance setting ... maybe you need to creates the "line" between the end of an arc and the begining of the next so you control the Z move .. but in this case, you can't change the feed rate for this move ...  

++
David
« Last Edit: October 07, 2016, 17:43:42 pm by dh42 »

Offline jk

  • Wookie
  • ****
  • Posts: 265
    • View Profile
Re: hsm pocket (hsm experts anyone ?)
« Reply #4 on: October 09, 2016, 19:56:36 pm »
dh42, thanks for a great reply.

So Max Crossover Distance is the key technique to disable retracts, I thought its range is 0..1, but it's not )
I think I'll try a very big crossover distance to prevent all retracts. A few required retracts (number is equal to the number of medial axis branches minus one) would be simulated by a short vertical segments in a Z+ direction.

Next I am going to minimize the air cutting time by ordering the MAT branches. Branch with the globally biggest radius would be cut first, next would be the the branch attached to the first one, etc. This way we guarantee
the next branches starts from already milled area, so no lead-ins required and arc may be shorter.

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7564
    • View Profile
    • Cambam V1.0 French Doc
Re: hsm pocket (hsm experts anyone ?)
« Reply #5 on: October 09, 2016, 20:34:38 pm »
Hello,

One another thing I use is the spiral machining ; maybe it can be a good idea to try to cut the biggest circle that fit in the shape with this method, then use the trochoidal method to clear the rests.

I add an example that I use on real parts to machine bore.

++
David

Offline jk

  • Wookie
  • ****
  • Posts: 265
    • View Profile
Re: hsm pocket (hsm experts anyone ?)
« Reply #6 on: October 09, 2016, 20:57:07 pm »
Exactly ! The biggest circle should be cut by expanding spiral. I'm intending to add it as a last step of plugin dev, should be easy enough.

Offline jk

  • Wookie
  • ****
  • Posts: 265
    • View Profile
Re: hsm pocket (hsm experts anyone ?)
« Reply #7 on: October 12, 2016, 13:15:30 pm »
Got some success with the graph-like ordering of branches. Next would be the trimming of some arcs there the branches meet, thus reduce air-cutting time even more. See the playground and demo plugin. I've included the generated arcs in playground this time.

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5321
  • Made in England
    • View Profile
Re: hsm pocket (hsm experts anyone ?)
« Reply #8 on: October 12, 2016, 15:55:03 pm »
It looks like a good method.
The toolpath would be very similar to this video from 0:45 to 1:30 minutes, https://www.youtube.com/watch?v=g4AqkhVD0oY
« Last Edit: October 12, 2016, 15:58:05 pm by EddyCurrent »
Filmed in Supermarionation

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7564
    • View Profile
    • Cambam V1.0 French Doc
Re: hsm pocket (hsm experts anyone ?)
« Reply #9 on: October 12, 2016, 18:16:29 pm »
Hello,

Looks nice ... but the stepover is bad. Look on the attached file ; tool = 4mm, SO = 0.2 >toolpath spacing must be 0.8 maxi, but most have a spacing of 1.2.

with tool D3, So: 0.4 the spacing must be 1.2 maxi and it is close to 1.5 (but more regular than with tool D4)

Some shape gives strange results (try a simple rectangle 100x60 with tool Ø4 and stepover = 0.1)

sometimes it crash, but difficult to know why .. is seems to crash when I copy an object then use MAT on the copy.

++
David

Offline jk

  • Wookie
  • ****
  • Posts: 265
    • View Profile
Re: hsm pocket (hsm experts anyone ?)
« Reply #10 on: October 13, 2016, 00:33:08 am »
Eddy, thats one of the videos I wrote about in a first post )

David,
Max spacing was wrong for small stepovers, that's right. I just step along the medial axis in a fixed increment (tool diameter / 10) and emit next arc if stepover is >= the required. So stepover is always jittering and
overshooting by some amount. For small values like 0.1-0.2 it's jittering bad and overshoots next to the unusable.
Changed axis step to be stepover / 10 for now, which ramps up processing time.

Interpolation between steps may be an obvious choice, the processing time would be less and stepover is
closer to the specified. Leave it for later stage of dev.

Simple 100x60 rectangle bug was a totally unexpected ! Sometimes it fills ok, sometimes result is very odd.
Got to investigate it.

Thanks for all testcases, I add them to the playground to track regression.

Offline jk

  • Wookie
  • ****
  • Posts: 265
    • View Profile
Re: hsm pocket (hsm experts anyone ?)
« Reply #11 on: October 13, 2016, 01:39:29 am »
Rectangle bug appears to be a bug of Voronoi code.

I may reproduce it like that:
1) draw 100x60 rectangle
2) 'Step Around Geometry' with step == 1
3) select rectangle and pointlist
4) run Voronoi Builder plugin with Manual detail type and 0 randomness
5) observe the same odd shape of the medial axis

not sure how to fix it (if possible at all)

PS Discovered it is a CamBam bug after all :-)
In the above case pointlist contains two duplicate points (first and last). And the voronoi generator goes crazy.
« Last Edit: October 13, 2016, 03:22:48 am by jk »

Offline jk

  • Wookie
  • ****
  • Posts: 265
    • View Profile
Re: hsm pocket (hsm experts anyone ?)
« Reply #12 on: October 13, 2016, 18:17:59 pm »
Made a small fixes for stepover and wrong voronoi medial axis.
Stepover should undershoot now and never reach the specified maximum (though most times be around it).
Stepover could be monitored on a Tag field of generated arcs, there is max tool engagement and stepover are printed.

Would be nice to test this version on some real part pockets before moving to the arc trimming, generating retracts paths, optimization etc.

PS The pockets should have no internal internal passages cutter can't pass (passage width <= cutter width), it is a limitation which unlikely to be removed.

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7564
    • View Profile
    • Cambam V1.0 French Doc
Re: hsm pocket (hsm experts anyone ?)
« Reply #13 on: October 13, 2016, 20:23:20 pm »
Hello

Quote
PS Discovered it is a CamBam bug after all :-)
In the above case pointlist contains two duplicate points (first and last). And the voronoi generator goes crazy.

Ah ah ! yes ... the pb seems to appears when the perimeter is exactly divisible by the step.

++
David

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1892
    • View Profile
Re: hsm pocket (hsm experts anyone ?)
« Reply #14 on: October 14, 2016, 07:19:38 am »
HI jk
Point-Lists are editable, You can write a lightweight method to compare the first and last set of points in your list and if they are the same remove the last one.
Dave