Hello Guest it is December 02, 2024, 02:54:22 PM

Author Topic: DRO numbers / squaring macro  (Read 7869 times)

0 Members and 1 Guest are viewing this topic.

DRO numbers / squaring macro
« on: April 05, 2013, 06:18:33 PM »
Hi All,

total newbie here I'm slowing setting up my machine.
I made a z-zero button following some info I found here, at one point the script behind the button sets the z-axis DRO @ "plate thickness" through the command "Call SetDro (2, PlateThickness)".

Right now I'm looking for an easy way to square my gantry (I'm still not done with my home switches) so what I plan on doing is "cut" a square (which won't be perfectly square) and measure the diagonals so I can calculate how much I'm off and how much I could move my A axis to so the gantry is squared (X and A would temporarily be "deslaved" for the occasion).

I've looked on the mach3 wiki and on a couple other sources to find the DRO corresponding to the A axis but cannot find it ! Even stranger, on what I found the DRO #2 (which the script above modifies) is not listed as the Z axis DRO but as "Pulse Freq DRO" !
I'm sure there's something I'm missing somewhere so any help would be appreciated.

just for information here is the macro I plan on running to square the gantry, the ***offset-value*** would be calculated beforehand after measuring the diagonals of the previously cut "square", feel free to post any comment... I'm not even sure if the OEMbuttons #357 and #358 actually do what I want...

'Squaring routine  

Code "G0 X0 Y0"
DoOemButton(357)  'temporarily deslave axis
Code "G1 F4 A***offset-value***"
While IsMoving
Wend
'here I would insert the command to set the A axis to 0, just in case...
DoOemButton(358)  're-slave axis


Thanks for any help on that.
Ben

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
Re: DRO numbers / squaring macro
« Reply #1 on: April 05, 2013, 07:13:29 PM »
Not sure about the dro numbers or buttons but Mach has the gantry squaring routine built in for slaved axis.If you slave one axis to another and have the home slave with master tick box un-ticked in general config. it will do what you want in the homing routine.  How square your gantry ends up depends on switch placement so make sure your switches are right.  An adjustable switch mount you can dowel once set would work good.

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: DRO numbers / squaring macro
« Reply #2 on: April 05, 2013, 07:19:33 PM »
Yep I'M with you on it except that I don't have my limit/home switches set up yet... I'm working on it (+ waiting for parts to be delivered).
Meanwhile I'd like to do this kinda manually...
thanks

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
Re: DRO numbers / squaring macro
« Reply #3 on: April 05, 2013, 07:29:32 PM »
Does this list in this topic help?

http://www.machsupport.com/forum/index.php/topic,6657.msg43385.html#msg43385

Or these links?

http://www.machsupport.com/docs/Mach3_V3.x_Macro_Prog_Ref.pdf

http://www.machsupport.com/docs/VBScript_Commands.pdf

I would think the plate thickness dro would be a user dro and would be #2000 or higher.

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: DRO numbers / squaring macro
« Reply #4 on: April 05, 2013, 08:55:14 PM »
Very interesting, those 2 last links are very useful !
The first link I already knew about and that's what I was confused about because the DRO#2 in this file doesn't refer to the Z DRO... but the 2nd link might have given me some start of answer..

It looks like the SetDRO command is an older command and should not be used anymore.... it's been replaced by SetOEMDRO. In the example for this function in the 2nd link, the X, Y and Z DROs seems to be 800, 801 & 802... and  803 might then be the one I'm looking for (A axis).

Someone please correct me if I'm wrong but basically :
SetDRO (0, valueX) ==  SetOEMDRO(800, valueX)
SetDRO (1, valueY) ==  SetOEMDRO(801, valueY)
SetDRO (2, valueZ) ==  SetOEMDRO(802, valueZ)

Thanks for those links !

Any comment about the DoOemButton(357) and DoOemButton(358) functions ? are those vaild ?