Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: tanihera on July 24, 2013, 11:13:04 PM

Title: Really basic spindle control question
Post by: tanihera on July 24, 2013, 11:13:04 PM
Hi guys - I'm new to all this - my 1st post, 1st mill, 1st project.....

I'm evaluating a Mach3 trial with a view to purchase.  Installation and configuration went well, and all operates  as it apparently should.
 -
When I start a gcode run, the spindle (pwm control) starts as expected when the M3 is encountered, and stops on M5 as expected.   During a gcode run if I click Stop, gcode execution pauses and the spindle stops, when I click  CycleStart gcode execution resumes as expected.
 
But I don't understand this:  when I click CycleStart to resume gcode  execution, why does the spindle not restart too?  There has been no M5 to stop it, so technically, to me, the gcode is broken by the CycleStart function not having performed a full 'resume'.
 
Perhaps this by design, but I have now broken two tooltips.  And what else is not restored on a restart?  Is there is a preference/configuration setting to toggle this that I've missed?
 
Otherwise, great program!  As a software engineer myself, I can see the years of work that have gone into this.  Alternatively for my spindle issue, is there an "ExecutingGcode" output from Mach3 that simply tells hardware that gcode is executing?
 
Cheers and thanks
PS: The capcha box on your ContactUs screen fails every time.
Title: Re: Really basic spindle control question
Post by: Mstcnc on July 25, 2013, 01:33:18 AM
You should not use stop if you want continue cutting just pressing cycle start. You should use pause. Although pause do not work in midle of circle and I think it can not be used very well in subroutines. You could loose position when use stop as axis do not declerate at all. Some servo systems can handfle that, ut steppers do not. To stop whitout loosing position is use pause and after machine do not move press stop.

Correct way to continue after stop is use "run from here" but I think it is not functinal in demo, needs to have license
Title: Re: Really basic spindle control question
Post by: tanihera on July 25, 2013, 04:24:22 PM
Many thanks for your help Mstcnc.  Some good info there I didn't know. 

But pause?  I don't seem to have a 'Pause' button, or anything like it.  The reasons I need to pause are to change tooltips, tweak Z zero, and check part dimensions.  Is there an accepted way to do this without restarting the spindle manually?  A document reference would also be good.

I gather there are alternative Mach3 screens - has anyone made one with more of a video player control metaphor, do you know?  Or is such a thing even possible?

And again, does Mech3 have an output signal that just says gcode is running, anyone?

Title: Re: Really basic spindle control question
Post by: Mstcnc on July 26, 2013, 01:52:51 AM
<Correct way to continue after stop is use "run from here" but I think it is not functinal in demo, needs to have license>

Run from here is correct way to do restart after tool tip change and more likely only way to start correct coordinates and offsets if you make modification those.
It is explaned in mach manuals, which you will find in http://www.machsupport.com/help-learning/product-manuals/

Which version you are using and are you using standard screen set?

I donĀ“t know for sure or more specific how to make output active when code is running, but that do not mean that it is not possible.... maybe in brains it could be possible?

-M
Title: Re: Really basic spindle control question
Post by: tanihera on July 30, 2013, 01:03:16 AM
Thanks again Mstcnc

Sorry about the delay in responding - I've been out of town on a family matter for a couple of days.  
I'm just using the latest trial version - 3.043.066 - with a view to purchase.
I'm guessing you are calling the FeedHold button "pause" - OK.  As far as I can tell, RunFromHere recalcs the last valid position from the start of the Gcode up to the stopped line number, then waits for CycleStart.  RunFromHere allows a CycleStart from any gcode line as expected.
 
That's all much clearer now, thanks to you, but I'm still looking for a way to stop Gcode from running unless the spindle is running first.  Mach3 handles it if X or Y is moved by preceeding further gcode execution with the "PreparatoryMove" dialog, there's no such protection if only Z moves as often is the case for a toolchange.

Which is how I broke another tooltip today.  Any further ideas? Anyone else?  Pretty *please*....
Title: Re: Really basic spindle control question
Post by: ger21 on July 30, 2013, 09:19:06 AM
Run from her has an option to start the spindle I think.
Also, there might be an option to not stop the spindle on Stop? Don't have Mach3 on this PC, so I can't check.
Title: Re: Really basic spindle control question
Post by: Hood on July 30, 2013, 09:26:45 AM
If all you are wanting to do is check the spindle is running before code can be executed then that would be relatively simple but would depend on your spindle setup as to how its done.

BTW RFH will not work in demo mode.

Hood
Title: Re: Really basic spindle control question
Post by: stirling on July 30, 2013, 09:49:59 AM
The reasons I need to pause are to change tooltips, tweak Z zero, and check part dimensions.  Is there an accepted way to do this without restarting the spindle manually?

I might be missing something here but if by "change tooltips" you mean "change tool" then surely you don't need to feedhold and run from here - you just have the correct toolchange sequence in gcode (M6 T.../M3 etc.) and tick "stop spindle - wait for cycle start in toolchange on the config screen.

Ian
Title: Re: Really basic spindle control question
Post by: tanihera on July 31, 2013, 06:19:56 PM
Greetings Gerry, Hood, and Ian - thanks for your comments.

As I said above I'm very new at this, and haven't attempted a toolchange under gcode control yet.   I've glimpsed some postprocessor gcode for toolchanges, but I know nothing about the accepted process.

I've simply been trying different tools (3mm shaft) with ad-hoc toolchanges to assess suitable feedrates, cutdepths, and spindle speeds in MDF.  I'm evaluating MeshCam at the same time.

If RFH doesn't work in the demo, as Mstcnc also mentioned, it explains a lot.  But you're correct Hood, a safeguard that either starts the spindle before the gcode, or a check that the spindle is running before the gcode is, is exactly what I'd like.

My spindle is simply PWM controlled by Mach3 as per the setup manual, with a simple manual isolator and estop override.  Hood, can you suggest where I look to find how to implement such a safeguard?  I'm hoping there's a way to hold the gcode until the spindle has ramped up.

I'm mighty grateful for all your help.  
Title: Re: Really basic spindle control question
Post by: Hood on July 31, 2013, 06:40:41 PM
There are severla ways to accomplish the code not running unless the spindle is on, however if Mach is controlling the spindle on/off then the only real way would be to use a macropump, for that you will need an index pulse to Mach so it knows the RPM.


Regarding ramp up/down, there are settings on General config for that, it will delay the code continueing for the time you have set there.
Hood
Title: Re: Really basic spindle control question
Post by: tanihera on August 02, 2013, 04:52:00 PM
Thanks Hood - I've built the index pulse h/w and it's ready to install.  I knew this was a must, but it kept slipping down the priorities list. 

Can you give me some pointers as to implementing a macropump for this purpose?  I've searched the forums and now have a general idea of what a macropump is and how it works. 

Most grateful for your help!
Title: Re: Really basic spindle control question
Post by: Hood on August 03, 2013, 05:28:23 PM
I had a macropump at one point that would compare commanded spindle speed and true spindle speed and if they were different by a user set % it would call an E-Stop. I was unable to use it as for some reason it didnt play with Modbus enabled and I needed modbus for my turret on the lathe.
Anyway that may or may not be what you are wanting, I would have to read again to see what exactly you are after but maybe it would be easier if you just say again as I think things have changed a bit since your initial post.
Hood
Title: Re: Really basic spindle control question
Post by: tanihera on August 05, 2013, 06:43:45 AM
Yes Hood, this discussion has clarified the issue for me. 

The problem for me is that if gcode is executing where an M3 has started the spindle, and then I pause gcode execution, the spindle doesn't restart when I click CycleStart.  Since an M5 has not been executed, I want the spindle to restart on a CycleStart.

If I manually move the X or Y axis during the pause, the PreparatoryMove dialog is invoked giving an option to restart the spindle.  I really like this.  But not if I  move only the Z axis. 

So the best solution is a macro/whatever to invoke the PreparatoryMove dialog if the Z axis moves, just as it does for X or Y.  Alternatively. a macro/whatever to restart the spindle when CycleStart is clicked to terminate a pause/FeedHold.

Is either possible?  I'll be away with family for the next 7 days, so no hurry for a reply, but I'd sure appreciate your thoughts in due course.
Title: Re: Really basic spindle control question
Post by: Hood on August 05, 2013, 07:29:41 AM
Ok I think you have to be very careful having the spindle start automatically from a button such as Start.
 The safest method would just be to make the cycle Start button a VB button and for it to pop up a message box on screen telling you to start the spindle if its not already running. You would have to press OK to acknowledge you had seen the message before it would start running the code.
 Would something like that suit you?

Hood
Title: Re: Really basic spindle control question
Post by: ger21 on August 05, 2013, 08:34:56 AM
Quote
The problem for me is that if gcode is executing where an M3 has started the spindle, and then I pause gcode execution, the spindle doesn't restart when I click CycleStart.


Your spindle shouldn't be stopping when pressing feedhold. What exactly are you doing to get it to stop? Feedhold by itself doesn't stop the spindle.
If you're using Stop after Feedhold, then you should be using Run From Here, which as I mentioned before, will give you the option to Start the spindle.

I agree with Hood, that having a macro start the spindle can be very dangerous, as you may see the spindle start when you don't expect it to.
I ran into this issue while working on my auto zero during tool change macros. I realized that the only truly safe method was for the g-code to start the spindle.
Title: Re: Really basic spindle control question
Post by: tanihera on August 14, 2013, 06:01:43 PM
Many many thanks, guys.   I said I'd be away, didn't know I'd be on another planet with no 'net.....

Gerry, yes I hit Feedhold to stop axis movement as Mstcnc recommended, then lift the Z-axis to ease tool heating, then hit Stop.  Hood, yes I'd like to know how to organise that macro regardless.  I've been a VB/VBA programmer for many years, and would like to see how VB talks to Mech3.

If RunFromHere has a spindle start dialog in the purchased version, then my problem is solved right there.  The demo RunFromHere works, just no dialog. 

Seems an odd function to cripple out in a demo version.  Is there a list of demo/purchased differences somewhere?

Again, many thanks everyone.  I'll purchase this week.


Title: Re: Really basic spindle control question
Post by: tanihera on August 14, 2013, 06:10:14 PM
Oops.....I should have asked, Gerry/anyone - can you confirm that there is definitely a SpindleStart dialog on RunFromHere if only the Z-axis is moved?
Title: Re: Really basic spindle control question
Post by: ger21 on August 14, 2013, 10:17:08 PM
As far as I know, Run From Here does not work in the Demo version. If you're not seeing the dialog box for a Preparation Move, then Run From Here is probably not working for you. If I remove my license file, Run From Here will not work for me.
When you click Run From Here, Mach3 reads the g-code from the beginning up to the current line. It then asks you to click Cycle Start. Upon clicking Cycle Start, the Preparation Move dialog box will open.

In Mach3, your either in the middle of running g-code, or your not. It doesn't matter what you've done prior to using Run From Here, you always get the Dialog box to do a preparation move, which includes the option to Start the Spindle.