Hello Guest it is June 19, 2019, 09:43:50 AM

Author Topic: DRIVING A STEPPER MOTOR LIKE SPINDLE  (Read 7099 times)

0 Members and 1 Guest are viewing this topic.

DRIVING A STEPPER MOTOR LIKE SPINDLE
« on: June 03, 2010, 11:49:28 PM »
Hello

 I want to drive a stepper in continuous running like a spindle and drive it at different speeds. Mach will be set in Single Block Mode and speed change will be applied using a rotary shutter and optical switches.  I need to know.

1-In what axis in controller should be connecting it?

2-For Start may I use for example M3 S500?

3-What command stops it?

4-How can stop it at exact point?

Thanks in advance for your help.

Regards

Rene

Offline Hood

*
  •  25,844 25,844
  • Carnoustie, Scotland
    • View Profile
Re: DRIVING A STEPPER MOTOR LIKE SPINDLE
« Reply #1 on: June 04, 2010, 03:36:34 AM »
You can set up a stepper as a spindle motor and M3/M4 will select rotation with the S word controlling the speed, M5 stops it.
You can set a stepper as an A axis and use it for positioning but you will need to command a move on every line for it to keep spinning but it will work like a normal axis when others are moving, ie when it is coming to the end of the line it will slow, CV would help.

You can do a combination of both by having it set as a spindle for normal running then use SwapAxis() to change to A axis mode when you are wanting positioning.

Not sure if any of this will work for you though, just depends on how exactly you are expecting things to work.

Hood
Re: DRIVING A STEPPER MOTOR LIKE SPINDLE
« Reply #2 on: June 04, 2010, 11:43:19 AM »
Hello, thanks for your answer,
 
Now situation is more clear for me, three questions more

May I connect always stepper in A axis connectors in any configuration (Normal Axis and Spindle)?

Where can I find in Mach Swap Axis button? ,,is this option in Mach 3 1.83.027?

I think this help me, because I only need to positioning, when thread is break ( Macro setting Swap Axis (Spindle Mode to A mode)  and Free Hold, using a optical switch ) or when I need to change thread color ( same macro), in this moment I need to set needle in upper position and iis useful swapping spindle to A axis in this moment.

then I will use

1-Macro for break thread will be  called by  an OEM TRIGGER ----It's possible?
2-Macro for change thread will be called by g code line.

Thanks a lot again

Regards

Rene

Offline Hood

*
  •  25,844 25,844
  • Carnoustie, Scotland
    • View Profile
Re: DRIVING A STEPPER MOTOR LIKE SPINDLE
« Reply #3 on: June 04, 2010, 01:53:39 PM »
When you use the swap axis function the A will not know where it is untill you home it so you would need to have a home switch fitted.
SwapAxis(3,6) should swap the spindle and the A around and calling ResetAxisSwap() should put them back to the original way.

It should be in that version as it has been there for a long time.

I think you will have problems calling a macro from an oem trigger though as plugins or Brains were not available in that old version of Mach and I think you would need them.

Hood
Re: DRIVING A STEPPER MOTOR LIKE SPINDLE
« Reply #4 on: June 04, 2010, 05:07:35 PM »
With a stepper as a spindle motor, is rigid tapping possible? It would have to be a dirty great big stepper for production milling, how big do they get?

Offline Hood

*
  •  25,844 25,844
  • Carnoustie, Scotland
    • View Profile
Re: DRIVING A STEPPER MOTOR LIKE SPINDLE
« Reply #5 on: June 04, 2010, 05:18:05 PM »
Yes, if you had it as an axis you should be able to rigid tap no problem. Would be better off with a servo though as even if you get a stepper with the torque its not likely it will have the speed for a spindle.
Hood
Re: DRIVING A STEPPER MOTOR LIKE SPINDLE
« Reply #6 on: June 04, 2010, 05:32:35 PM »
Interesting. I may have to look into this a bit further :)

Offline Hood

*
  •  25,844 25,844
  • Carnoustie, Scotland
    • View Profile
Re: DRIVING A STEPPER MOTOR LIKE SPINDLE
« Reply #7 on: June 04, 2010, 05:36:39 PM »
I will probably do it at some point if the SmoothStepper ever supports SwapAxis and also Backlash as I would need that due to the slop in the splines in the spindle drive.

Hood
Re: DRIVING A STEPPER MOTOR LIKE SPINDLE
« Reply #8 on: June 04, 2010, 11:04:51 PM »
Hello

I was receiving a good quantity of good answers, I appreciate and thanks a lot for that, but I have a problem that may be is a general concept on how to do this project.

 I need to explain, best that I can how is desired work. In a CNC embroidery machine, First spindle begins rotate and needle is going down, when motor complete 285 degree of rotation  needle  is going out of fabric, In this moment , machine should begins to move hoop to next position and  complete stitch before needle begins penetration in to fabric, this movement is made for X and Y axis. Needle motor speed in each rotation depends of length of stitch; g code must reduce motor speed at beginning of rotation to give chance hoop to complete movement, this is calculated in CAM program previously. If are a long  stitches bigger than embroidery machine can do with usual feed of thread , then is necessary to release thread tension using for example a solenoid, that must turn of when hoop finish movement  when is not necessary more time releasing thread tension and turn off when motor is rotate about 330 degree.  Personal and commercial embroidery machines uses rotary shutters for operate sequentially operations, but I don’t know in what way this rotary are actuating. I have two   theories about how it works, please give me a ray of light…
 
1erst VARIANT
G00 X1.2 Y2.2 M3 S500
G00 X2.5 Y5.3 M3 S350 M7
Cont…..
M3 S500 will be activated by rotary shutter1  at 1 degree of rotation
X1.2 Y2.2 will be activated by rotary shutter2 at 285 degree of rotation
M7 will be activated by rotary shutter3 at 330 degree of rotation.(NC circuit)
M9 will be activated by rotary shutter3 at 359 degree of rotation.(NO circuit)

I s possible to do this,, and  works?


2nd-Variant (Working   in single blk mode)
M3 S500------------Manual start
M9-Activated by rotary shutter No 2 at 45 degree, open a NO circuit and turn off a solenoid (if is activate)
G00 X1.2 Y2.2-----Activated by rotary shutter 1 at 285 degree, OEM TRIGGER #1---Cycle start
M7 ---------------Activated by rotary shutter 2, closes a NO circuit and solenoid turn on
S350---------Activated by rotary shutter at 1 degree of rotation, OEM TRIGGER # 1,  set new speed
Cont…

Sequence of Gcode lines corresponding to sequence in rotary shutters rotation angle activation.

I want to reduce the number of lines in G code but I don’t if is possible.

I have a doubt, Hood explain me that  may be Single BLK mode don’t run as fast like I need , because it I can run  embroidery machine at 480 stitches per minute, it means 8 stitches per second,, the same to say 1 stitch each 133 Milliseconds. Then should be considerate response time for optical switches plus Mach 3 time response for continuous Cycle start in Single BLk mode.

Thanks in advance for your help.

Regards

Rene

« Last Edit: June 04, 2010, 11:23:59 PM by renenpaz »

Offline BR549

*
  •  6,873 6,873
    • View Profile
Re: DRIVING A STEPPER MOTOR LIKE SPINDLE
« Reply #9 on: June 05, 2010, 12:12:30 AM »
Hi Rene, The i/o sampling rate for mach using the VB engine is ONLY 10hz or 10 time per second, FAR FAR too slow for what you want. ALSO there can be a sync problem in vb/gcode where proceesses may get slowed down from high CPU loads.

This could create HUGE problems in keeping your machine in sync.

That said it may be possible to do it all in gcode with the striching being controlled with a stepper/servo motor that drives the head up and down through a mechanical motion conversion, rotary to osilating linear. Tha way it is posible to sync all moves to the position of the head.

BUT it will be a very very hard thing to GCODE as the head moves will be required to be broken down so xy can only move in specific periods and even then I am not sure they can be ran very fast as the speed b be controlled by the slowest axis and the more MICRO moves it has it the Z axis the slower the processing becomes.

For what you need you may want to consider a realtime motion controller board that can run at extremely high sample rates .

Hope that helps