Hello Guest it is March 19, 2024, 06:17:20 AM

Author Topic: mach ignoring macropump code  (Read 6864 times)

0 Members and 1 Guest are viewing this topic.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: mach ignoring macropump code
« Reply #20 on: April 20, 2015, 06:39:24 PM »
YEP Use G31 in a macro. Just point it in the correct direction It will run until it hits the switch then reset the Z with G92 X0.


Code"G31 X10 F20"  ' it will move in the X positive direction at 20ipm  until it either hits the switch or reaches X10.
Code"G92 X0.000"    ' Sets the offset to 0.000

(;-) TP




Re: mach ignoring macropump code
« Reply #21 on: April 21, 2015, 05:33:15 AM »
With probe set to port1 pin 12 (the switch), and Z set at 25000, I used G31 from mdi line to test, got 'probe ignored...', changed probe to active low, tried g31 z0, no movement on axis, no status line report. G00 etc etc all work fine. What's it doing now?

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: mach ignoring macropump code
« Reply #22 on: April 21, 2015, 06:56:07 AM »
I've read through this thread and your previous one and I could explain to you why the various macro code you've tried does not do what you might want it to do but I'm not sure its really relevant.

Can you explain what it is you're actually wanting to do rather than how your trying to do it? i.e. I think you've fallen into the classic XY Problem. See http://xyproblem.info for what I mean.
Re: mach ignoring macropump code
« Reply #23 on: April 21, 2015, 07:24:55 AM »
What I'm trying to do is get the Z axis (syringe driver) to withdraw completely, to the point where it trips a switch telling the axis to stop moving, in order to ensure that has sufficient clearance to go and pick up the next 'syringe' of paint.

When it has done this, the Z  drive moves down until it contacts the back of the 'syringe' plunger, then stops moving.

Currently this last operation is achieved using homing. I was hoping to achieve the 'withdrawal' stage using G31, a macro, a hack, whatever, in veiw of the fact that homing the same axis in 2 directions is not allowed in Mach.
Re: mach ignoring macropump code
« Reply #24 on: April 21, 2015, 08:14:39 AM »
It turns out that g31 is working ok, just incredibly slowly. I've increased feedrate accordingly, problem solved. Thanks All!

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: mach ignoring macropump code
« Reply #25 on: April 21, 2015, 09:14:09 AM »
Good you got it working. However please in future think about the XY problem - it's an excruciatingly common problem on forums.

If you'd asked "how do I move Z until a switch is closed" or something similar I guarantee you Terry or someone else would have given you the G31 solution in 1 reply.

By posting "Problems with For Next loop in script" and then "mach ignoring macropump code" it's taken 30 posts to get you to your solution.
Re: mach ignoring macropump code
« Reply #26 on: April 21, 2015, 10:31:47 AM »
Okay, point taken. I'll think through my title posts a bit more clearly next time too.