Hello Guest it is March 28, 2024, 11:10:11 AM

Author Topic: Constant Velocity settings worked out ... I think  (Read 11792 times)

0 Members and 1 Guest are viewing this topic.

Constant Velocity settings worked out ... I think
« on: January 08, 2017, 11:48:33 PM »
Hi all,

I thought this would be a helpful post as it has been messing with my CNC quality, time, and my sanity.

I am doing large 3D carving of aircraft fuselages. My last job took approximately 20 hours on the machine to finish when it should have taken closer to 6 or 8. The reason for this was the machine was effectively running in "Exact Stop" mode because of my settings. The reason for this was my "CV Dist Tolerance" setting of 0.1mm combined with mildly conservative acceleration settings of 300mm/s/s.

The reason I set the "CV Dist Tolerance" to 0.1mm was because I wanted to ensure the surface tolerance would not be worse than 0.1mm and even this was larger than I would like. This resulted in the characteristic jerky start-stop-start motion and a very low average speed. The other annoying side effect is the delay where the tool slows to almost a stop causes a small indentation that is a lot of work to remove with the sandpaper afterwards.

My mistake was my understanding of "CV Dist Tolerance". I thought it was the maximum distance from the desired path that Mach3 would go to maximise the feed rate while limiting the acceleration to the requested values. This does not appear to be correct and I was alerted to this by the jerky motion on lines that differ by only a very small angle or the performance over large arcs made up of multiple lines.

This is the part of the explanation I missed when I read through the "Mach-3CVsettings V2.doc" : "This is the distance from the end of the line that it is cutting to where the arc starts rounding" The problem with using this definition is it results in a variable surface following tolerance. For very low angle corners the error is very small but for a 90 degree angel the error can be extremely large.

So my question was, how do I maintain feedrate and small errors and the answer is "Stop CV on angles". This variable drops back to "Exact Stop" mode if the angle is greater than this value from a straight line.

The surface tolerance can be calculated using this formulae:

error = dist/cosd((180-theta)/2) - dist*tand((180-theta)/2)

where dist is "CV Dist Tolerance" and theta is "Stop CV on angles".

So what this does is ensure that for small angles we use Constant Velocity mode where the maximum error will be small despite a large "CV Dist Tolerance". Then any time we approach a line segment with anything other than a small angle we drop back to "Exact Stop" mode.

My settings are 2.5mm for "CV Dist Tolerance" and 5 degrees for "Stop CV on angles". This results in fast smooth curves on my machine and a surface tolerance of almost 0.05mm and I am happy for the machien to come to a complete stop for any angles larger than 5 degrees.

I hope this helps as I wasted a lot of machining time before I sat down and worked this out.


Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Constant Velocity settings worked out ... I think
« Reply #1 on: January 09, 2017, 10:39:26 AM »
Its very interesting as i had suffered poor path following recently due to my machine having less than blistering acceleration, I'll wait to see what the response from others is first but i may play with this myself as i would rather run a bit lower acceleration and still get tight tolerances on my Bridgeport conversion.
Re: Constant Velocity settings worked out ... I think
« Reply #2 on: January 09, 2017, 06:01:51 PM »
Yeh, I hope one of the developers can confirm my calculation or at least my understanding.

Offline ART

*
  • *
  •  1,702 1,702
  • Tough as soggy paper.
    • View Profile
Re: Constant Velocity settings worked out ... I think
« Reply #3 on: January 09, 2017, 09:30:05 PM »
Hi:

   Well, after seeing a "fecking" priest as an avatar, I guess I better respond.( I loved that show..)  :-)

  Distance tolerance in CV is not exactly as you think, and your formula isnt actually the proper error, ( except in certain circumstances.). Your error is a function
of both acceleration and feedrate, so its a much more complex formula to determine and integrate error. You have to remember than in Mach3, CV is actually
a case of starting the next move, as soon as the previous one starts to decelerate. Low acceleration of any involved axis, will increase error. Increased acceleration
reduces error. Angle limit tells it to not CV at all on angles greater than n , which does help as the larger the angle, the more error is involved for any axis, but
constant stop will mar a surface finish. All a trade-off.  

   Its quite normal for people to try to be more accurate by lowering accel and feedrate, lowering accel increases error in reality as does increasing feedrate.
  To understand this clearly, imagine a 2 move sequence,
G1X10
G1Y10

  As the X axis progresses toward 10, it will eventually decide it has to decelerate. The lower your acceleration the sooner this will occur. As soon as it does occur,
the Y axis will begin to move as the X slows. If your picturing this properly, your picturing a circular corner as the X slows and Y accelerates. Now imagine
a faster acceleration, it takes longer before the X HAS to decelerate, the Y wont begin till this happens, so the circular arc at the corner gets smaller. The error
shrinks. Nwo imagine a faster feedrate, same accel. The X must now decelerate sooner as it has more speed to dump, the Y starts earlier and your error
increases.

  Imagine the X and Y have a different acceleration, now the corner is an ellipse. Faster the feedrate, the greater the ellipse. The slower the accel the greater the
ellipse ( and the two are additive). So to be fair to your job and error requirements is a two pronged approach,firstly, have accel as high as your axis will allow for.
This is almost always true, keep accel as fast as you can. Secondly, when it comes to feedrate, keep it reasonable, that is to say that if you set Feedrate to 10,000
inches per minutes, and the axis only really gets to 50, then 50 is the proper setting in the code, setting higher than reachable affects error and surface condition
in terms of pockmarks and such. That is the target to reach for. If error is then too much for you, best compromise is to program even lower feedrate, but never higher
than actually reachable on the majority of the code. As accel is much more important than feedrate as it is squared over time,maximizing it is integral to
lowering error and maximizing surface results. Max error of course does increase with higher angles and its not unreasonable to set an angle limit for higher angles,
but its a trade-off, and Ive always found its best to use accel more than angle limit to fight any issues of speed and performance.

   Machines vary so its not possible for me to tell you how to set your unit, but take it from me, I speak from some experience in Mach3 :) , the faster the accel the better,
the slower the feedrate the better ( in terms of error ) . Id set accel so the axis can handle no more without errors or jerking, then adjust feedrate for best results. Always
keep feedrate commands as close to the reachable feedrate if it seems limited, and as high as your material/tool can handle. This minimizes error and makes things smooth.
  There is almost never a need to use exact stop, and almost never a need to limit angles to less than 45 degrees. If you do so, your probably fighting yourself.  Properly adjusted
angle limit and accel should then simply allow you to slow commanded feedrate to decrease overall finish error without any other tuning. It then follows one simple rule, the faster
you go the greater the error.

  Now if you have a machine which just cannot accel fast, set it as high as it will take, then use feedrate for finish..

Just my two cents, for what their worth..

Art


    

  

    
 

  
« Last Edit: January 09, 2017, 09:33:30 PM by ART »
Re: Constant Velocity settings worked out ... I think
« Reply #4 on: January 09, 2017, 10:28:44 PM »
Thanks for your reply Art.

You are correct that my formulae makes a couple of assumptions.
1. Accelerations are equal in all axis,
2. Mach3 only uses acceleration limiting and does not do jerk limiting. This should result in a circular arc (or near circular depending on the precise algorithm used) joining the two lines that cuts the corner.
3. This formulae is the worst case where the feedrate is as high as possible given the CV settings for that intersection.

I assume based on your statement "except in certain circumstances" we are on the same page given these constraints.

I have seen similar statements made numerous times when talking about the CV mode but general statements don't help optimise the surface finish or surface tolerance for a given machine. In some circumstances these settings will break tool bits as the CV setting cuts the corner and suddenly increases the chip load. I don't believe this is acceptable or professional and I would like to provide Mach3 (maybe 4 too) users with a more precise way of characterising these tradeoffs.

For example, assuming my understanding is correct. Increasing the "Stop CV on angles" from 5 to 45 degrees increases the error from ~50um to ~500um (~1mm at 90 degrees). This is the difference between an acceptable finish and a junked part or broken bit. Correcting the problem using feedrate as you suggest can quickly turn a 3 hour job into a 20 hour job (personal experience here).

Ideally Mach 4 (I understand it is too late for Mach 3) would not use "CV Dist Tolerance" and  "Stop CV on angles" but instead use a value for maximum path deviation and adjust the "CV Dist Tolerance" depending on the angle of the corner and acceleration settings on each axis.

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Constant Velocity settings worked out ... I think
« Reply #5 on: January 10, 2017, 03:33:50 AM »
Thanks Art for the response, nice and clear.

My main interest is reduction in jerk, i have acceleration pretty high to maintain contour but its an old Bridgeport with a 48" table and no linear guides of course so the direction changes seem pretty harsh, made worse by my machining aluminium with small cutters on a 24K spindle so they need pretty good feed rates.

I might try lowering the acceleration a tad and also lowering feed rates to suit.

In the mind it seems easy to think you can just throw some code at a machine and it will follow the path explicitly but as i found out myself with a junk part and after Arts' explanation this can never really happen unless all factors - machine drive, acceleration, feed rate are in balance.

Offline ART

*
  • *
  •  1,702 1,702
  • Tough as soggy paper.
    • View Profile
Re: Constant Velocity settings worked out ... I think
« Reply #6 on: January 10, 2017, 07:36:41 AM »
>>For example, assuming my understanding is correct. Increasing the "Stop CV on angles" from 5 to 45 degrees increases the error from ~50um to ~500um (~1mm at 90 degrees). 

   I guess my point is that you cant actually describe the error except an  Error per Angle per Feedrate via acceleration. This is because Feedrate has a huge effect on the angular rounding. A 1 IPM 90 degree angle will have pretty much no error ( very very small anyway, while the same settings at 200IPM will have a much much larger error and this is not a linear calculation. M4 uses a modified planner that I am unaware of in terms of internals,  but Mach3's was the original EMC planner that I modified all to hell and back.

>>Ideally Mach 4 (I understand it is too late for Mach 3) would not use "CV Dist Tolerance" and  "Stop CV on angles" but instead use a value for maximum path deviation and adjust the "CV Dist Tolerance" depending on the angle of the corner and acceleration settings on each axis.

  I use a jerk limited planner now for my own work, and it too is a trade-off, all planners are though. Mach4 is rumoured to be able to swap planners at some point in the future, so its
hard to say but it may one day have a jerk limited planner. I find jerk limitation slows a typical program by about 15% or so due to the SCurving. Jerk limiting planners arent a
panacea, but depending on the machine can be very helpful. ( I no longer work on Mach's of any flavour, I mention all this simply as an explanation of how M3 is implemented and how
best to deal with those particular issues. ).

>>I might try lowering the acceleration a tad and also lowering feed rates to suit.
>>My main interest is reduction in jerk,

  Absolutely, when I say use High accel, that means the highest your machine can handle without problems. One persons high is anothers low. Lower ( or raise) your accel till the axis can speed up without jerking your table around, then adjust feedrate when you need to, in order to reduce error. Error tolerance of course is job based, so it really throws out the concept of "load GCode
and run it" being the best you can do for a job. Carefull consideration of feedrates in various sections of code always seemed the best route.

Art
 

Re: Constant Velocity settings worked out ... I think
« Reply #7 on: January 10, 2017, 07:39:37 AM »
Thanks Art!

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Constant Velocity settings worked out ... I think
« Reply #8 on: January 10, 2017, 09:33:05 AM »
Error tolerance of course is job based, so it really throws out the concept of "load GCode
and run it" being the best you can do for a job. Carefull consideration of feedrates in various sections of code always seemed the best route.


It certainly is more complex than i imagined ;)

The job i had is one i do repeats of occasionally, it has long straights and some very small sharp details here and there, Its in aluminium so i use the high speed spindle and rough out with a 5mm tool then drop to a 2mm tool for details - this is fine as the sharp internal corners are made by "dog-boning" the corner so it will accept a square part. When the machine was not following the path Mach ignored the dog-bone completely and instead just made an odd shaped radius which was less than useful :)

Its working now but i only fixed it by upping acceleration - cuts well now but feels less than happy about the sudden and very frequent direction changes. Not having low friction linear ways does not help either as there is a fair bit of friction in dove-tail ways/slides.

Offline ART

*
  • *
  •  1,702 1,702
  • Tough as soggy paper.
    • View Profile
Re: Constant Velocity settings worked out ... I think
« Reply #9 on: January 10, 2017, 10:50:20 AM »
>>Its working now but i only fixed it by upping acceleration - cuts well now but feels less than happy about the sudden and very frequent direction changes

 Therein lies the condundrum. :)

Art