Hello Guest it is December 08, 2019, 08:53:37 PM

Author Topic: macro for homing  (Read 12162 times)

0 Members and 1 Guest are viewing this topic.

Offline BR549

*
  •  6,916 6,916
    • View Profile
Re: macro for homing
« Reply #10 on: February 07, 2015, 02:29:14 PM »
Why would you want to disable the Limits ??  When Homing Mach3 runs to the Limit / Home switch, trips, stops, then Backs up/off until the switch reopens and then stops.  

Then the addition encoder code would move the axis further "AWAY" from the switch which does NOT interfere with the limit function. IF you disabled the limits AND you had an encoder failure it would run away and SLAM hard into the HARD STOPS and could damage the Machine AND you.

Just a thought, (;-) TP
« Last Edit: February 07, 2015, 02:31:46 PM by BR549 »
Re: macro for homing
« Reply #11 on: February 08, 2015, 08:52:43 AM »
hi
oembutton the function (150) does not exclude the limits.
is used to enable the axes to move them after they stopped on the limit.
thanks anyway,
 regards
Re: macro for homing
« Reply #12 on: February 08, 2015, 09:00:47 AM »
"BR549"
hi
I made a macro of home that works this way:
the limit signal axis is traded on the input of Mach3 as reference
with which the machine must reverse the movement until coming out from it and try the zero encoder.
at this point reactivated limits.
I solved the problem by using a relay 'which exchanges the signal only at home,
then returns to its normal state of axis limits.
hello
thank you

Offline BR549

*
  •  6,916 6,916
    • View Profile
Re: macro for homing
« Reply #13 on: February 08, 2015, 12:43:43 PM »
Mach3 already does that internally when you call the RefHome (G28.1) IF you are using combined switch functions then MACH3 KNOWs how to deal with them. On Homing it deactivates the limit function then reactivates it AFTER the homing Has completed.

Why reinvent the wheel ??

Just a thought, (;-) TP
Re: macro for homing
« Reply #14 on: February 08, 2015, 01:28:20 PM »
Mach3 off limits if the zero is carried home
on the same input with the same signal
in my case I have to manage two signals because I have an encoder with zero mark that will give me the precision.
this procedure
  reach the first sign of the limit that will reverse the movement of the axis.
  until coming back will be released from this signal
2) at this point goes up when they hear the signal encoder.
If I used only the encoder signal would not have the reference limit (limit axis)
then the zero signal encoder would be made at the first turn of the screw at any point of the stroke.
I do not know if I explained.
hi

Offline TPS

*
  •  1,415 1,415
    • View Profile
Re: macro for homing
« Reply #15 on: February 09, 2015, 03:02:16 AM »
Hi,
ok than let's try an other road:

   Message ("ref. Z-axis")
   DoOemButton(1024) 'Ref Z
   Sleep(500)
   While GetOemLed(809) = true 'wait normal reference to be finished
       Sleep(200)
   Wend
                Message ("ref. Z-axis to index mark")
                'here you can do your reference onto the index signal

Regards Thomas
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: macro for homing
« Reply #16 on: February 09, 2015, 05:22:49 PM »
Hi TPS:

"as fas i know the CS-Lab controler is the only one witch
can reference on a zero mark of the encoder."

The dspmc controller by Vital Systems does the machine reference using the Z channel of encoder.

John
Re: macro for homing
« Reply #17 on: February 10, 2015, 02:47:23 PM »
hello
I solved this way.
the axis moves at high speed until you find the first signal of the limit switch
when found reverses slowing the feed
Now launch the home and tries zero encoder.
works fine.
pulse time 2 ms
mach sees it and I'm doing the tests using a simple interface card with parallel pc.


   
   Sub Main ()
   
'Dichiaro le variabili per i contatori dei cicli "For...Next"

   Dim z,y,x
   
'Dichiaro le due velocit√† di spostamento    
   
   FeedVeloce = 1000   'Speed approaching ... research first switch.
   FeedHoming = 20      'Search speed switches Home
   
'Imposed on the parameter of the speed of Homing for X, Y, Z
   
   SetParam ("ZRefPer", FeedHoming)
   SetParam ("YRefPer", FeedHoming)
   SetParam ("XRefPer", FeedHoming)

'Call the subprogram for the Home Z
   
   GoTo HomeZ

   HomeZ:

'Z I lift fast for a distance definitely superior to its stroke
   
      Code "G0 Z999999 F" & FeedVeloce
   

'Start of cycle for the search of the first switch
   
      For z = 1 To 600
      

'If the first switch is activated ...
      
      If IsActive(INPUT1) Then
      

'Without approaching fast, wait half a second and I start homing
      
      DoOEMButton(1003)
      Sleep 500
      DoButton(24)
      
'I look forward to concluding the homing of Z and call the subroutine for the homing of Y ...
      
      While IsMoving()                      
      Wend
      GoTo HomeY
      

'... Or, if the first switch is off, repeat the cycle "For ... Next"
      
      Else
      Sleep 100
      End If
      Next z

'ripeto per gli assi Y e X

      HomeY:

      Code "G0 Y-999999 F" & FeedVeloce
      For y = 1 To 600
      If IsActive(INPUT2) Then
      DoOEMButton(1003)
      Sleep 500
      DoButton(23)
      While IsMoving()                      
      Wend
      GoTo HomeX
      Else
      Sleep 500
      End If
      Next y


      HomeX:

      Code "G0 X-999999 F" & FeedVeloce
      For x = 1 To 600
      If IsActive(INPUT3) Then
      DoOEMButton(1003)
      Sleep 500
      DoButton(22)
      While IsMoving()                      
      Wend
      GoTo Fine
      Else
      Sleep 100
      End If
      Next x

      Fine:
      Code "(Homing eseguito)"
   
   
   End Sub

       

Offline TPS

*
  •  1,415 1,415
    • View Profile
Re: macro for homing
« Reply #18 on: February 12, 2015, 06:34:43 AM »
Hi riporeno,

here my proposal:
Code: [Select]
Sub Main ()
  
'Dichiaro le due velocit√† di spostamento    
   FeedHoming = 20      'Search speed switches Home
  
'Imposed on the parameter of the speed of Homing for X, Y, Z
   SetParam ("ZRefPer", FeedHoming)
   SetParam ("YRefPer", FeedHoming)
   SetParam ("XRefPer", FeedHoming)

'Call the subprogram for the Home Z

'Z I lift fast for a distance definitely superior to its stroke
  
      Code "G0 Z999999"  'TPS G0 does allways full speed no feedrate needed
      While IsMoving() 'wait for input during move
          If IsActive(INPUT1) Then
            'Without approaching fast, wait half a second and I start homing
            DoOEMButton(1003)
            Sleep 500
            DoButton(24)
           While GetOemLed(809) = true 'TPS wait for Z-Ref finished had a lot trouble using IsMoving()
           Sleep(200)
         Wend
      Wend

'ripeto per gli assi Y e X

      Code "G0 Y-999999" 'TPS G0 does allways full speed no feedrate needed
      While IsMoving() 'wait for input during move
          If IsActive(INPUT2) Then
            DoOEMButton(1003)
            Sleep 500
            DoButton(23)
           While GetOemLed(808) = true 'TPS wait for Z-Ref finished had a lot trouble using IsMoving()
           Sleep(200)
         Wend
      Wend

      Code "G0 X-999999" 'TPS G0 does allways full speed no feedrate needed
      While IsMoving() 'wait for input during move
          If IsActive(INPUT3) Then
            DoOEMButton(1003)
            Sleep 500
            DoButton(22)
           While GetOemLed(807) = true 'TPS wait for Z-Ref finished had a lot trouble using IsMoving()
           Sleep(200)
         Wend
        
      Wend

      Code "(Homing eseguito)"
  
End Sub

without GOTO's and some remarks.

Regards Thomas

PS: code is not tested

here http://www.machsupport.com/forum/index.php/topic,27912.0.html
you can read about my homing problems.
« Last Edit: February 12, 2015, 06:38:23 AM by TPS »
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: macro for homing
« Reply #19 on: February 13, 2015, 08:23:15 AM »
thank you very much for your cooperation
I'm doing tests these days

how can I disable
the signal of the axis limits with the macro language.?

also you can change the feed value set maximum motor tuning in?
(with macro language)
thank you
regards