Hello Guest it is July 18, 2019, 10:17:31 PM

Author Topic: M6 Macro tweaking  (Read 1995 times)

0 Members and 1 Guest are viewing this topic.

Offline Davek0974

*
  •  2,556 2,556
    • View Profile
    • DD Metal Products Ltd
M6 Macro tweaking
« on: December 31, 2017, 04:55:46 AM »
Hi all,

not been inside my Bridgeport conversion for a while, decided to add knee movement for tool length compensation so i can retain full Z axis travel.

A very helpful guy has forwarded me a lot of info (thanks) on how he made it work but it was a long time back and exact detail is vague, he had it working on a replacement for the G43 call using a macro titled M843 which was called along with the tool offset parameter so M843 P10 for tool 10 etc.

It seems possible that a better way might be to embed the knee movement code into my M6Start macro - this macro already knows what tool is being called. Tool length compensation would be turned OFF as the machine would think all tools are one length because the knee has moved to compensate.

I was trying to get acquainted with macros again and pulled my M6Start apart - I have attached it below, as far as i can see it contains loads of redundant code? It was cut down from the 2010 screenset code, IIRC all it does is move Z to machine zero??

The rest seems superfluous no??

If someone could scan it and let me know I can get going, of course if there is a better way then do let me know :)
Thanks
« Last Edit: December 31, 2017, 04:57:33 AM by Davek0974 »
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives

Offline Davek0974

*
  •  2,556 2,556
    • View Profile
    • DD Metal Products Ltd
Re: M6 Macro tweaking
« Reply #1 on: December 31, 2017, 06:18:08 AM »
Something like the M6Start attached,

It still has the odd code from before but I have grafted in bits of the macro from my friends conversion.

It seems to make sense to me, most likely has bugs in it, I'm not sure if the code relating to G90/91 is needed??


My guess is that I will modify the Z axis DRO zero button to also zero the A axis DRO out - This way once the initial Z ref is set with my Haimer probe, all moves are relative to work zero on the A axis.


Any glaring faults here??
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives

Offline Davek0974

*
  •  2,556 2,556
    • View Profile
    • DD Metal Products Ltd
Re: M6 Macro tweaking
« Reply #2 on: December 31, 2017, 08:44:20 AM »
Hmm, using my trusty paper and pencil, I think I can see one possible bug to start with, but i may be wrong...

The code moves the knee to a negative of the tool length offset, surely it needs to move the knee to negative of the difference between the height setter tool and the new tool????

Downwards on the Z axis is negative, upwards on the A axis is negative.

My 3d Haimer probe is always Tool 100 and is 150mm tall in the height setter.

Say T1 is 65mm tall.

I would zero Z ref with T100 manually set and zero out both Z & A axes DRO's.

Then start the code, this would call T1, now my work is 85mm away from the tool (150-65) so the knee has to move -85 NOT -65

Am I wrong or am i wrong??
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives
Re: M6 Macro tweaking
« Reply #3 on: December 31, 2017, 08:50:22 AM »
You are correct in that the Aaxis has to move the difference in the tool lengths, same as the Z would normally do.

Mike
We never have the time or money to do it right the first time, but we somehow manage to do it twice and then spend the money to get it right.

Offline Davek0974

*
  •  2,556 2,556
    • View Profile
    • DD Metal Products Ltd
Re: M6 Macro tweaking
« Reply #4 on: December 31, 2017, 09:08:45 AM »
Ok, revised my code.

Added a call for the height Probe offset, added a variable for Heightprobeoffset-tooloffset

Move now made with the new variable.


Seems to make more sense reading it I think??
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives

Offline Davek0974

*
  •  2,556 2,556
    • View Profile
    • DD Metal Products Ltd
Re: M6 Macro tweaking
« Reply #5 on: December 31, 2017, 09:31:45 AM »
Some numbers and moves...

Probe Length  Tool Length  Difference  A-Axis Position
15015000
1506585-85
15011535-35
150160-1010

 
I think it makes sense?

« Last Edit: December 31, 2017, 09:47:08 AM by Davek0974 »
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives

Offline Davek0974

*
  •  2,556 2,556
    • View Profile
    • DD Metal Products Ltd
Re: M6 Macro tweaking
« Reply #6 on: December 31, 2017, 11:54:33 AM »
Anyone know what this would be doing in the middle of the M6Start macro??

SetVar(1, GetOEMDRO(800))
SetVar(2, GetOEMDRO(801))
SetVar(3, GetOEMDRO(802))

Even in the original use of the macro the vars being set do not seem to be used??
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives
Re: M6 Macro tweaking
« Reply #7 on: December 31, 2017, 10:18:19 PM »
Dave,
My multi-purpose machine has a PLC in it because it allows me to do things not easily done by Mach 3. I recently replaced the surplus DL06 I was using with a DoMore BRX because of all the stuff it brings to the table. It has high speed inputs and outputs with motion commands so it could control the motion of your knee lift. It talks ethernet, serial, and modbus so you can send the tool length to the BRX and let it position the table and tell mach 3 the position move is done. Mine runs everything including air blowoff, misting, flood, vacuum cleaner, lights, safety circuit, heaters for the 3d extruder, 3d bed heater, lathe spindle and index pulse for threading etc.

Offline Davek0974

*
  •  2,556 2,556
    • View Profile
    • DD Metal Products Ltd
Re: M6 Macro tweaking
« Reply #8 on: January 01, 2018, 03:23:37 AM »
Thanks Gary,

This mill is running a CSMIO IP/A with Encoder and MPG modules added, I'm not sure a separate PLC will offer much more for this simple task?

If I were adding an ATC maybe but the BP won't play nicely with and ATC ;)
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives
Re: M6 Macro tweaking
« Reply #9 on: January 01, 2018, 02:23:50 PM »
Dave,
My thinking was actually driving the table vertical axis entirely separate from Mach 3 and only passing the actual tool length to the PLC in the M6 macro.