Hello Guest it is September 20, 2019, 09:31:01 PM

Author Topic: Probably simple but...(G-Code help)  (Read 11566 times)

0 Members and 1 Guest are viewing this topic.

Offline Davek0974

*
  •  2,577 2,577
    • View Profile
    • DD Metal Products Ltd
Re: Probably simple but...(G-Code help)
« Reply #80 on: January 15, 2016, 01:16:49 PM »
Fully tested and working 100% :)

The IHS subroutine now looks like this...

G91 (switch to incremental mode)
G01 X28.00 Y4.00 F6000 (position probe switch)
G90 (switch to absolute mode)
M1050 (trigger the probe cylinder)
F1300
G28.1 Z5.000 (probe the surface)
G92 Z#15045 (apply the probe switch offset from settings screen DRO)
M1051 (raise the probe)
G04 P0.2
G91 (switch to incremental mode)
G01 X-28.00 Y-4.00 F6000 (put the axes back to where we came from)
G90 (switch to absolute mode)
M99
%

You may notice that the first G04 P.0 has been removed - since changing to macro's rather than the brain the odd screech disappeared and it does not need the extra P04, I have no idea why but it works. The second P04 is needed as it allows time for the probe to lift clear of the plate before it moves.

Are any of the Abs/Inc switches surplus???
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives

Offline BR549

*
  •  6,898 6,898
    • View Profile
Re: Probably simple but...(G-Code help)
« Reply #81 on: January 15, 2016, 03:30:06 PM »
The only thing I would change its to add the dwells for the switch motion to the macro  1 for extend and 1 for retract  use Sleep(200) after the call to activate/deactivate the switch.

Then remove the G04 from the Sub.

You also need to make SURE that you CAM is going to reset teh Feedrate to programed FeedRate after each  Sub Call  otherwise the next section of Gcode will run at F1300 Feedrate. Actually I am not sure WHY you are calling teh F1300 in the sub ??? What are you trying to set  the feedrate for ??? ALL the moves I see COULD simply be done at RapidRate (G00) and avoid teh posibility of a problem.

Offline Davek0974

*
  •  2,577 2,577
    • View Profile
    • DD Metal Products Ltd
Re: Probably simple but...(G-Code help)
« Reply #82 on: January 15, 2016, 03:44:08 PM »
Thanks, i'll move the delays as described, makes sense.

The F1300 was a thing I was messing with yesterday, I found that if for some odd reason the E-stop was pressed when running code, and then restarted, when it ran the IHS it totally thrashed the Z axis, it didn't move but the noise it made was terrible - way too fast attempt. I think that was  the sequence anyway, whatever it was, it really made a mess of a Z move ;)

I flung in the F1300 as i was debugging and left it, i will pull it out again and re-test.

There is a certain sequence of events that can cause the Z to be told to move at a speed way above its programmed max speed. The only sure way to fix is to reload the code, very odd, but the noise really makes you jump :)
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives

Offline BR549

*
  •  6,898 6,898
    • View Profile
Re: Probably simple but...(G-Code help)
« Reply #83 on: January 15, 2016, 04:00:19 PM »
YOu may also want to consider increasing teh G28.1 intermediate point distance  5mm(.200") is pretty close . Here I use a minimum of .500"  . IF you have a wavy piece of metal 5mm may cause  switch contact problems ???

Also remember IF you have to hit the Estop that means it requires a complete reset of teh program values to be safe . ESTOP does not mean STOP it means DUMP everything. 

Just a thought, (;-) TP
« Last Edit: January 15, 2016, 04:03:55 PM by BR549 »

Offline Davek0974

*
  •  2,577 2,577
    • View Profile
    • DD Metal Products Ltd
Re: Probably simple but...(G-Code help)
« Reply #84 on: January 15, 2016, 04:12:45 PM »
I have tried other values in the G28.1 Z********* but it never seemed to slow down, will try again.

Yes i see now, this was when i was testing the probe trigger and many times had to e-stop as the brain didn't trigger the probe and would plant the torch in the slats :)  Part of the fun of de-bugging ;)

I will be altering the wiring slightly to move my existing limit switch wire on the Z from limits (which are disabled when G28.1 runs) to the e-stop circuit to give some protection in event of the probe failing to trigger etc. they serve no other purpose now anyway. The actual IHS switch is using the Z limit input and the limits were looped into the X/Y limit loop.

I think that will then close this modification exercise, hopefully finish the bracket to hold the cylinder and start tidying things up this weekend.
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives

Offline BR549

*
  •  6,898 6,898
    • View Profile
Re: Probably simple but...(G-Code help)
« Reply #85 on: January 15, 2016, 04:32:06 PM »
Teh G28.1 Z value is a way point to get back to home via that point . In this case IF teh tip was touching teh surface it would rapid UP to teh Z waypoint then probe back down to the surface . IF it is already above the waypoint it rapids DOWN to teh way point then further on to teh surface.

(;-) TP

Offline BR549

*
  •  6,898 6,898
    • View Profile
Re: Probably simple but...(G-Code help)
« Reply #86 on: January 15, 2016, 04:42:50 PM »
Just to make sure it is CLEAR teh first stage of G28.1 routine is made at Rapid feedrate then from teh waypoint to teh switch location it travels at teh predefined value you set up in teh Homeing Config page. THAT rate is a % of rapid rate. 

It has NOTHING to do with the Fword call.

Offline Davek0974

*
  •  2,577 2,577
    • View Profile
    • DD Metal Products Ltd
Re: Probably simple but...(G-Code help)
« Reply #87 on: January 15, 2016, 05:13:15 PM »


Learning all the time :)

Having a play with this tomorrow

Thanks
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives

Offline Davek0974

*
  •  2,577 2,577
    • View Profile
    • DD Metal Products Ltd
Re: Probably simple but...(G-Code help)
« Reply #88 on: January 16, 2016, 09:49:07 AM »
Ok here we go...

I can confirm that the Z parameter of the G28.1 code does nothing at all, tried many values and none made any change, the Z does not rapid at all when doing a G28.1, it runs at the value % set for Z in Homing and Limits setup.

Made up the bracket and got that fitted, pictures attached of the final setup. I managed to get the Y-axis shift down to zero and the X-axis shift to 20mm.

A video of it doing IHS and setting to 1mm after. Repeatability accuracy is very tight.
https://youtu.be/Fqn4YaQUq8c

Have moved the post-probe delay to the probe-off macro now, no delays in the subroutine, also gone back to a straight G00 rapid for the probe offset travel.

Works nice :)
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives

Offline BR549

*
  •  6,898 6,898
    • View Profile
Re: Probably simple but...(G-Code help)
« Reply #89 on: January 16, 2016, 10:18:25 AM »
You can leave it that way IF you want OR you can change it back to use the initial move. Setup / portPins/Millsetup   THC settings , check teh box initial move for G28.1.

Personally I like the initial rapid move, but you have teh choice.

(;-) TP