Hello Guest it is March 28, 2024, 09:04:21 PM

Author Topic: code for a repeat single axis driller  (Read 5527 times)

0 Members and 1 Guest are viewing this topic.

Offline Jim G

*
  •  22 22
    • View Profile
Re: code for a repeat single axis driller
« Reply #10 on: January 09, 2016, 10:14:50 AM »
here is the xml file and the m1s stuff
tell me what else you need -
Have these loaded in program but I can get the diagnostic tool to do anything..
Suppose to issue a m90x command to test these???

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: code for a repeat single axis driller
« Reply #11 on: January 09, 2016, 10:37:54 AM »
Each of those macros simply turns on and off a specific Output signal. What they do not have is a safety excape to be able to break out of the loop they create.  IF the switch does not trip then you are forever stuck in that loop with no easy way out.

You will only need one Macro to drive teh process but it is a complex macro with safeties included. You would make the motion moves in Gcode to get into position then make a macro(say M100) That macro would then control the activate and WAIT until teh driller signals it has finished . But at the same time there has to be an excape route in the code to allow you to break out of an endless loop in teh event that Mach3 does NOT see teh signal. Most times that would be a simple timer. You would time teh process then add a fudge factor to that. THEN IF the macro failed to see teh inout signal it would auto stop the process and cancel the program and post a message teeling you what happend "Hey dude I am busted please fix me" It can even call you on your cell phone and leave you a text message.
(;-) TP
« Last Edit: January 09, 2016, 10:39:54 AM by BR549 »

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: code for a repeat single axis driller
« Reply #12 on: January 09, 2016, 10:44:21 AM »
Also you may want to contact Artsoft and have them transfer that license into your company name.  Someone may mistake that fact that it is not in your name to mean it could be a pirated license. Not saying it is but there are many thousands of pirated license out there now.  Normally a company selling OEM licenses use a serial Number to identify it as an individual license and are not just using 1 specif lincense to run 100 machines that they sell. There are many OEM out it the world that have done just that. I for one will not help anyone that I think has one as it would not be fair to the ones that bought a legit license.

(;-) TP
« Last Edit: January 09, 2016, 10:46:45 AM by BR549 »

Offline Tweakie.CNC

*
  • *
  •  9,196 9,196
  • Super Kitty
    • View Profile
Re: code for a repeat single axis driller
« Reply #13 on: January 09, 2016, 11:15:27 AM »
Please correct me if I am wrong but I suspect that the .xml file posted has been taken from the CNC Router Parts installation disk rather than from Jim's Mach3 folder ??

Tweakie.
PEACE

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: code for a repeat single axis driller
« Reply #14 on: January 09, 2016, 11:25:11 AM »
Yes I believe that to be true But it is a good idea and I believe an artsoft suggestion to have it trnasferred into your name to calrify ownership of the license. IF the Oem shipped the same license file to everyone that would violate teh license agreement ???

The license file here on the plasma came from teh OEM as a serial number and it can be traced back to artsoft through that serial number that was assigned to that license when THEY bought it from Artsoft.

Just a thought, (;-)TP

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: code for a repeat single axis driller
« Reply #15 on: January 09, 2016, 11:47:13 AM »
This would be an example of a macro(m100) that could drive your function.

' M100 Driller macro
Lcnt = 0                  ' Set Loop Counter to Zero
   ActivateSignal(Output10)                          ' Create a Momentary signal of 1 sec to start driller function
   Sleep(1000)
   DeactivateSignal(Output10)

While Not Isactive(Input10)  OR  Lcnt <10000   ' Wait for the Driller to signal DONE or time out

                  IF Lcnt > 10000 then      ' IF timeout occurs then cancel Program
   Message" Driller did not respond"
   DoButton(3)
   End
   End if

   Lcnt = (Lcnt +1)                                         'Increase count by 1 each loop
Wend

While Ismoving()
Wend

End

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: code for a repeat single axis driller
« Reply #16 on: January 09, 2016, 01:18:20 PM »
HOW that would be used in a part program would be like

(Program #10001 )
G40 G80 G90 G54
G0 X0 Y0   (Move to a ref point)
G0 X10      ( Move to first drilling location)
M100        ( call Driller cycle)
G0 X20
M100
G0 X30
M100
G0 X0 Y0  ( Return to Ref point )
M30

etc,etc

Offline Jim G

*
  •  22 22
    • View Profile
Re: code for a repeat single axis driller
« Reply #17 on: January 09, 2016, 01:34:23 PM »
Ok - I will load that and see what how my outputs react...

thanks

Offline Jim G

*
  •  22 22
    • View Profile
Re: code for a repeat single axis driller
« Reply #18 on: January 13, 2016, 05:43:43 PM »
That code didn't work real well when I loaded in my macro for the outputs.
But I have a cycle that works as long as I manually interrupt the end of drilling cycle -
the end of drilling cycle is a limit switch on the drills that is normally closed - When the driller drills it opens and when it finishes it trips the switch to a closed position it signals the Macro to go to the next Gcode cycle. The problem is that the computer reads the signal as sustained and I can't get out of the Gcode loop and into the macro to activate the driller. I  need to insert something in the macro code to turn the input signal from the drill from a sustained signal into a momentary signal . When I do this manually all runs well.

I have attached the macro language - Help.

ActivateSignal(OUTPUT1)
While IsActive(INPUT1)= False
Sleep(50)
Wend
DeactivateSignal(OUTPUT1)

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: code for a repeat single axis driller
« Reply #19 on: January 13, 2016, 05:54:22 PM »
You need to add a small wait period so that the Driller has time to move off of the switch before it starts monitoring the DONE switch


ActivateSignal(OUTPUT1)
While Ismoving()
Sleep(1000)        ' Wait 1 sec  This can be adjusted as needed
Wend
While IsActive(INPUT1)= False
Sleep(50)
Wend
DeactivateSignal(OUTPUT1)