add value at any number in string
Hy all!
I build a automatic foam cutter machine ,and for semplicity i modify potrace program that transform raster to vectorial ... to make gcode ...is javascript ... but is not important the language.
For curiosity you can test here <<snipped>>
So... you make a image in paint or copy for internet , and with this program van transformate quickly in gcode a and can cut!
But motors of my machine is with wheel teets , and is not precise ... so .. when inverse the movement ... the motor begin rotate after few steps ... and the cut is not accurately!
MY QUESTION!
I want to insert a function ... when value change ... add a small value to actual value...
for example ,i have:
G01 X0
G01 X7
G01 X3
G01 X1
G01 X20
G01 x27
G01 X14
So i have 0,7,3,1,20,27,14
so 0 ... 7 motor motor begin rotation to one sense
7...3 motor change sense rotation ... but rimain stopped until wheels teets begin traction
for example when change direction the motor rimain stopped 1 step ... so ... the cnc not arrive a 3 ... arrive a 4 ...
i not shure that you understand!
And need to find a formula to compensate this by program! I not shure that function in practice ... but i can try!
Thanks in advance!