![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| LinuxCNC (formerly EMC2) Discuss LinuxCNC (formerly EMC2) Controlers here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
Is there a time delay command in EMC2? I would like to use time delay on a tool changer instead of limit switches. Need to move pneumatic cylinders and if I can allow 3 seconds to complete the move before the next one starts I free up a lot of switches. If there is how do I implement it? |
|
#2
| |||
| |||
| How are you controlling the tool changer now? Classicladder , a HAL component , or a user M-code script? Classicladder has timers, HAL has a timedelay component . M-code scripts I'm sure can do a time delay or could even use G4 (dwell) as a time delay (not a very good final solution but an easy way to test.) See the Manual (or man pages) for specific info. |
|
#3
| |||
| |||
| I will use M code if I can get a handle on it. Chapter 12 in the manual is about as usefull as Custer saying "Go West Young Man". I sure could use an example of a simple custom M command. What to put and where? Say for example I have a solenoid wired to pin "X" and want to turn it on for 2 seconds and off. Anyone know how to do this? Where did you find the information? Do I put something in my hal file? Do I need something in my ini file before I put something in my hal file? Without examples I'm lost. |
|
#4
| |||
| |||
| Here is the html manual (this is for EMC 2.3) entry about user M codes: http://www.linuxcnc.org/docs/2.3/htm...:M100-to-M199: I think It is actually in the user manual that comes with EMC. Anyways I think that if you add 'wait 2' after the hal comand, then the BASH script will pause for 2 seconds (I will have to try this later gotta go to work!) Did you thind this entry in the manual? Specific questions about the example? |
|
#6
| |||
| |||
| I have my tool changer designed but I need EMC2 to talk to it. Here is what I did: Made the tool carousel the 4th axis. Basically a rotary table. I rotate to any tool I want. The G code "G0A1.0" selects tool #1 on the carousel or "G0A8.0" selects tool #8. I control the loader arm with 3 pneumatic cylinders in a series of 9 canned commands to load and 10 to remove a tool. I do this with 3 pins (On-Off). I need a delay to allow a move to finish before the next one starts. I am thinking two M codes. M101 to remove a tool and M102 to load a tool. The M101 would power pin 1,2,&3///remove juice from pin1/// remove juice from pin 2///Power pin 1/// etc. The /// is a 2 second delay. |
|
#7
| ||||
| ||||
| Like I said before, sounds like you want to add some "Dwell Time", I don't run emc2 so all I can go by is whats on the .net. Anyway, this link says emc2 Dwell Time works the same as most cnc controls I've used.
( G04 P2000 ), for every one of your /// (The /// is a 2 second delay.) .
__________________ Free DXF Files - Vectorink.com - myDXF.blogspot.com |
|
#8
| |||
| |||
| if u want a delay in an m code u can do sleep 2.0 this will sleep for 2 seconds but this is not in real time memory so it can be + or - a few hundred milliseconds depending on the computer etc i would stay away from Mcode tool changer if this is a machine of any size/power etc use Mcode to test a changer or have a manual way to get out of it in MDI only if it gets stuck etc so for exsample u could do this to turn a classicladder function input on and off with a 2second delay say we want M101 make a file called M101 in NC_Files folder make it executable (see EMC Gcode manual) add these lines Code: #!/bin/bash #tool changer Mcode functions #turn a hal pin on and off halcmd setp classicladder.0.in-26 True sleep 2.0 halcmd setp classicladder.0.in-26 False exit 0 hope this helps can you do a G0 A1 M06 feed the M06 from HAL to classic ladder and back when tool is changed? hope this helps |
|
#9
| |||
| |||
| Just what I was looking for! Great examples! The G04P2000 is good but the sleep 2.0 is better. So I can make a file like this: #!/bin/bash #tool changer Mcode functions #turn a hal pin on and off halcmd setp classicladder.0.in-24 True halcmd setp classicladder.0.in-25 True halcmd setp classicladder.0.in-26 True sleep 2.0 halcmd setp classicladder.0.in-24 False sleep 2.0 halcmd setp classicladder.0.in-25 False #on and on until complete exit 0 Put it in the NC_Files folder , call it M101, make it executable, and it will run any time I add a M101 to my cutter program? Sounds too easy. |
|
#10
| |||
| |||
Personally i would have classicladder completely control the turret and cylinders. There is a sample idea on this page: http://wiki.linuxcnc.org/cgi-bin/emc...er_tool_turret Though that is for a stand alone program (doesn't use EMC) but could be the basis of what you want. It connects CL to a step generator and CL commands the positions directly. Then I would connect it to EMC so normal tool change (T and M06) calls talk to CL. But if the M code works for you then thats all that matters! |
| Sponsored Links |
|
#11
| |||
| |||
| justa ward of warning as the file is pins 24, 25,26 will all turn on pritty much at the same time give or take a few nS so be carefull see ur feeding classicladder so maybe u have timers there Once i have my Toolchanger working in classicladder i plan to add it to the emc wiki for others to reference as a starting point |
|
#12
| |||
| |||
| Simplicity is my goal in life so M code is a winner. Now comes the problem of disaster planning. After the cycle is complete the machine needs to know that it all went well before it starts milling my $500.00 block of steel. How do I add a limit switch checker command? I need one switch to know that the cutter actually came out of the spindle and isn't still stuck before it starts cutting and I am in the house watching tv. It needs to go in the M command at the end before M3 spindle start. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hoss 16 Tool Automatic Tool Changer | hoss2006 | Benchtop Machines | 316 | 03-03-2011 03:29 PM |
| TM3 tool changer delay | hankster | Haas Mills | 8 | 11-02-2008 06:28 PM |
| Need Help!- Tool Changer picks up wrong Tool? | KJ45 | General Metal Working Machines | 6 | 03-13-2008 06:51 AM |
| tool changer | axkiker | DIY-CNC Router Table Machines | 13 | 03-09-2008 07:28 PM |
| 640T Tool eye sensor delay time out | Shotout | Mazak, Mitsubishi, Mazatrol | 2 | 07-03-2007 11:04 AM |