Author Topic: Setting acceleration percentage in Gcode  (Read 12114 times)

0 Members and 1 Guest are viewing this topic.

Offline krisverheyen

  • Active Member
  • Posts: 40
    • View Profile
    • Tulip Laser Processing
Setting acceleration percentage in Gcode
« on: June 20, 2007, 10:34:58 AM »
Hello,

For some applications controlling accelleration would be handy, like lasercutting small contours in steel with oxygen or when your machine is shaking like boogie woogie when cuting that odd contour.
I see it this way
G0 X100 (move x to 100)
G1 X150 E50 (move x to 150 with acceleration set to 50%)
G1 X100 E100 (move x back to 100 with acceleratin set to 100%)
We have a machine with comparable function (the O letter is used)
I know you can use them systemparameters, but if your script does something strange, or your program gets interrupted before end, your values are messed up.

Anyone who likes this idea?

Kris
Logic takes you from A to B, imagination takes you anywhere

Offline krisverheyen

  • Active Member
  • Posts: 40
    • View Profile
    • Tulip Laser Processing
Re: Setting acceleration percentage in Gcode
« Reply #1 on: June 21, 2007, 08:52:48 AM »
Hello everyone,
Turned out it was an easy fix.
Wrote a macvro wich can be called in the following way.

M1500 P100

with the P-word as percentage

Macro code below

Rem This Macro sets accelleration according To the P paramater
'You have to set up your acceleration values here in the constant values in stead of
'in the motortuning page, because this values get altered
some comments
'"AccelerationX" = X Max Accel from motor tuning page
'"AccelerationY" = Y Max Accel from motor tuning page
'"AccelerationZ" = Z Max Accel from motor tuning page
'"AccelerationA" = A Max Accel from motor tuning page
'"AccelerationB" = B Max Accel from motor tuning page
'"AccelerationC" = C Max Accel from motor tuning page
'GetParam( String ) and SetParam( String )
'start of program
Option Explicit
Dim PValue
PValue=Param1()/100
Const MaxAccellX=2500
Const MaxAccellY=400
Const MaxAccellZ=400
Const MaxAccellA=900
'Const MaxAccellB=400
'Const MaxAccellC=400
'Better make shure no movement is going on wshen changing such parameters
While Ismoving
Wend
Call SetParam ("AccelerationX",MaxAccellX * PValue)
Call SetParam ("AccelerationY",MaxAccellY * PValue)
Call SetParam ("AccelerationZ",MaxAccellZ * PValue)
Call SetParam ("AccelerationA",MaxAccellA * PValue)
'Call SetParam ("AccelerationB",MaxAccellB * PValue)
'Call SetParam ("AccelerationC",MaxAccellC * PValue) 


It is best to set M1500P100 in your initialisation string (General config)or make shure it is called at the start of every program,
And maybe also to check "Use Init String on ALL "Resets"

There's no validation so you can, for certain moves, set accelleration to for example 120%.
offcourse you need to be carefull with that!
The function is mostly intented to lower accelleration for certain moves
Hope someone has some use (or fun  ;D ) with this,
Greetz,
Kris.
Logic takes you from A to B, imagination takes you anywhere

Offline andert1

  • Active Member
  • Posts: 4
    • View Profile
Re: Setting acceleration percentage in Gcode
« Reply #2 on: May 29, 2012, 02:07:46 AM »
Hi Kris,

I think I followed your thread pretty well.  Would your g code solution work for the problem I described here?

http://www.machsupport.com/forum/index.php?topic=21674.0

Thanks,
Tim