Hello Guest it is October 18, 2019, 08:07:36 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 - helmholtz

Pages: 1 2 »
1
Rich,
when you tried it based on the original info did you run it as just M1500 entered into the command line? When I first started playing with I confirmed that it worked as well. I should have posted that I did get it to work based on the instructions in the original author post.

The issue popped up when I tried to use the macro inside of another program. Say for example you wanted to execute the macro at a position other then G54 X0 Y0 Z0. maybe you wanted the S/N in the middle of your workpiece. When I tried that out on the machine (also running ver .62) it would place the 'S' in the correct (middle) place then return to G54 x0 y0 z0 and run the rest of the program. In the variable monitor I started seeing large integers that didn't make sense when looking at var1301 and var1302.

this led me to believe that the getdro() function was not working as originally intended. Perhaps there is something in the program that I used to call the macro and the macro needs some preample gCode to work well. I'm not sure. But, thanks for taking the time to confirm that you were able to get to work also.

It's no haas G47, but not a bad little program. I may just run it from the MDI and not try and integrate it into a program. I only need to do a 200 parts and this sure beats making 200 CAM files!

I'd still like to re-write the macro to use getoemdro instead of getdro but like I said, that didn't seem to work. thanks again for looking at it.

2
Hi Rich,
I did read in the programming manual that it was now recommended to use getOEMdro(). The issue for me was when I updated the macro to something like:

SetVar(1301, getOEMdro(800))

where I expected it to return the current x-axis position into variable #1301 I got nothing. so i figured that I didn't understand the syntax?

with the exception of the use of the old 'getdro' command everything else actually worked and I think it will be a really handy little macro if I can get it working.


helmholtz,

May want to have a look at Page 18 of the Macro Programmers Reference Manual.

      STANDARD DRO'S    OEM DRO'S 
X DRO  0                 800
Y DRO  1                 801

Since the referenced macro in the mach tool box was posted in March 0f 2009 that "MAY" imply that use of dro code in Mach3 release 3.042.021 at the earliest. Only Terry would know more , but he retired from this site.

FWIW,

RICH


3
I have a little project where I need to engrave serial numbers on about 200 pieces. I found this old post in another area of the forum and this macro sort of does the trick.  I started to modify it to get it to work the way I wanted but ran into trouble with some of the deprecated commands. It would be pretty helpful if I could get it to work as I can call the macro as part of a larger program to get the serial number on the part.

The macro is attempting to set each of these variables to the current X and Y axis DRO readouts. This doesn't work and I think the 'getdro' command is obsolete. Plus I think the syntax is wrong anyway.
Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

Here is the original topic:
https://www.machsupport.com/forum/index.php/topic,11018.0.html

What I really need help with is what is the proper syntax to define a new variable, then set the variable to the current X axis DRO (and similar for the Y axis)? I played with the getOEMdro() command but I don't understand the syntax and how you would turn that dro reading into something that can be used as an integer. I'm not much of a programmer so the syntax and logic is a bit tough for me to figure out. I'd greatly appreciate any advice or alternative options!

 
Code: [Select]
It wil start off by engraving       S/N:     then adds the serial number    IE:    S/N: 090300001  ,  next run  S/N: 090300002 , ETC


CODE EXAMPLE:
' Macro for consecutive S/N engraving from MACH

Sub main
Dim A As String
Dim Ch As String
Dim Cnt As Integer
SetVar(1303 , .250)  'LetterSpacing
Setvar(1300 , -0.005) ' Z Depth cutting
Setvar(1200 , 0.050) ' Safe Z
'CPx= Getoemdro(0)
'CPy= Getoemdro(1)
SETIJMODE(1)
Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

message "S"
Code "g90 G0  Z#1200 X[#1301 + .2250] Y#1302 "
code "G91G0 x -.0706"
code " y-.0449"
code "G90 G1Z#1300 F20."
code "g91 g1X.0159Y-.0361I.05J.0004"
code "X.0375Y-.0151I.0377J.0395"
code "G1X.0348"
code "G3X.0373Y.0151I-.0001J.0539"
code "X.0157Y.0361I-.0346J.0365"
code "X-.016Y.0383I-.0551J-.0004"
code "X-.037Y.0164I-.0378J-.0356"
code "G1X-.0352"
code "G2X-.0373Y.0157I.0003J.0528"
code "X-.0157Y.0372I.0371J.0376"
code "X.0157Y.0374I.0535J-.0004"
code "X.0373Y.016I.0377J-.0365"
code "G1X.0706"
code "G90 G0Z[#1200]"
Code "G0 Z#1200 X[#1301 + .2250] Y#1302 "

Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

While IsMoving()
Wend

Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

message "/"
Code "G0 Z#1200 X[#1301 + .2250] Y#1302 "
code "G91G0X.0357Y.1071"
code "G90 G1Z#1300 F20."
code "G91 g1X-.1071Y-.2142"
code "G90 G0Z[#1200]"
Code "G0  Z#1200 X[#1301 + .2250] Y#1302 "

Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

While IsMoving()
Wend 
 
Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

message "N"
Code "G90  g0 X[#1301 + .2250] Y#1302 "
code "G91G0X-.0706 Y-.1078"
code "G90 G1Z#1300 F20."
code "G91 g1y.2156"
code "x.1412 Y-.2156" 
code "y.2156"
code "G90 G0 Z#1200"
Code "G0 Z#1200X[#1301 + .2250] Y#1302"

Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

While IsMoving()
Wend

Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

message ":"
Code "G90  g0 X[#1301 + .2250] Y#1302 "
code "G91G0y-.0559"
code "G90 G1Z[#1300 -.010] F20."
Code "Z#1200"
code "G91 Y.1118"
code "G90 G1Z[#1300 -.010] F20."
Code "Z#1200"
Code "G0 Z#1200X[#1301 + .2250] Y#1302"

Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

While IsMoving()
Wend


P10= GetOEMDRO(1050)
A=Str(P10)
For Cnt=1 To Len(A)
  Ch=Mid(A,Cnt,1)
  Select Case Ch
    Case "0" ZERO
    Case "1" ONE
    Case "2" TWO
    Case "3" THREE
    Case "4" FOUR
    Case "5" FIVE
    Case "6" SIX
    Case "7" SEVEN
    Case "8" EIGHT
    Case "9" NINE
  End Select
Next
P10=P10+1
SetOEMDRO(1050,P10)
Setvar(1301, getdro(0))
Setvar(1302, getdro(1))
SETIJMODE(1)
Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

While IsMoving()
Wend   

End Sub

Sub ZERO
message "Zero"
Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

Code " G0 X[#1301 + .2250] Y#1302 "
code "G90 G0 z#1200"
code "G91 G0 X-.0004Y.1076"
code "G90 G1 Z#1300 F20."
code "G91 G1X.0176 "
code "G2X.0374Y-.0194I-.0021J-.05"
code "X.0164Y-.0417I-.0488J-.0432"
code "G1X-.0009Y-.1012"
code "G2X-.0157Y-.0372I-.0527J.0004"
code "X-.0372Y-.0157I-.0375J.0371"
code "G1X-.0353"
code "G2X-.0372Y.0157I.0004J.0528"
code "X-.0157Y.0372I.0371J.0376"
code "G1Y.1059"
code "G2X.0157Y.0389I.0585J-.001"
code "X.0372Y.0175I.0382J-.033"
code "G1X.0177 "
Code "G90 Z#1200"
Code "G0 Z#1200X[#1301 + .2250] Y#1302"

Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

While IsMoving()
Wend
End Sub

Sub ONE
Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

message "One"
Code "G90  g0 X[#1301 + .2250] Y#1302 "
code "G91G0X-.0359Y.0719"
code "G90 G1Z#1300 F20."
code "G91 X.0357Y.0361"
code "Y-.2156"
code "X-.0357"
code "X.0718"
code "G90 G0 Z#1200"
Code "G0 Z#1200X[#1301 + .2250] Y#1302"

Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

While IsMoving()
Wend
End Sub

Sub TWO
Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

message "Two"
Code "G90 G0 Z#1200 X[#1301 + .2250] Y#1302 "
code "G91G0X-.071Y.0531 "
code "G90 G1Z#1300 F20. "
code "G91 G2X.0157Y.0375I.0535J-.0004 "
code "X.0377Y.0159I.0379J-.0371"
code "G1X.0352 "
code "G2X.0375Y-.0159I-.0005J-.0531 "
code "X.0159Y-.0375I-.0373J-.038 "
code "X-.0164Y-.0383I-.0527J-.0001"
code "G1X-.1256Y-.1213"
code "X.142"
code "G90 G0Z#1200"
Code "G0 Z#1200 X[#1301 + .2250] Y#1302 "

Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

While IsMoving()
Wend   
End Sub

Sub THREE
Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

message "Three"

code "g90 G0 Z#1200 X[#1301 + .2250] Y[#1302 ]"
code "G91G0X-.0605Y.0917"
code "G90 G1Z#1300 F20."
code "G91 G2X.0362Y.0159I.0366J-.0341"
code "G1X.034"
code "G2X.0357Y-.0159I-.0006J-.0494"
code "X.0151Y-.0379I-.04J-.0379"
code "X-.0151Y-.0379I-.0552 "
code "X-.0357Y-.0159I-.0363J.0335"
code "X.0357Y-.0159I-.0006J-.0494"
code "X.0151Y-.0379I-.04J-.0379"
code "X-.0151Y-.0374I-.0546J.0002 "
code "X-.0357Y-.0159I-.0363J.0335"
code "G1X-.034 "
code "G2X-.0362Y.0154I.0002J.0505 "
code "G90 G0Z[#1200]"
Code "G0 Z#1200X[#1301 + .2250] Y#1302"

Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

While IsMoving()
Wend 
End Sub

Sub FOUR
Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

message "Four"
Code "g90 G0 Z#1200 X[#1301 + .2250] Y#1302 "
code "G91G0X.0353Y-.1059"
code "G90 G1Z#1300 F20."
code "G91 Y.2117"
code "X-.1059Y-.1411"
code "X.1412"
code "G90 G0Z#1200"
Code "G0  Z#1200 X[#1301 + .2250] Y#1302 "

Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

While IsMoving()
Wend   
End Sub

Sub FIVE
 Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

message "Five"
Code "G90 G0  Z#1200 X[#1301 + .2250] Y#1302 "
code "G91G0X.0714Y.1071"
code "G90 G1Z#1300 F20."
code "G91 X-.1428"
code " Y-.0714"
code "X.0895"
code "G2X.0374Y-.0159I-.0005J-.0531"
code "X.0159Y-.0374I-.0372J-.0379"
code "G1Y-.0358"
code "G2X-.0159Y-.0378I-.0537J.0003"
code "X-.0374Y-.0159I-.0379J.0372"
code "G1X-.0357"
code "G2X-.0379Y.0159I.0002J.0536"
code "X-.0159Y.0374I.0372J.0379"
code "G90 G0Z#1200"
Code "G0 Z#1200 X[#1301 + .2250] Y#1302 "

Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

While IsMoving()
Wend   
End Sub

Sub SIX

Setvar(1301, getdro(0))
Setvar(1302, getdro(1))


message "Six"
Code "G90 G0 Z#1200 X[#1301 + .2250] Y#1302 "

code "G91G0X.0555Y.091"
code "G90 G1Z#1300 F20."
code "G91 G3X-.0379Y.0155I-.0376J-.038"
code "G1X-.0352"
code "G3X-.0377Y-.0159I.0002J-.053"
code "X-.0157Y-.0375I.0378J-.0379"
code "G1Y-.1062"
code "G3X.0157Y-.0377I.0533J.0001"
code "X.0377Y-.0157I.0378J.0376"
code "G1X.0352"
code "X.0375Y.0157I-.0004J.0535"
code "X.0159Y.0377I-.0371J.0379"
code "G1Y.0352"
code "G3X-.0159Y.0375I-.0531J-.0005"
code "X-.0375Y.0159I-.038J-.0372"
code "G1X-.0352"
code "G3X-.0377Y-.0159I.0002J-.053"
code "X-.0157Y-.0375I.0378J-.0379"
code "G90 G0Z[#1200]"
Code "G0  Z#1200 X[#1301 + .2250] Y#1302 "
Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

While IsMoving()
Wend   
End Sub

Sub SEVEN
Setvar(1301, getdro(0))
Setvar(1302, getdro(1))


message "Seven"
Code "G0 Z#1200 X[#1301 + .2250] Y#1302 "
code "G90 z#1200"
code "G91G0X-.0714Y.1071"
code "G90 G1Z#1300 F20."
code "G91 X.1428"
code "X-.1071Y-.2142"
code "G90 G0Z[#1200]"
Code "G0  Z#1200 X[#1301 + .2250] Y#1302 "

Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

While IsMoving()
Wend   
End Sub

Sub EIGHT

Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

message "Eight"
Code "g90 G0  Z#1200 X[#1301 + .2250] Y#1302 "

code "G91G0X0.Y.1061"
code "G90 G1Z#1300 F20."
code "G91 X.0176"
code "G2X.0373Y-.016I-.0004J-.0525"
code "X.0157Y-.0374I-.0378J-.0378"
code "X-.0157Y-.0372I-.0528J.0004"
code "X-.0373Y-.0157I-.0376J.0371"
code "G1X-.0352"
code "G3X-.0373Y-.0164I.0005J-.0519"
code "X-.0157Y-.0383I.0398J-.0386"
code "X.0159Y-.0361I.05J.0004"
code "X.0375Y-.0151I.0377J.0395"
code "G1X.0348"
code "G3X.0373Y.0151I-.0001J.0539"
code "X.0157Y.0361I-.0346J.0365"
code "X-.016Y.0383I-.0551J-.0004"
code "X-.037Y.0164I-.0378J-.0356"
code "G1X-.0352"
code "G2X-.0373Y.0157I.0003J.0528"
code "X-.0157Y.0372I.0371J.0376"
code "X.0157Y.0374I.0535J-.0004"
code "X.0373Y.016I.0377J-.0365"
code "G1X.0176"
code "G90 G0Z[#1200]"
Code "G0 Z#1200 X[#1301 + .2250] Y#1302 "

Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

While IsMoving()
Wend   
End Sub

Sub NINE
Setvar(1301, getdro(0))
Setvar(1302, getdro(1))


message "Nine"
Code "G90 G0  Z#1200 X[#1301 +.2250] Y#1302 "

code "G91G0X-.0555Y-.091"
code "G90 G1Z#1300 F20."
code "G91 G3X.0379Y-.0155I.0376J.038"
code "G1X.0352"
code "G3X.0375Y.0157I-.0004J.0535"
code "X.0159Y.0377I-.0371J.0379"
code "G1Y.1062"
code "G3X-.0159Y.0375I-.0532J-.0005"
code "X-.0375Y.0159I-.038J-.0372"
code "G1X-.0352"
code "G3X-.0377Y-.0159I.0002J-.053"
code "X-.0157Y-.0375I.0378J-.0379"
code "G1Y-.0352"
code "G3X.0157Y-.0377I.0533J.0001"
code "X.0377Y-.0157I.0378J.0376"
code "G1X.0352"
code "G3X.0375Y.0157I-.0004J.0535"
code "X.0159Y.0377I-.0371J.0379"
code "G90 G0Z#1200"
Code "G0  Z#1200 X[#1301 +.2250] Y#1302 "

Setvar(1301, getdro(0))
Setvar(1302, getdro(1))

While IsMoving()
Wend
End Sub

SETIJMODE(0)
CODE"G90"
CODE"M30"               



4
General Mach Discussion / Re: sudden onset of Stepper stalling
« on: March 13, 2017, 08:50:00 AM »
I think that it may be a failing driver. I pulled a known good driver out of my lathe and replaced the Z axis on the mill and the problem went away. So it appears I have a failing driver. I didn't realize that these drivers could sort of work. I thought a driver would either work or be dead but it seems to be 'failing'. For $30 it lasted quite a while and is a cheap fix.

After the driver swap I did install the UC-100 motion controller. I didn't notice any ground breaking performance increases but I would say the overall operation of the machine is 'smoother'. I'd been wanting to add one for a bit anyway to reduce potential windows issues.

I'll let it go for a week or two and will post back if the problem comes back. But certainly, if you've checked all of the connections, made sure it isn't a Windows problem, look at the driver itself. The running temperature is an interesting one. None of my drivers have reached 60 deg Celcius when running my programs. I just don't have enough sustained axis movement to heat them up. The KL-4030 are already at 'full current' and set to 3.0 amp. and the motors are rated at 3.0 amp also. not much I can do there. and everything did work fine for 18 months. to answer someone's question, yes, I use (3) KL-4030 drivers on the machine all running from a single 36Volt/9.7amp power supply.

Incidentally, I did move the 'bad' driver to the lathe, and it works fine. On these mills the Z axis clearly works the hardest so perhaps that is a contributing factor and maybe my KL-4030 and motor combo is a bit under-powered for the job. so it may be that I have been running it at it's limits for too long. with a lessened load on the lathe no issues. I'm replacing it anyway as it just isn't an expensive part and I enjoy making parts far more that working on the machines, lol.

thanks and I'll post back if it turns out the driver was not the culprit!

5
General Mach Discussion / Re: sudden onset of Stepper stalling
« on: March 09, 2017, 08:31:40 AM »
That's really interesting. So you're saying that the temperature could in fact be too low. I'll start checking it and see if there's a correlation.

I did order a UC100 motion controller to eliminate (or at least reduce) the chance that it's a windows computer problem. the computer has never changed but certainly windows always degrades in stability with time.

thanks for the idea there.

6
General Mach Discussion / sudden onset of Stepper stalling
« on: March 08, 2017, 08:39:56 PM »
I've got a Hoss mini mill clone that has been working great and almost daily for 18 months. Now it is suddenly stalling the Z-axis on a regular basis either while executing a program or just jogging. No pattern for when it happens. I verified that it is not a physical resistance issue on the machine. Never had problems in the past with stalling either, but it's not going away on it's own.

Is it possible I have either a dying breakout board or driver??? Or, is it possibly a windows stability issue? I've attached my XML file as I know you guys love looking at them!

I use the following:
KL-4030 driver
CNC4PC C-35 breakout board (parallel port)
Window 7 computer (only runs mach3, does not even connect to internet)
NEMA23 382oz/in 3.0A Stepper Motor

I had already considered moving to a motion controller as I'd read they offered more stability. Either the
UC400ETH Ethernet CNC Motion Controller
or the
UC100 USB to Parallel CNC Motion Controller

Any ideas on what I should do here?
thanks in advance.



7
Hood,
You were exactly right, the G4 fixed it.

For whatever reason there is a delay in the index input so that Mach sees a much lower RPM (probably 0 or close to it) when it calculates how to execute G95. I feel like it was ignoring whatever I put in the 'CW delay spin up' parameter, even once I enabled relays but I'm not going to worry about it, as I had tried spin up delay of like 4 seconds with not noticeable effect.

A simple G4 P2000 (milliseconds in my case) gives everything enough time to stabilize so that once a G95 Fx.********* is called it is executed correctly. That also explains why my symptom only appeared in the beginning of a program. If I changed feed rates later Mach of course saw the correct RPM as everything was stable by that point.

Thanks again for walking me through some troubleshooting. The solution makes sense, though I would have never thought of it.

8
Ok, so I enabled spindle relays and routed them to unused pins on my breakout board. So as far as Mach is concerned it thinks it's turning on a physical relay. Unfortunately, no change in the issue.

I also tried deleting my linearity.dat file as I know this is related to spindle speed and let mach rebuild the file on the next restart. This didn't work either.

I reverted the machine to ver 062 from 066, however I don't think I did a 'clean' uninstall. I thought I would have to copy my xml and macros back into the mach3 folder and this was not the case they were still there. I need to do some more forum research on how to revert to a previous version. So, it's possible it is still an issue. I just used the windows 'uninstall a program'.

But for now, anytime 'use spindle feedback in sync mode' is checked I don't get the requested program feedrate. actual feedrate is always much lower. At least I can 'uncheck' it and make parts while I try and figure it out.

I'm hoping it's just a corrupt file somewhere in the mach installation and a clean re-install will fix it but I'm really stumped. I've not seen this symptom anywhere on the forum after a few hours of searching. I've been considering moving away from the parallel port to motion controller (and probably Mach4 as well), but I'm not even convinced that is what is causing my troubles. Thanks again for your help.

9
sorry, should have attached that xml on the first post. It should be attached to this one.

thanks for clarifying how the sync works. I guess I was only getting good results because my RPM's are pretty stable.

I am using Ver 066 and have seen a number of posts about folks reverting to 062. I'll do that and see if it helps.

Thanks again.

10
Yes, I'm using the parallel port with a C10 breakout board.

I unchecked 'spindle speed averaging' and the problem got worse. Any program run using G95 resulted in an actual feedrate of 0.0001"/rev regardless of what was in the program.

So, I enabled spindle speed averaging again, but did try un-checking 'use spindle feedback in sync modes'. That worked for some reason.

All programs ran as expected and the correct feedrate was used. There were no noticeable changes to my spindle speed DRO or ability to call a certain spindle speed.

so, my problem appears fixed.

What have I given up by disabling 'use spindle feedback in sync modes'? I assume threading?

Thanks again for your help. I appreciate you taking the time to help me troubleshoot it.

Pages: 1 2 »