Hello Guest it is April 19, 2024, 11:12:43 AM

Author Topic: homing macro and Ismoving  (Read 13834 times)

0 Members and 1 Guest are viewing this topic.

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: homing macro and Ismoving
« Reply #20 on: September 07, 2014, 08:32:59 AM »
Thomas, I will see if I can find any details about Art Code 3336 and if I do I will post my findings. Until then let me tell you that any Art Code error I have ever seen was generated by one of three things. A bad macro, a bad plugin or bad Gcode. I recommend you set up a new profile with all things being default. The screen, the ref. all home script (which is basically the code I recommended earlier), everything. The only plugin you should have installed is the CS Labs. Make sure you can operate the machine without getting the error and start adding your custom bits in one at the time and test to see what it is that is causing the error message.

I do not think you are going to be able to initially reference the machine with much success any other way than having the operator click a reference all button. My experience with the CSLabs tells me the script in that button will have to be very clean and cannot contain any While IsMoving() loops for sure. I also tried using LED 999 and countless other ways. The only thing that made it stable and eliminated all sorts of weirdness is the code I posted earlier. I can understand sending the machine to a set position at the beginning or end of each program, that I understand. This is usually done by commanding those coordinates or with a G28, G30, or G28.1 in the G code. I have not tested these g codes with the CSLabs because if this machine gets out of position (following error is too great) the servo drives will throw a fault which will force the operator to reference the machine after resetting the fault. This eliminates the need to reference the machine before each cycle.

Mach and CSLabs are very capable but they (or any other controller or hardware) are only going to work the way they are hard coded to. Our job as machine builders is to get what we want without asking the controller or hardware to do things they cannot. This often means we have to rethink the way we are doing things. But, that is the best part about being the machine builder, we have that option. Code does not, it can only work as it is written to. We have to be creative enough to stay within those bounds and still get what we want.

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!

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: homing macro and Ismoving
« Reply #21 on: September 07, 2014, 10:50:16 AM »
Brett,

i think i have to wait now, what the CSLab people figure out.
i have send them all the results off my testing.

let's see whats gona happen.

I will be offline until end of this week.

Thomas
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: homing macro and Ismoving
« Reply #22 on: September 16, 2014, 03:12:47 AM »
hello,

i'm back. this is the final macro, witch was working in my test scenario for more then
two hours without any stop. more then 4 times longer then any version before.

Code: [Select]
Sub Main()
' -------------------------------------------------------------------------------
' TPS 03.09.2014  
' Referenzschalter freifahren und anschliessend Referenzieren
' neue Version mit Benutzung von OEM Led's
' -------------------------------------------------------------------------------
'beim Laden des Files Abbrechen
If IsLoading() Then
    GoTo Ende
End If

'Geladenes Werkzeug lesen--------------------------------------------------------
AktWerkzeug = GetOEMDRO(1000)
'--------------------------------------------------------------------------------
If AktWerkzeug <> 0 Then
MsGBox "Referenzfahr mit geladenem Werkzeug nicht möglich. Bitte manuell entfernen."
        GoTo Ende
End If    
'--------------------------------------------------------------------------------

Message ("Automatische Referenzfahrt")

'Z referenzieren
Message ("Z-Achse referenzieren")
'RefCombination(4)   'Zuerst Z
DoOemButton(1024) 'Ref Z
Sleep(500)
While GetOemLed(809) = true
   Sleep(200)
   If GetOemLed(800) Then
       Sleep(500)
       Message"Fehler Referenzfahrt Z"
       End
   End If
Wend

'X und Y referenzieren
Message ("X/Y-Achse referenzieren")
'RefCombination(3) ' dann X und Y
DoOemButton(1023) 'Ref Y
DoOemButton(1022) 'Ref X
Sleep(500)
While ((GetOemLed(807) = true) Or (GetOemLed(808) = true))
   Sleep(50)
   If GetOemLed(800) Then
       Sleep(500)
       Message"Fehler Referenzfahrt X/Y"
       End
   End If
Wend

Code "G54" 'Koordinatenverschiebung ein
Sleep(500) 'warten
Message (" ") 'Stauszeile löschen
Exit Sub
 '--------------------------------------------------------------------------------

Ende:
 
 Message ("Automatisches Referenzieren Abgebrochen")
    
End Sub      


dont ask me about the difference between DoButton(22) and DoOEMbutton(1022),
but it seems to work.
Thomas
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.