Hello Guest it is January 22, 2022, 06:00:15 AM

Author Topic: VB to change accel and de-accel for G0 and G1  (Read 3013 times)

0 Members and 1 Guest are viewing this topic.

VB to change accel and de-accel for G0 and G1
« on: March 20, 2015, 03:50:55 PM »
Good day all

I did a retrofit on a commercial Italian cnc router last year as the pc packed up and there are no more support for these machines. My client has two of these, one is still running the factory fitted pc and software. What I have noticed is that when the machine (running under old software) executes a G1 movement it uses exact stop with a slow de-accel, for g02 and g03 it operates under CV mode and when G0 gets executed, the machine has a very high accel and de-accel.

Machine running Mach, when running under CV mode, it seems to be very jerky unless I trim the accel way down but becomes an issue when running in CV mode. (rounded corners etc)

My idea is to have a macro to increase the accel and de-accel by say 50% when a G0 move is executed and uses the pre-set accel for both G1 and G03/G02 moves (motor tuning settings). I can then use CV tolerances to cancel CV mode for angles say larger that 30 degrees. It works very well on the old machine as at the end of each G1 move the machine comes to a gentle stop and then start the next move without any rounded corners when not needed (even at very high feedrates), arc moves are smooth as they flow into each other and falls within CV mode, even with the tolerance set up.

The AC Servo's and drives fitted to these machines are very powerful and can handle very high speeds and accelerations so this won't be an issue.

Can someone please help me with such a Macro or even basic macro which I can modify if need be? I must ad that I only started doing basic VB last year so do apologize upfront if I don't understand all the lingo.

Kind regards

Offline mbele

*
  •  58 58
    • View Profile
Re: VB to change accel and de-accel for G0 and G1
« Reply #1 on: March 20, 2015, 04:29:43 PM »
Hi, I had similar idea, wanted to increase velocity and decrease acceleration for G0 moves and the other way arround for G1/G2/G3, but abandoned it without trying... Idea was to insert M command before each G0/1/2/3 containing SetParam commands for accel and velocity, something like:
M for rapid:
SetParam("VelocitiesX",10000)
SetParam("VelocitiesY",10000)
SetParam("VelocitiesZ",10000)
SetParam("AccelerationX",1000)
SetParam("AccelerationY",1000)
SetParam("AccelerationX",1000)
M for interpolation:
SetParam("VelocitiesX",6000)
SetParam("VelocitiesY",6000)
SetParam("VelocitiesZ",6000)
SetParam("AccelerationX",4000)
SetParam("AccelerationY",4000)
SetParam("AccelerationX",4000)
(check Mach3_V3.x_Macro_Prog_Ref.pdf, there's a link somewhere on the forum)

However, high acceleration will give you feed rate that is much closer to commanded one on short path segments, and if path consists of many small moves it may seem jerky if machine frequently changes direction... with low accel machine will not reach high feed rate on short segments so motion will be less jerky. Maybe you can just lower the feed rate for those parts of toolpath that contain small segments and solve your problem... I think that the only way to get that smooth movement with high feed rate over short segments is with S curve acceleration.