Machsupport Forum
G-Code, CAD, and CAM => G-Code, CAD, and CAM discussions => Topic started by: lokey on April 04, 2009, 07:30:25 PM
-
Hi, I am trying a macro that will:
store the DRO value
Home all axis
Move axis back 0.0015 then reset to DRO’s to zero
Move axis to pervious stored values
varx = GetDRO(0)
vary = GetDRO(1)
varz = GetDRO(2)
code "G28 X 0"
code "G28 Y 0"
code "G28 Z 0"
code "G28.1 X -0.0015"
code "G28.1 Y -0.0015"
code "G28.1 Z 0.0015"
While IsMoving()
Wend
code "G0 X varx" & varx
When it gets to the last line I receive “a unknown word where unary operation could be” error message. I am following the syntax from the training video. Is there a solution? Thanks in advance for feedback received.
-
Code ( "G0 X" & varx & " Y" & vary)
-
YEP, or you could do
code "G0 X " & varx to replicate what you have on that line. WHen you use the Code"" routine VB switches over to the Gcode side and the Gcode does not reconise the varx inside of the " " so you add it on from the outside
" " &varx
Hope that helps, (;-) TP
-
Hi, thanks for the feed back. Is there away to re-set the machine coordinates DROs?
-
SetMachZero(0)
SetMachZero(1)
SetMachZero(2)
In a macro will set X, Y and Z machine DROs to zero. The same as if they had just been homed.
I have that code in a macro called M900.m1s to zero Mach 3 when I have my Bridgeport mechanical counters at zero.
-
Hi, I am trying to set machine coor. DRO's to a save variable. I have the OEM codes 83,84,85 but I can not get them to work in a macro. Is there a solution?
-
You can read the machine coords but I don't think you can set them other than to zero.
-
Hi, I am using a Zenbot with Mach3, LazyCam, and TuboCad. In the system I found there is a accumulating positive shift of 0.0015 after each axis movement that doesn‘t show up on the DRO‘s. . I am new to the software and there maybe a setting to deal with the problem but I am unable to find it. The problem becomes really apparent with a project that include cutting circles around a central point. The last outer circle would be so far off center that the part would be useless.
I was able to write a macro that solved the problem. I have to run the macro after each axis movement. Because the Zenbot has drive belts the macro works really well it has increased the precision of the Zenbot to a surprising level. Great bang for the bucks. I would not use the macro if the machine had ball screws.
If you know of a solution to the problem without using the macro please let me know. Thanks for feedback and best regards.
-
In Config/Motor Tuning what is the setting for Step Pulse and Dir Pulse? If they are not both 5, try setting them to 5.
-
Hi, I noticed that after I ran 28.1 code that the DRO's would read a + or -0.0009, it should reset to zero. That is where the accumulating shift is coming for. I had to rewrite my macro to adjust for it. I now run the macro after each chain is cut and the machine is now performing very well.
Is there a a way to chance the direction of a cut within LazyCam? I performed a search and found one reference. It was talking about a double clicking on a white arrow but I am unable to find any white arrows.
Thanks for all the help that I have received and if anyone knows a solution to the LazyCam problem please let me know.
Best Regards