Hello Guest it is March 28, 2024, 06:42:38 PM

Author Topic: homing macro and Ismoving  (Read 13774 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 #10 on: September 03, 2014, 07:30:24 AM »

what i want to do with my script is to clear the homing limits
before i start a homing, because it is not homing when its
on an limit.

Thomas

I think it will but would have to test to be certain.......... the CS-Labs is pretty clever. You will have to reset any time a limit is tripped. Drive on to a limit that doubles as a home switch, hit reset then ref all home. I think it will work without having to manually jog off the switch. I think if you are on a limit switch that doubles as a home when homing is requested it will move off the switch until it changes states and the homing for that axis is then complete........... unless you set a home off distance. If you do then the axis will move to the home off distance once the switch changes states.

Thanks for sharing the info from CS-Labs.
« Last Edit: September 03, 2014, 07:35:03 AM by Chaoticone »
;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,501 2,501
    • View Profile
Re: homing macro and Ismoving
« Reply #11 on: September 04, 2014, 02:51:56 AM »
I think it will but would have to test to be certain..........

no its doing just nothing. only a message is created, that the limit switch is active.
i think CS-labs addon is not the problem, i think Mach is not notifying the addon
to do a reference because its checking the limit switch.

thats what i think, dont know for sure.

i am still in contact with CS-Labs, because with the new code the macros
still hangs up, but now without any internal error.

keep you informed.

Thomas
« Last Edit: September 04, 2014, 02:57:15 AM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: homing macro and Ismoving
« Reply #12 on: September 04, 2014, 07:51:04 AM »
I will try to test this ASAP but it will likely be the weekend before I get to. Are you sure you are not dealing with bouncy switches or EMF? Have you tried to enter a home off distance for all axis of .100 (inches)(+ or - depending on homing direction) and tried it? Remember (with a switch doubling as a home and limit) as soon as it comes off the switch in the homing routine the very next time it sees that input turn on, be it 10 minutes or 10ms later, it should throw a LS fault.

Brett
« Last Edit: September 04, 2014, 07:54:06 AM by Chaoticone »
;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,501 2,501
    • View Profile
Re: homing macro and Ismoving
« Reply #13 on: September 05, 2014, 02:08:38 AM »
Hello Brett,

small update

its clearing the home limts itself if in ->General Config the option ->Home Sw. Safety is disabled.
so i was able to delete the code for clearing the switches. but still the problem that the macro
hangs sometimes.

Home Off distance works after the homing to drive a declared distance after the homing was
finished.

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

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: homing macro and Ismoving
« Reply #14 on: September 05, 2014, 06:00:26 AM »
What macro hangs? The ref all home? Post your code and I'll have a look.

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,501 2,501
    • View Profile
Re: homing macro and Ismoving
« Reply #15 on: September 05, 2014, 07:04:10 AM »
Hello Brett,

here the macro witch hangs:

Code: [Select]
Sub Main()
' -------------------------------------------------------------------------------
' TPS 04.09.2014 
' zuerst Z dann X/Y Referenzieren
' -------------------------------------------------------------------------------
'beim Laden des Files Abbrechen
If IsLoading() Then
    GoTo Ende
End If

Message ("Automatische Referenzfahrt")

    'Z referenzieren
    Message ("Z-Achse referenzieren")
RefCombination(4)   'Zuerst Z
    Sleep(200)
    While GetOemLed(809) = true
        Sleep(50)
        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
    Sleep(200)
    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(200) 'warten
    Message (" ") 'Stauszeile löschen
Exit Sub
 '--------------------------------------------------------------------------------

Ende:
 
 Message ("Automatisches Referenzieren Abgebrochen")
   
End Sub   
Thomas
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: homing macro and Ismoving
« Reply #16 on: September 05, 2014, 09:51:57 AM »
Thomas, I do not understand why you are checking to see if the machine is reset or referenced. It should not do anything if in a reset condition and will already have the message in the status bar, no need to check or set that. If I wanted to reference the machine, I would want it to reference no matter if it thought it had been already or not so no need to check that either IMO. Maybe I am missing something but I think the code below would serve you well.

Code: [Select]
DoButton( 24 )
DoButton( 23 )
DoButton( 22 )
;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,501 2,501
    • View Profile
Re: homing macro and Ismoving
« Reply #17 on: September 06, 2014, 03:12:42 AM »
Brett,

this macro is only a part of the final macro.

what i want at the end is

home Z
depending on my setup i only can check after homing z whether there is a tool loaded or not

if tool loaded
- home Y
- if Y is finshed home X, possibilty of crash

if no tool loaded
- home x/y together to save time

the code with the check of reset and reference via GetOemLed was the
workaround CS-Labs prevered, because IsMoving() is not stable.

maybe i am not seeing the forrest depending on all the trees.

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

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: homing macro and Ismoving
« Reply #18 on: September 06, 2014, 05:23:41 AM »
The code I posted earlier will home the Z, then the Y, then the X. They will not work if in a reset. They finish homing an axis before homing the next. The only thing it will not do is home the X and Y together if a tool is not loaded. Will it be a big deal if it does not home the X and Y at the same time if no tool is loaded? What percentage of times when you reference the machine will it have a tool in the spindle? Surely it will only take a few extra seconds to home them independently? How often do you plan to reference the machine? Most only reference after power is lost or if reset has been hit while in motion. To err on the side of caution I home anytime a reset has been requested. If you are needing to reference more often than that I think you have bigger problems to be addressing before the reference script (just my opinion). From what I have seen with the CSLabs, the reference script is pretty flaky if anything else is in your reference script. I would keep it as lean as possible. Try the code below and see how you like it.

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,501 2,501
    • View Profile
Re: homing macro and Ismoving
« Reply #19 on: September 07, 2014, 03:09:25 AM »
Brett,

at the end this machine will be used in prof. conditions for drilling,tapping and labeling
for mounting plates for elecrical cabinets.

the normal work will be, load part, load programm hit start.
therefore a homing will be done at the beginning of every program to make sure
to start with the same conditions.

the machine will be operated of non CNC spezialists so have to create a easy to use
software. i have choosen Mach3/CSLabs for controlling the machine because
- its cheap
- its easy to use
- and on the main point with the screenset's, scripts and all the other open
functionality it gives me all the possibilities to create a package witch is exactly
what i need for this machine.

therefore i have to create test scenarios to make sure that all the particular
functions are working propperly.

i have also tested the homing by using dobutton(24) dobutton(23) and dobutton(22).

it ended up in a Error found Art Code 3336.
i was not able to find a list, witch discribes what this code means.

as long i am not not able to get this basic functionality working lets say up to 99%
stable it makes no sense to test further functions.

Thomas
 
« Last Edit: September 07, 2014, 03:10:59 AM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.