Hi.
I need your help about our cnc zone embroidery project work.
I am trying to run embroidery machine using a continuous mode motor for needle movements, using a stepper motor. For optimum results I will test, if is possible to combine Spindle mode for continuous rotation and A axis mode for homing and stop motor in needle upper position. Work mode will set in Single BLK for run line by line, I need to explore if sequence, synchronicity and speed is than we need for this project.
I will use two rotary shutters in embroidery machine rotor shaft. First shutter will be aligned at 0 degree of rotation will be for homing spindle motor in upper needle position, using A axis mode. Second rotary shutter will be aligned at 285 degree of rotation, and will activate OEM TRIGGER 1 code 301, and call a Macro M900.m1s
Default setting of motor is A axis, for initialization of needle at upper position, X and Y axis are initialized at 0.00.
Gcode example
N01 Macro (Swap A axis mode, Spindle mode)—Change from A axis mode to Spindle mode.
N02 M3 S100---Start rotation of spindle 100RPM
N03 G01 X1 Y1 M3 S100—X and Y movement to first stitch coordinates.
N04 G01 X6.5 Y15.5
N06 Macro (Swap Spindle mode, A axis mode)
N07 Macro (Home A axis).
M30
We need to use a macro between two G01X and Y movement lines to define next operations. This macro will be - SetTriggerMacro(M900.m1s) It will be activate by 2nd rotary shutter at 285 degree of rotation, when needle is going out of fabric and at 3-5mm above table.
I need to know if is possible to do and execute a Macro like this.
MACRO 900.m1s
Calculate travel distance between previous and next X and Y movements, and compare results versus Max Stitch length, then will execute macro M901 or Macro 902. Max Stitch Length = 12.7mm
In hypothetic example (I don’t have idea about how referees to previous and next X and Y values in formula for Macro)
If Sqr (X1- X0)2 + (Y1-Y0)2 >Max Stitch Length, then M902.m1s, if not M901.m1s
Stitch Length = 1.4142mm < 12.7 mm, then M901.m1s
Macro 901.m1s
1- Run Next G code Line.
2-Calculate new Spindle speed (formula)—it’s in accordance to distance to move X and Y axis at max speed, in 40% of one spindle rotation. I have all formulas in excel table.
3-M3 S (calculated).
Hypothetic situation for execution of M902.m1s--- Is when are Jump Stitches between embroidery objects, They are longer than embroidery machine thread feed capacity
Example lines
N04 G01 X1 Y1
N04 G01 X6.5 Y15.5
Sqr (x6.5-x1)2 + (y15.5-y1)2 = 15.50mm > 12.5mm, then M 901.m1s
Macro 901.m1s
1- Swap (Spindle mode x A axis mode)
2- Homing A axis ----Spindle in A axis mode will runs until rotary 1 shutter will activate A axis home switch and stops when needle is in upper position.
3- M7----Activate a solenoid for release thread tension
4- Run next G code Line (N04) –Movements of X and Y axis.
5- Swap (A axis mode x Spindle mode).
6- M9---Deactivate solenoid.
I think that maybe it’s necessary use Single BLK mode, to guarantee appropriate sequence.
In this way program will execute continuously, using only one rotary shutter for Macros execution.
Lasts post ago explain me here, that is possible that Mach don’t have high speed frequency operation for this quantity of operations needed, If we want to run embroidery machine at 480 Stitches per minute, Macro 900.m1s will be executed 8 times in a second . I don’t know if this is possible. May be is possible to do that Mach calculate this formulas when file is loading and later execute without calculations
Sorry my long post,,, is not easy explain all these, having small knowledge of this theme.
Thanks in advance for your help
Regards
Rene