Hello Guest it is July 11, 2020, 05:46:17 PM

Author Topic: How calculate incremental values in each Gcode Line?  (Read 2226 times)

0 Members and 1 Guest are viewing this topic.

How calculate incremental values in each Gcode Line?
« on: June 27, 2010, 01:46:57 PM »

I need calculate incremental values in each axis for a Gcode line, relative to previous line. It's possible this?
I know how doit out of Mach, but I need to do it inside Mach for calculate  longitude of each movement
Out of Mach will be in this way.

Sqr (pot(Xfinal-X initial)+ pot(Yfinal-Y inicial))
Final= Actual line
Initial= Previous line

If this is possible, then I can calculate distance to travel in each line and calculalate spindle speed for
controlling  sincronism of a needle bar (spindle) for each g code line or for about 20 lines
due inertia problems.

In this way I can rotate spindle in calculte speed, and in coordinate movement moves hoop and fabric when needle is
out of fabric.

Thanks for your answer.




Offline BR549

  •  6,932 6,932
    • View Profile
Re: How calculate incremental values in each Gcode Line?
« Reply #1 on: June 27, 2010, 03:09:59 PM »
Rene I don't know of any way to extract what you need from a running gcode. You may want to play with distance to go but it does not look as thought it will help you.  Remember mach moves are stacked into a buffer to run after the stack is created there can be no interaction with them as you are needing.

It can probably be done with a plugin at the core level but not from the user interface "that I know of" You need to ask BRIAN.

Re: How calculate incremental values in each Gcode Line?
« Reply #2 on: June 27, 2010, 10:36:30 PM »

 I was reading a lot  in all Mach publications that are in may hands, didn't find any reference of this.

Embrodery CAM software yes it does, because are an option to select a Max Stitch Length,then software place a JUMP Stitch(spindle stop,solenoid activation,ecc)in all stitches longer that Max sticht declared, that is the answer that we need of Mach.Then of course this software will calculate lenght of all movements (stitches)

I will ask Khalid, may be inside his software are option to do this calculus.

I need to know length to all movements, (stitch length), having these values is possible reduce spindle speed for all longer movements (stitches).

Making trial and error tests, I can determine a speed for sincronizity a max stitch lenght using max pulse frecuency of Mach. If I can sYncronize stitches of 3mm lenght in 480 RPM motor=8stitches/second (8 gcode lines/second),then I need reduce RPM'S motor for longer stitches of 4mm for keep sincronyc work.

For stitches longer that 7mm,I need Jump stitches,these are setted in Khalid embroidery software.

Sorry, but finally I think that this part of job should be in Khalid software. I need write him.



Re: How calculate incremental values in each Gcode Line?
« Reply #3 on: June 28, 2010, 08:19:43 AM »
Seems like a Function/Sub call in a macro pump would handle it easy enough.
Not ever doing it as of yet, just not sure how to pass a value from the Gcode to a VB variable.
I assume that all Axis values are variables being read in.
You just need to pass them into a VB script and do your calculations.
Then display them in a OEMDRO(#) that you create on your Screen.Set
I did mine in a Plugin but it wont work for your app, sorry.

Just a thought: The lookahead value might be an issue.
That one bites me more often then most. Most of the time I leave it at 2.