Vertical Feed rates in partially-vertical cuts

Here's the place for discussion related to CAM/CNC and the development of the Path module.
chrisb
Posts: 30771
Joined: Tue Mar 17, 2015 9:14 am

Re: Vertical Feed rates in partially-vertical cuts

Pekka, let me first thank you for the ramping, it is an important augmentation to paths.
roivai wrote:
Sun Nov 26, 2017 7:46 pm
Currently the feed rate is set very simply: if any segment of the path has different starting Z and finish Z, the vertical feed rate will be applied. Not very clever, so I am happy to implement it in better way when some sort of conclusion is reached how it should be done.
It might not be clever, but it is smart: Usually the vertical rate is lower and when you have to choose between horizontal and vertical speed this is the mill saving mode. A mill that is killed half way down takes much longer than milling with a feed rate below maximum.

resulting speed along the ramp is 1/sin(angle)*vertical_feed, right? Of course that must be limited if it exceeds the set horizontal feed rate. If I understood right, that is what chrisb said in the pdf with a bit different perspective?
Exactly, that's what it was about, the sinus is the projection of the overall feed to its vertical component. If the angle is given it is even pretty simple to calculate arbitrary horizontal movements. I will augment the pdf to helix with these thoughts
You need at least FreeCAD 0.19.23300 to edit my current sketches.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Posts: 30771
Joined: Tue Mar 17, 2015 9:14 am

Re: Vertical Feed rates in partially-vertical cuts

Helix ramping is now included in the pdf on the first page of this topic.
You need at least FreeCAD 0.19.23300 to edit my current sketches.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
berka
Posts: 65
Joined: Sat Aug 22, 2015 9:08 pm

Re: Vertical Feed rates in partially-vertical cuts

chrisb wrote:
Mon Nov 27, 2017 12:56 am
Helix ramping is now included in the pdf on the first page of this topic.
I'm happy to hear you're considering helix as well; I think it's the same in this context when unwrapped as you pointed out.

Back to the math. Here is what I had in mind. in terms of finding a feed rate for a ramp:
RampFeedPicturesFlattened.pdf
I see two approaches. I called them the "linear" solution and the "elliptical" solution. I favor the elliptical approach. It sounds like @chrisb is leaning toward linear approach.
When I solved the simultaneous equations, I could not eliminate the ugly tangent functions. I'm not a big fan because they require special handling at the extremes. I'm sure a math enthuisiast could come up with a much more elegant solution....

It boils down to these two

Linear solution:
Vx = Vzmax / ( tan(theta) + ( Vzmax/Vxmax ) )
Vz = Vx tan(theta)

Elliptical solution:
Vx = 1 / sqrt( (tan(theta)^2 / Vzmax) + 1/ Vxmax^2 )
Vz = Vx tan(theta)

Where:
theta = ramp angle
tan(theta) = Zcut / Xcut
Vx and Vz are x and z components of the feed vector respectively.
Vxmax and Vzmax are the set horizontal and vertical feed rates respectively.

If anybody would like to laugh at my chicken scratch arriving at these, here they are:
ChickenScratchMath20171126Flattened.pdf
I also made an Excel spreadsheet to test out that these schemes aren't completely nuts.
RampFeedRateExamples.xlsx
There are probably more elegant solutions. I'm even convinced that the original solution (pick one), @chrisb's conditional formula, linear and elliptical solutions can probably all be generalized into one equation with the addition of another "how daring are you?" constant. The words p-norm and Lp-space come to mind, but those are way outside my understanding... Did I get any math enthusiasts excited?
chrisb
Posts: 30771
Joined: Tue Mar 17, 2015 9:14 am

Re: Vertical Feed rates in partially-vertical cuts

Thanks for the contribution, especially the excel sheets helps to clarify things.
I am not sure about the objective of your approach. If it is maximizing speed - as OP's issue was all about - or is it kind of smoothness or something else.
If it is about smooth start and stop we should think separately about it, because to pin down the acceleration in GCodes would heavily overload the GCode files.
If it is about speed, please have a look at your Excel sheet, e.g. Xcut=20, Zcut=5. The contribs in X and Z directions are only half of their possible max values.

I think that the error lies in what you call the linear approach. My solution is in fact not following the (blue) linear solution. In your terms it might rather be called a quadratic or rectangular solution, because the speed stays at the maximum of at least one direction. I have added it in magenta to your picture.
Attachments
rectSolution.png (81.73 KiB) Viewed 731 times
You need at least FreeCAD 0.19.23300 to edit my current sketches.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
JoshM
Posts: 450
Joined: Thu Oct 05, 2017 5:34 pm
Location: New Hampshire

Re: Vertical Feed rates in partially-vertical cuts

There is another option of course--allow for Ramp-Speed specification in the Tool-Controller or the RampEntry-Dressup. What it lacks in elegance, it makes up for in the broadness of it's application...
Best,
Josh
chrisb
Posts: 30771
Joined: Tue Mar 17, 2015 9:14 am

Re: Vertical Feed rates in partially-vertical cuts

I have added my formulae to the excel sheet and the contributions to X and Z. You can see that either Xcontrib or Zcontrib is at its maximum.
Attachments
RampFeedRateExamples.xlsx
You need at least FreeCAD 0.19.23300 to edit my current sketches.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
roivai
Posts: 117
Joined: Thu Feb 02, 2017 5:29 pm
Location: Oulu, Finland

Re: Vertical Feed rates in partially-vertical cuts

JoshM wrote:
Mon Nov 27, 2017 1:40 pm
There is another option of course--allow for Ramp-Speed specification in the Tool-Controller or the RampEntry-Dressup. What it lacks in elegance, it makes up for in the broadness of it's application...
Best,
Josh
I'm starting to lean towards this... Maybe some dropdown list "Ramp Feed Rate" with options "Horizontal feed rate", "Vertical feed rate" or "Custom" and selecting custom would enable a field to enter that custom feedrate? Or simply only the feed rate input field?

Not that I don't like the math savvy options but there seems to be quite many already.
herbk
Posts: 1988
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: Vertical Feed rates in partially-vertical cuts

roivai wrote:
Mon Nov 27, 2017 5:54 pm
'm starting to lean towards this... Maybe some dropdown list "Ramp Feed Rate" with options "Horizontal feed rate", "Vertical feed rate" or "Custom" and selecting custom would enable a field to enter that custom feedrate?
That would be my prefered solution, but i can live with only a input field to.

In my mind a calculation for the "ramp feed rate" makes only sense, if the material is part of it, because the material defines how fast you can work.
Gruß Herbert
chrisb
Posts: 30771
Joined: Tue Mar 17, 2015 9:14 am

Re: Vertical Feed rates in partially-vertical cuts

herbk wrote:
Mon Nov 27, 2017 6:10 pm
In my mind a calculation for the "ramp feed rate" makes only sense, if the material is part of it, because the material defines how fast you can work.
Exactly, the ramp angle depends on the geometry of the tool, the ramp speed on the angle and the material.

And I want to explain myself: I did not do the math with the wish of getting it implemented soon, it is only for clarification of what we are talking about.
You need at least FreeCAD 0.19.23300 to edit my current sketches.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
roivai
Posts: 117
Joined: Thu Feb 02, 2017 5:29 pm
Location: Oulu, Finland

Re: Vertical Feed rates in partially-vertical cuts

I just created a pull request for this: PR1121

It now has the dropdown menu and an input field for a custom rate:
2017-11-28-192525_1920x1080_scrot.png (42.75 KiB) Viewed 669 times

I had bit of a hard time thinking how I should assign the feed rates to different sections of the finished path. I chose quite simple method: If the segment contains both vertical and horizontal movement, then ramp feedrate is applied.. The downside is that this allocation affects to everything in the path object. For example, if there are Tags added with another dressup, the ramps on the tags will get the same ramp feedrate as well. I suppose that is not too much of a problem?