Hello Guest it is April 20, 2024, 05:18:19 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - moorea21

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 »
111
I changed the macro a bit, it works now, although I'll probably also try a different approach to see if that works.. My ports and pins and homing are all set up correctly as far as I can see, the correct leds (M1 Home, M2 Home) light on the diagnostic page when I manually trigger the X home switch while the command 'G28.1 X0' is running. And yet Mach still ignores my home switch when I trigger it... Same thing happens during Y axis home. These are the only 2 axes configured at the moment.

113
Have a look at my previous post, it explains in detail what happens when I try to home an axis... I still don't know why it behaves like that; I'm having more luck at the minute writing macros!

114
General Mach Discussion / New to macros; do macros run only when needed?
« on: January 28, 2015, 12:47:05 PM »
I have had no luck getting homing to work on my machine, so I've decided to write a macro that should do what I want. This macro should set the DRO of X axis to zero if the switch wired to input#1 is tripped, and then reverse away from it. Not tested yet, as I'm not near the machine.

If IsActive(INPUT1) Then 'if switch is triggered
   DoOemButton (250)     'stop X axis
   Code "G92 X0"            'zero X axis
   Code "G00 X10"          'move away from switch
   While IsMoving()
   Wend
End If

This should allow me to zero from my Gcode program.

Can I call this macro when needed by using an M command in the Gcode? Would it switch off after it has returned to the main Gcode?
The problem is, I only need this to happen once in each file, but if the macro is constantly running in the background checking the input, it will use a lot of processor power; not good.

115
I didnt know about that, thanks.

116
General Mach Discussion / Re: G28.1 not zeroing axis
« on: January 27, 2015, 01:07:12 PM »
Didn't mention, I had X home set to active low (a green tick). Setting it back to active low 'no' (red X), and repeating the first part, it again crashed the switch but set axis to zero, gave me a message 'Requested home axis switch is active.. please fix, then home..

Still confused

117
General Mach Discussion / G28.1 not zeroing axis
« on: January 27, 2015, 12:54:18 PM »
To simulate zeroing after many missed steps, I manually placed my x axis at approx. X=0, and ran this code:-

g00 x700
g92 x800
g28.1 x0

it crashed the switch, crunched while missing steps, and set the X axis to +100.

I then ran:-
g92 x0
g00 x700
g92 x600
g28.1 x0

This time it went past software zero, slowed down, tripped the switch, gave X as -100.

What I wanted it to do in both cases was to move towards the home switch, trip it, give it a value of zero, then move back from the switch.

My homing is configured as below:-

Axis          X
Reversed    no
Soft Max    100
Soft Min   -100
Slow zone  1.0
Home off   0.0
Home neg  yes
Auto Zero   yes
Speed        20%

No other switches are enabled.

I have obviously misunderstood how to set this up properly, I can't see (from how I understand it) why it does this. What am I misunderstanding, and what do I have to change?

Thanks

118
Thanks loads, I couldn't work that out from the manual.

119
Can I home just 1 axis from from gcode or a macro? Or am I limited to zeroing all axes at once?

120
Starting to set up home and limits on my machine, basically a 2d plotter that uses paint instead of a pen, and I have 3 questions:-

1) I need 2 of its axes to home in both directions. X axis needs a 'rough home' switch at the far end of its travel, and a 'fine home' switch close to the other end. Z axis (which is not like a milling machine's Z axis; all this one does is work like a syringe driver to push paint) needs to use both of its limit switches as home switches. I have to specify a direction for each axis to home in; but in both cases I need it to home in the opposite direction as well, something which I believe Mach doesn't allow for.

I could use a G01 command to drive either axis until the limit switch opposite the home switch is tripped, but I then need to assign a value to that axis using G92 and then continue on to the next line of code; which tripping a switch configured as a limit won't do.

As a workaround, I had considered wiring the 2 limit switches up to Input #1 (I don't use a guard) and Input #2, and using these signals to open a macro that says either 'Set X DRO to my value, and go back to main program'  or 'Set Z DRO to my value, and go back to main program' as appropriate. I have 2 parallel ports, so using another 2 input lines in addition to my ganged limit switches on port1, pin11 is no problem.

Is this a reliable way to do this? Or is there a way of doing this just in the main gcode file?

2) I'd like to be able to switch off one of my Motion Control MSD 415 drivers during a large part of the execution of my code, I'm not sure if this is possible; if so, would it involve wiring the 5V supply to the driver via a Mach output pin, and switching it off (and later back on again) from a macro? If so, potentially simple to do. If its position changes during the off period, it's not a problem.

3) I have home switches configured for 4 axes, and I want them all to home individually, is this possible? If so, could someone show me an example of how this is coded?

Thanks anyone...

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 »