Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Cbyrdtopper on December 04, 2015, 12:03:05 PM

Title: Moving an axis while code is running.
Post by: Cbyrdtopper on December 04, 2015, 12:03:05 PM
I'm trying to find a way to move an axis for my coolant while the code is running.  Is there a way Mach 3 can do this?  I have tried writing a Macro linked to a button to move it, I was thinking it would trigger the macro at the end of a G Code line but it didn't seem to work at all.  Any thoughts?
-Chad
Title: Re: Moving an axis while code is running.
Post by: robertspark on December 04, 2015, 05:34:32 PM
Hello, can you explain why you are using an axis to control to provide coolant?

Normally people just toggle a relay on and off to turn the coolant on and off.
Title: Re: Moving an axis while code is running.
Post by: Cbyrdtopper on December 04, 2015, 05:51:31 PM
We bought a Haas VF3 that had programmable coolant, I took out the gear motor and put a Nema 17 Stepper motor in it.  It works fantastic.  I only have 2 nozzles now instead of needing 4.  The problem is, I want to be able to move it during cutting.  Forward thinking tells me it might get off of a tool here or there so I would like make it adjustable while cutting. 
Title: Re: Moving an axis while code is running.
Post by: robertspark on December 04, 2015, 06:00:18 PM
Are you using the parallel port or a motion controller?

You could use the torch height control function... But that will not only work with a z axis
That will work whilst code is running,  it you will need to rename your z to another axis and change your gcode.

You could run a macro to move one axis but this will only work at the end of a line of code but not whilst an axis is busy.

How are you going to know how far you need to move the axis?  Will it be different every time you want to move it?
Title: Re: Moving an axis while code is running.
Post by: Cbyrdtopper on December 04, 2015, 06:02:59 PM
I thought about the torch height control.  But my OCD side kicked in and said no haha.  I have a macro that reads a DRO that you type in an increment amount and it moves the axis that amount. Also I have a macro that reads a DRO that moves to a certain position. 
Title: Re: Moving an axis while code is running.
Post by: Cbyrdtopper on December 04, 2015, 06:57:21 PM
Sorry, I am using the ESS as my motion controller.
Also, for fun.
Watch "Programmable Coolant Haas VF3 Mach3 Retrofit." on YouTube
https://youtu.be/oW7-6PHisHg
Title: Re: Moving an axis while code is running.
Post by: robertspark on December 05, 2015, 05:57:43 AM
One thing to consider with the ESS is data (movement) is worked out in advance and then packets of tradjectoy data are sent to the motion controller.

Once the packets are sent, injecting movement won't be possible unless via THC (and that is a little uncontrolled) or m10/m11 input

Not an expert here and never tried it myself, but I'd suggest trying the the following:
Either setup brains or the macropump to look for a keyboard press (oemtrigger) or an input switch toggle, then create an mcode that brains or the macropump will then run, that will pop up a message box to ask how far you wish to move the coolant nozzle if the present angle setting is zero, that way after the initial setting it won't prompt you again for the job (need to think about where to store that number as something similar to a volatile variable, which is reset to zero at the end of the job)... The macro then toggles the axis back and forth and stores the current angle in a DRO which is compared so when the next time the mcode is run it will toggle the axis backk to vertical (if dro NOT() then statement)

Only thing is... I know that when an mcode is run the motion will pause unless an m10/m11 code is run... (There may be a way to use this as an input which will trigger axis motion... Maybe... I use m10/m11 with a plasma to turn torch height control on and off for corners etc without axis pause or hesitation with the ESS.

Just a thought maybe worth consideration
Title: Re: Moving an axis while code is running.
Post by: BR549 on December 05, 2015, 05:02:48 PM
I assume you are wanting to move teh nozzle in realtime while the machine is cutting independant of the Gcode ??  If so that takes an out of bounds axis and Mach3 does NOT have it.

You can however use a PLC and talk to the PLC via Modbus. You would then program the PLC for axis motion and talk to it anytime you need to from Mach3. That would give you the motion you wanted anytime you called for it.

(;-) TP
Title: Re: Moving an axis while code is running.
Post by: Cbyrdtopper on December 07, 2015, 08:04:47 AM
Yeah, I didn't think I would be able to.  As soon as Mach 4 gets more stable for me I will try and use it on this machine.  I just didn't want to put in the PLC on this machine.  What PLC's do you suggest to use?
Title: Re: Moving an axis while code is running.
Post by: Overloaded on December 07, 2015, 08:28:12 AM
One other consideration ... use one of the less expensive stand alone intelligent stepper drivers with a simple fwd / rev jog button at a set speed.
Totally independent of Mach or the gcode.

Pretty simple.

Russ
Title: Re: Moving an axis while code is running.
Post by: Overloaded on December 07, 2015, 09:12:16 AM
https://www.youtube.com/watch?v=llOS0FuqtdI
http://oceancontrols.com.au/KTA-276.html
http://oceancontrols.com.au/KTA-301.html

Cool examples.

Russ
Title: Re: Moving an axis while code is running.
Post by: Overloaded on December 07, 2015, 10:08:30 AM
http://www.ebay.com/itm/Stepper-motor-driver-controller-Speed-Regulator-Pulse-Signal-Generator-module-/331591955092?hash=item4d346bb294:g:gzMAAOSwgQ9VjdI~

or something like this.
Cheap enough  ::) but don't see any local.
Russ
 :)
Title: Re: Moving an axis while code is running.
Post by: Overloaded on December 07, 2015, 10:15:36 AM
This is one I've used in the past. It works well but only for a lower power nema 17.

http://www.interinar.com/bsd-013g-8.html
Title: Re: Moving an axis while code is running.
Post by: Cbyrdtopper on December 07, 2015, 10:54:11 AM
Okay Russ. 
I did think about something like that, but I need to be able to tell the nozzle where to go during my tool change, for each respective tool.  I was thinking that I could get an Arduino and program the positions into it an also have an adjustment knob that goes along with it.  That way all I have to do is give outputs to the Arduino to read as inputs to move to exact positions.  There's more than 1 way to skin a cat, just trying to figure out which is the best way. 
Thanks for all the input, very helpful.
-Chad
Title: Re: Moving an axis while code is running.
Post by: Overloaded on December 07, 2015, 12:29:50 PM
What if you configure the coolant stepper as the C (or spare) axis and include the move to position in your M6 script for each tool.
Then connect the little chineeze jog board in parallel to the driver to provide an override to fine tune the position on the fly.

Maybe ?

Russ
Title: Re: Moving an axis while code is running.
Post by: BR549 on December 07, 2015, 02:38:55 PM
OR migrate to Mach4 where you have plenty of out of bounds axis to work with (;-)

(;-) TP
Title: Re: Moving an axis while code is running.
Post by: Cbyrdtopper on December 07, 2015, 03:39:21 PM
Russ, I could do that.  That would make it easy.  I'll give that a go on my next machine.  No room for it in the box I have now. 
TP, the last I checked Mach4 wasn't ready with the ESS (not the latest version anyway) and I couldn't get the spindle to calibrate.  The axis movement, homing, and running code are all pretty good with Mach4 just couldn't get the calibration out of my spindle.   Very excited to use Mach4 with the OB motors and with the 60 inputs!
Title: Re: Moving an axis while code is running.
Post by: BluePinnacle on December 07, 2015, 07:52:43 PM
I was thinking of just fitting a bigger pump and hosing it in with a wide nozzle. That should work.