Hello Guest it is May 08, 2021, 09:54:48 AM

Author Topic: Help with macro with two macros inside. Cnc embroidering project  (Read 12985 times)

0 Members and 1 Guest are viewing this topic.

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
Re: Help with macro with two macros inside. Cnc embroidering project
« Reply #1 on: June 08, 2010, 09:01:17 PM »
Sorry,
 
Forget to set last line in Macro M901.m1s

7-M3 S100
Motor star again and cycle continue.


Hoping, some one can help me

Regards

Rene

Offline BR549

*
  •  6,952 6,952
    • View Profile
Re: Help with macro with two macros inside. Cnc embroidering project
« Reply #2 on: June 10, 2010, 10:57:16 AM »
HIYA RENE, I see you are not getting any help (;-). I have looked at your process AND don't have much hope for it to work BUT I am a sucker for complex projects SO I will give it some more thought and get back with you shortly.

I fear that you will run out of time to get everything done in a manner that would make it productive(more than 1 stiches per sec if that)

StandBye(;-)
Re: Help with macro with two macros inside. Cnc embroidering project
« Reply #3 on: June 10, 2010, 11:14:46 PM »
Hi BR549.

Thanks for your post.

I think that this is not a very interesting project for this forum. In fact embroidery is too far of milling or turning  :o . Also embroidery technology is very well hiding for builders. I have looked hundred of patents looking for information, but only general information is there.  When Khalid’s free his Embroidery Gcode Generator software, I made some embroidery test using my CNC router and my wife’s sewing machine and was possible to do some small embroidery tests.  Now I have last actualized version of program.

In my first  embroidery test, I ran a embroidery gcode file generated by last updated version of this software and controlled for Mach 3. In this moment rate was more and less 150 Stitches/minute. I thing that if is possible run a continuous motor, synchronizing motor rotation and horizontal translation, then is possible increase Stitches x minute, like computerized embroidery machines that runs over 600SPM.

Some links
http://www.youtube.com/watch?v=Gyr4gRsjL6w
http://eclipseproyect.blogspot.com/
DIY Computerized embroidery machine, Peru 2006.


http://www.lobosolitario.com/foro/general/proyecto-de-construccion-de-bordadora-computarizada-solicitud-de-informacion/msg103943/#msg103943
Link to Lobo Solitario Spanish forum for building an embroidery machine

 http://www.cnczone.com/forums/showthread.php?t=57404&page=24
Link in CNC ZONE for embroidery machine bulding

Hope you can give me a hand in this work.

Thanks in advance.

Rene
« Last Edit: June 10, 2010, 11:18:52 PM by renenpaz »

Offline Tweakie.CNC

*
  • *
  •  8,706 8,706
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Help with macro with two macros inside. Cnc embroidering project
« Reply #4 on: June 11, 2010, 01:57:12 AM »
Hi Rene,

Quote
I think that this is not a very interesting project for this forum. In fact embroidery is too far of milling or turning

I disagree and think this is a very interesting project for the forum. I, for one, no nothing about Mach's role in machining fabrics but I am keen to learn and it's only by people such as you posting these topics which gives me that opportunity.

Tweakie.

KEEP SAFE !
Re: Help with macro with two macros inside. Cnc embroidering project
« Reply #5 on: June 11, 2010, 09:09:02 AM »
Hi Tweakie.CNC,

Sorry, I was trying to express that Embroidery Job is an speciality a lot different to Milling Jobs, relative to kind of materials, work enviroment, ecc, about CNC is very interesting, and I think that a little more complicated that milling, because it will be synchronized some activities in short period of time (5-6 times/second o more).  

Hope this theme calls  people like you with interest in develop a more accurate  mode to run a  g code for embroidery.

Thanks for your post.

Sorry my bad english and if some words can be misunderstood.

Regards

Rene





 
Re: Help with macro with two macros inside. Cnc embroidering project
« Reply #6 on: June 11, 2010, 12:58:50 PM »
Hi, Attached is Embroidery Graphic in accordance to G code Posted ( X and Y values vary)

This is a semi continuous mode, using Z axis , I need to find a solution for use a continuous running mode
and move hoop when needle is above fabric, Here some posts ago in other thread Poppabear suggest me
a combination between stepper using in Spindle mode and A axis mode, first guarantee continuous run mode
and A axis is for exact stop, using a SwapAxis

 I have a lot of formulas about this, for calculate new spindle speed, for calculate jump stitch.
Also attach a excelt table for generate a Gcode using X and Y movements from DST FILE
in this case majority of work is in Khalid's embroidery Gcode generator software.

Regards
Rene

Offline BR549

*
  •  6,952 6,952
    • View Profile
Re: Help with macro with two macros inside. Cnc embroidering project
« Reply #7 on: June 11, 2010, 08:27:40 PM »
oK what was it about the Gocde method that you did not like???

The gcode method is the practical approach at this point. with fast and powerfull SERVOs you would be able to get some speed.

I have reveiwed the basic process and I don't see how mach could do it useng macros and getting any speed out of it. Far to many problems to overcome in Gcode/VB

NOW it may be possible by doing it in a plugin in C++ as you are not limited to the 10hz looptime. You should be able to sample at kernal speed

Just a thought,

Offline khalid

*
  •  213 213
    • View Profile
    • My Wood carving
Re: Help with macro with two macros inside. Cnc embroidering project
« Reply #8 on: June 12, 2010, 09:23:58 AM »
My This software is Free for everybody.. This software convert standart DST file format into Gcode.. The coding is little complicated but you will get 100,000 lines of Gcode within a second...

I am really thankful for Rene for working and thinking out of the box to get this software a new life..
The software also backplot each stitch movement and can give you time estimation of each thread color.. It also stop the machine in needle upward condition for thread change..

More can be seen
www.my-woodcarving.blogspot.com

Offline khalid

*
  •  213 213
    • View Profile
    • My Wood carving
Re: Help with macro with two macros inside. Cnc embroidering project
« Reply #9 on: June 12, 2010, 09:29:01 AM »
I must say Rene is genious.. I wish i have time for working with him... hi, Rene once your working completed i will make the changes in Gcode embroidery software..

Currently very busy in other projects...:(