Hello Guest it is March 28, 2024, 07:42:23 PM

Author Topic: Digital control of the Zaxis  (Read 7470 times)

0 Members and 1 Guest are viewing this topic.

Digital control of the Zaxis
« on: August 05, 2007, 04:36:34 AM »
I have cross posted this in the general discussion but have come to realize it may be a VB question


My Z axis will be controlled with a pnematic actuator to toggle the Z up and down. On the Z axis will be the A axis stepper for a tangential knife.

My questions is how shall I configure Mach 3 to toggle the Z axis up and down via an output from the Grex. Under settings I can enable tangential control with a lift angle and Z lift.

With the A axis for turning the knife  is it as simple as enabling the Motor Output for the axis and let the Tangential button do the rest for turn the axis

My original post above

I have since watched the scripting tutorial and I am guessing that this is what I will do. Any thoughts on this appreciated.

When generating a tool path in Lazy cam I will setup a tool off set called cutter. My z limits will be -150 and cutter offset of +50. and set my Z raise in tangential control to raise  +50 if radius +45

I will right a M code macro something like this. I have no VB experience but this is what I'm looking to do.

M50 code
Get Z DRO
If Z is =<-50 then output 1 set to 0 ( Meaning should +45 radius be exceeded,  Z will be driven -150 + 50 offset +50 generated by tangent control = Z-50 turn off output 1)
Get Z DRO
If Z is >-50 then output 1 set to 1

Do you think this will cut it? and can I enter this M50 in the Gcode once at the start or will I have to enter it after any change in Z value with in the Gcode. I'm tipping the M50 will have to follow any z command

I am a total newby to it all and slowly feeling my way, any advice appreciate including VB coding tips

Thanks Jason

Offline zarzul

*
  •  232 232
  • Wyoming, USA
    • View Profile
Re: Digital control of the Zaxis
« Reply #1 on: August 08, 2007, 01:05:58 PM »
Jason,

I may have a partial answer for you.  I used Mach on a router that had a digital Z axis,  it was a pneumatic piston controlled by a solenoid valve.  To set the Z depth it was done manually and all the cutting was done at the same depth.
To do this in the Mach configuration you set it up for a 2.5D vs 3D.  In practice anytime the program calls for a -Z then the Z solenoid output actuates, then when the gcode calls for a +Z the solenoid changes state and it retracts.

Arnie

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Digital control of the Zaxis
« Reply #2 on: August 09, 2007, 07:55:38 PM »
Jason, it is difficult for me to understand what your wanting, if you could be more clear in a step by step maner with example, then it would be easier to help.

Here is some VB code based on my current understanding of what you want.
Your Z axis:  first off, you could use just the "Dir" part of you Z axis if you wanted, (i.e. the direction component pin of you z axis under motor outputs), in its normal state, lets call it Positive Z (any value will do). The direction pin is at a zero state, which in turn doesnt activate you air solinoid and normal pressure and normal state of the solidnoid keeps the axis pulled up (away from the material).
Then when your program spits out a Negative Z, the "Dir" pin goes high (+5v), this in turn activates your solinoid that drives the axis down into the material, you would probably have to put some kind of mechanical stop so it would only go so far down. The Step and Direction pins on the Z axis already exist, so you could just use the Direction pin.

The other VB route(s):
You could make Two custom Macros, one for "Up" and one for "down" you would have to hand code or Wizard code them in your program
They would BOTH activate or deactivate the same output pin, for example output1

'M40.m1s  'Axis Up state
ActivateSignal(OUTPUT1)   'This would change the state of output 1 on what ever pin you assign, to active high or low

'M41.m1s  'Axis Down state
DeActivateSignal(OUTPUT1)  'this would do the oposite of M40.

Solution 2:  Using the Macro pump to watch the state of "Z" this is based off what you posted.
'Macropump.m1s

x=GetOEMDRO(802)
If X<=-50 Then
DeActivateSignal(OUTPUT1)
Else
ActivateSignal(OUTPUT1)
End If


'Let me know how that works out for you, and what you used.
'Scott





fun times
Re: Digital control of the Zaxis
« Reply #3 on: August 09, 2007, 10:02:29 PM »
Thanks Arnie and Scott for your comments.

I have since progresses and have the ticked the 2.5D button and configure Output6 in Mach to correspond with Output 1 from the GRex. Loaded a 150mm circle into to Lazycam and exported the code to Mach. I ran the program and my Z toggled down an up during the cycle run. With the 2.5D option in Mach I understand that output 6 is on when Z>0.0

The plan is to use two pneumatic actuators to control the Z axis up and down
1st. For the tangental knife turned but an Axis stepper
2nd. For a marking pen

As Mach has the 2.5D option that will work for Zaxis #1, I was thinking of a solution of how to control Zaxis #2 via another output with a  + Y work offset

Jason
Re: Digital control of the Zaxis
« Reply #4 on: September 05, 2008, 12:36:44 PM »
Arnie, Scott,

As you guys did before, we are trying to get a cnc router running on 2.5d mode, in wich we will probably succeed without any help.

My question is how to build in some dwell time to let the machine take a break for one or two seconds.
We do need this time for or z-axis to take our tool up or down after a Z movement order has been placed. (Z+ or Z-)

We are milling plastic plates about 20mm deep in once(4/5inch), and need some time to get our tool in or out of the material before we start making any X or Y movements.

We are programming or G-codes with a program called "SheetCam", wich has number G-code postprocessors. Some of them can build a code in to realise a dwell time.
But since we think this should be a common problem many 2.5D mode user must have been facing, there will be probably a solution for this problem in Mach3

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Digital control of the Zaxis
« Reply #5 on: September 05, 2008, 01:13:21 PM »
What I woulld do, is in your Post Processor, under you Z moves (up and or Down), I would Put a "G4 Px" (x=number of seconds of pause).

so in your post you could put a Z movement pause
i.e.

G4 P1
{Z move up or down here}
G4 P1

this would give you a poor mans pause for moving into or out of your plastic before any moves in X/Y.

Fancier would be Custom Macros or Brains associated with your Z moves.

scott
fun times