Hello Guest it is December 12, 2019, 11:40:32 PM

Author Topic: Moving an axis while code is running.  (Read 3607 times)

0 Members and 1 Guest are viewing this topic.

Moving an axis while code is running.
« 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
Chad Byrd
Re: Moving an axis while code is running.
« Reply #1 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.
« Last Edit: December 04, 2015, 05:36:41 PM by robertspark »
Rob

Albert Einstein ― “If you can't explain it to a six year old, you don't understand it yourself.”
Re: Moving an axis while code is running.
« Reply #2 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. 
Chad Byrd
Re: Moving an axis while code is running.
« Reply #3 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?
Rob

Albert Einstein ― “If you can't explain it to a six year old, you don't understand it yourself.”
Re: Moving an axis while code is running.
« Reply #4 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. 
Chad Byrd
Re: Moving an axis while code is running.
« Reply #5 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
Chad Byrd
Re: Moving an axis while code is running.
« Reply #6 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
Rob

Albert Einstein ― “If you can't explain it to a six year old, you don't understand it yourself.”

Offline BR549

*
  •  6,916 6,916
    • View Profile
Re: Moving an axis while code is running.
« Reply #7 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
Re: Moving an axis while code is running.
« Reply #8 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?
Chad Byrd
Re: Moving an axis while code is running.
« Reply #9 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