Author Topic: Change of Z along an elliptical path.  (Read 16513 times)

Offline homebuiltncrouter

  • Ewok
  • *
  • Posts: 15
    • View Profile
Change of Z along an elliptical path.
« on: January 29, 2023, 20:46:38 pm »
What I'm trying to do is have a change in Z either a + or - . So what I'm trying to do is have a tool path that starts at point A and ends at point B and that path contain several arc segments (or line segments with or without arcs). Those lines and/or arcs will create the path being cut, of course. My Cad program created a 24 segment ellipse, so that's the example I'm using. In an example case I want the path to begin at A=0 and end at B=-0.125 and the end result be one ramp to depth. I have tried this using the engrave and v-carve plug-ins but both failed to give the result needed. Engrave just plain failed (it was never meant to work this way) and V-Carve lowered the tool only along the first line segment of the POLY. I did successfully (somewhat) calculate and edit the G-code to produce the results I was after but really want to automate this function BAM.

Edit: As I have been working on finding a solution to this I've realized that this post was improperly named. An ellipse is just the path that I was/am happen to be working with at this time. However, the result that I'm after could apply to any group of lines connected as a closed or unclosed polyline of any description.
« Last Edit: February 04, 2023, 20:17:50 pm by homebuiltncrouter »

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5330
  • Made in England
    • View Profile
Re: Change of Z along an elliptical path.
« Reply #1 on: January 29, 2023, 21:27:18 pm »
Try the attached file.
This is what I did.

1. draw 3 arcs
2. Select all 3 then , Edit->Join
they will be converted to a polyline
3. select the new polyline then in it's property panel choose Transform
4. I chose to rotate about the Y axis
5. select the polyline then Edit->Transform->Align
choose X & Y as you prefer but make Z = Upper
6. Select the polyline then create an Engrave machining operation (MOP)

Engrave is the only MOP that will follow the line in Z

Of course a 3D MOP will also do the same but it needs a surface to follow.
« Last Edit: January 29, 2023, 21:29:59 pm by EddyCurrent »
Filmed in Supermarionation

Offline homebuiltncrouter

  • Ewok
  • *
  • Posts: 15
    • View Profile
Re: Change of Z along an elliptical path.
« Reply #2 on: January 30, 2023, 00:25:09 am »
Thanks for your input. It sounds like quite the work around though. Thinking further about this I realized that almost all of the profile cuts I make are begun with a ramp in to depth then from there are cut at depth, that equaling two passes around the part. Since I already know that CamBam has the smarts to do a ramp I simply want it to ramp down and be done with it and continue on with the next polyline which will be a ramp back up to Z=0.0 and so on and so forth. Still trying to figure this out. Your solution is a good one and thanks for that. This should be a lot simpler than it's turning out to be. Especially when half of the ability is already in existence.

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5330
  • Made in England
    • View Profile
Re: Change of Z along an elliptical path.
« Reply #3 on: January 30, 2023, 20:30:34 pm »
Sorry, I had not realised you were talking about ramp in and ramp out, I though you wanted a path that just went down.

Are you saying that the "Lead In" and "Lead Out" moves of the Profile cut for example are not what you want ?
Filmed in Supermarionation

Offline homebuiltncrouter

  • Ewok
  • *
  • Posts: 15
    • View Profile
Re: Change of Z along an elliptical path.
« Reply #4 on: January 31, 2023, 02:12:48 am »
They are not what I want but they are a good start. Here's why; when I set my lead in move I set it as spiral and give it no spiral angle. Doing that causes CamBam to calculate a ramp to depth that is equal to one full pass around the part. Then at full depth it continues on to make one more full pass at depth. That has worked fine for me so far it's perfect since I use a bottom cutting round over to make most of my profile cuts. Now I want to do something different. Now I want the ramp to stop and move on to the next polyline and perhaps ramp up. You can probably see my problem here. What the code that is generated does is for 1, starts at the wrong end of the cut no matter how I try to change that and 2, at depth the tool reverses and continues back along the path that had been cut. If I knew anything about programing I would edit the profile script and create one that just allows a ramp from a 2d file. After all it's already been done with the lead in and lead out move. I just need to get rid of the extra bit of work I don't need. I'm including an example of my edited g-code for download so that you can see for yourself what I'm after. You will also be able to see that I used the engrave profile. All of the Z axis were put in by me and my calculator. Hence edited.

Offline homebuiltncrouter

  • Ewok
  • *
  • Posts: 15
    • View Profile
Re: Change of Z along an elliptical path.
« Reply #5 on: February 01, 2023, 20:01:44 pm »
I've been looking around and trying to search this out and I think I've found what I'm looking for. I'll be looking this over to see how well it match's my needs.

https://cambamcnc.com/forum/index.php?topic=3093.0

Also, As I've been thinking about this problem I'm realizing that the tool wouldn't need to be following an elliptical path but really any path. That is to say that if I were to make an octagon and create a polyline out of 4 of the sides and another polyline out of the remaining 4 sides. Then I'd want an MOP that allowed me to ramp down to the end of the polyline in profile1 then be able to ramp back up to the end of profile2 and so on.


UUGH! three hours later and not the answer. :(
« Last Edit: February 02, 2023, 04:21:13 am by homebuiltncrouter »

Offline Tool-n-Around

  • Wookie
  • ****
  • Posts: 316
    • View Profile
Re: Change of Z along an elliptical path.
« Reply #6 on: February 04, 2023, 15:56:21 pm »
What I'm try to do is have a Z change either in a + or - direction. So what I'm looking for is a tool path that starts at point A and ends at point B and that path will contain several arc segments each being a random length specific to whatever arcs are required to create the ellipse being cut (My Cad program created a 24 segment ellipse).

If you could create an eliptical surface with your CAD program, you could potentiallly use CB to project a polyline or pocket onto the elliptical surface and then either use that directly to generate the tool path or use the tool path to geometry command to isolate/generate the tool path line in 3-space you desire.

Best,
Kelly

Offline homebuiltncrouter

  • Ewok
  • *
  • Posts: 15
    • View Profile
Re: Change of Z along an elliptical path.
« Reply #7 on: February 05, 2023, 02:37:16 am »
Thanks for the reply Kelly. In a lot of cases surfaces would be a great answer to a problem like this. Not this one though. The way I'm seeing this is best described as a V-engrave. My desired result from this would be that I be able control my depth of cut along a path made up of several line segments that form a poly. By doing this I can V-cut perspective and depth into a 2D image I'm creating. For instance a building or waterfall or in the case of an ellipse the rings of Saturn. It would be like line drawing with a router. I want to simply follow a path that I can somewhat control where the emphasis gets placed.

I've uploaded several files here if anyone is interested. The screenshot shows the MOP settings I'm using to get the best results I've gotten. The "Ellipse 1.nc" is the code in it's raw form generated from CB and the "Ellipse 2.nc" is the code in it's edited form the way I'd like it to be generated. The difference in the way it's being done and the way I'd like it to be done is that the left side of the ellipse would be it's own profile1 and the right side would be it's own profile2 and not generating the center piece of code that I've edited out. When run it would cut as a single contiguous line, excluding a change of direction at depth. Both .nc codes can be run on Mach3 to show the difference in how they perform. The last file being a .cb just as a way to play with the drawing if you like. It's in inches.

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5330
  • Made in England
    • View Profile
Re: Change of Z along an elliptical path.
« Reply #8 on: February 05, 2023, 13:57:17 pm »
My own method would be to use 3D CAD to produce the required line(s) then use the Engrave cut in CamBam with a V Tool.

As a matter of possible future interest, is this plugin any use; http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/Semiton.html
Filmed in Supermarionation

Offline homebuiltncrouter

  • Ewok
  • *
  • Posts: 15
    • View Profile
Re: Change of Z along an elliptical path.
« Reply #9 on: February 05, 2023, 22:51:18 pm »
I added the plugin this morning. It looks like a great add on. I am having one problem though. The plugin doesn't seem to be finding my tool library. When I try to select a tool the drop down is empty. Did I do something wrong?

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5330
  • Made in England
    • View Profile
Re: Change of Z along an elliptical path.
« Reply #10 on: February 06, 2023, 10:22:28 am »
All my tool libraries are located here;  C:\ProgramData\CamBam plus 1.0\tools

The plugin uses this line to find them,

ToolLibrary = CamBamConfig.Defaults.ToolLibraries.Find(Selected_Tool_Library);

They are shown under the System tab, see attached image.
Filmed in Supermarionation

Offline homebuiltncrouter

  • Ewok
  • *
  • Posts: 15
    • View Profile
Re: Change of Z along an elliptical path.
« Reply #11 on: February 06, 2023, 21:02:41 pm »
Yes I got that.

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1894
    • View Profile
Re: Change of Z along an elliptical path.
« Reply #12 on: February 07, 2023, 00:54:57 am »
Have you tried using the heightmap function in cb, might be worth a look.
Dave

Offline homebuiltncrouter

  • Ewok
  • *
  • Posts: 15
    • View Profile
Re: Change of Z along an elliptical path.
« Reply #13 on: February 07, 2023, 02:19:48 am »
Thanks Dave, Yes I've used the .hgt map function. Downloaded some .hgt's of the Moon and made some really nice cuttings of it. CB is an exceptionally nice program for doing that. In fact I have to say that I regard CB as the all around "Go Too" machinist program for me. Yes I have other CAM software but have used CB exclusively for years since I bought the license. I love the MOP control I have in my work with CB. My very first project with CB was an engrave of Pegasus from MC Escher. Did you know that there's only one line that, when repeated, makes up that entire tessellation. Then my second project was the Moon. It was a sock knocker offer. I have it lying around here somewhere. But getting back to control. This is very important to me. The examples I'm giving are simplistic. My end goal is much more detailed and complicated than any description I've given. But it hinges on being able to follow a line drawing and carry across several line segments of a poly to different desired depths along the way. I could do what I've been doing in my examples and edit the profiles in G-Code. That would be tedious at best. "So it goes" as Vonnegut would say.
« Last Edit: February 07, 2023, 02:27:47 am by homebuiltncrouter »

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5330
  • Made in England
    • View Profile
Re: Change of Z along an elliptical path.
« Reply #14 on: February 07, 2023, 10:11:02 am »
Rather than drip feeding, it's best to spit it out exactly what you require at the outset because it's taking a while to understand your end goal.

When you say the line needs to be cut at different depths, what feature of the line should control that depth ?

For example, the V-Engrave MOP only works between 2 lines, the tool plunges to a depth so that it touches both lines, hence if the lines are far apart it plunges deep, if the lines are close together it plunges shallow.
The Semitone plugin uses greyscale values, i.e. the darker the line or point the deeper the plunge.

So, what should control the depth of cut in your application ?
« Last Edit: February 07, 2023, 10:15:06 am by EddyCurrent »
Filmed in Supermarionation