Talking to the outside world.


Hi Everyone,
I am not sure if this is the place to start a forum - but I'll start here anyway, ready to be shot down in flames if incorrect.
This area of discussion may have been covered previously, but I haven't seen it.
 
On most of the commercial CNC equipment the OEM provides what are called external M codes.On the Fanuc 6M series of controllers these are typically M15 and M16. These M codes allow the user to perform very simply tasks without the controller needing to know too much about it. Typically I have used them for clamping as follows -
1. Issue M15 in the program.
2. Controller makes M15 signal active and awaits Mfin to be raised before continuing to process the program.
3. Clamp is activated and self latched by a set of contacts on the relay.
4. Pressure increases in oil line.
5. Pressure switch closes.
6. MFIN or External M finished signal raised.
7. Controller Continues with Job Process.
To open clamps
8. Issue M16 from within program.
9. Self Latching contacts in 3 above opened.
10 MFIN raised so controller continues.
11 Clamps are opened.
 
On a new Okuma controller I worked on recently They had 8 external Mcodes M181 THRU M188, with these 8 available codes I created a gray code structure to produce 7 on's and 7 off's by using a PLC. Each M code input to the PLC pulsed the single line MFIN signal. The PLC took care of the pressure switch type situations and their relationships with the MFIN signal.
 
A feature I would like to see on the EMC control is an extension of this type of structure but a little smarter.
 
There are 2 possible arrangements:
1. Currently the 2nd printer port typically 0x278 is used for some very arbitary features and would be better served as follows.
 
Output Port 0x278 is 8 bits wide or 256 (0-255) individual values these values can be used for such things as Tool number code. Special M function code, Speed gear range for spindle etc. In this example we would only really have 128 values as the 8th bit or bit 7 would be used as a strobe for reasons explained below.
Output Port 0x27A is 4 bits wide and is used for the T ot M or S code, with1 bit used for interrogation request (More on this in a moment).
Input Port 0x279 is an input port 5 bits wide and bit 7 (Busy) could be used as our function complete or MFIN. Bit 6 is an interrogate response.
 
Interrogation requirement.
Not all T, M and S codes are immediate or require the raising of a finish signal to the control, i.e. a tool change is usually T??M06 where ?? is the tool number, however it is quite normal in advanced NC programming to preselect the tool and have intelligent tool storage. So the program does a tool change at the start of the program i.e. T01M06 and tool 1 is loaded immediately. on the next program line there could be T02, to place tool 2 in exchange position ready for a snappy tool change with an M06 sometime later in the program. Tool 01 is now stored in the pod where T2 was housed, The tool changer is smart enough to know where tool 2 actually is (logical to physical location). This type of tool smarts just uses a simple look up table to know where a tool is.
 
All of this begs the question why not put all of these controls within EMC. Well thats pretty easy to answer. There were never 2 tool changers made that were the same so some external intelligent device is required like a PLC to handle it. I am personally do it with a microcontroller using a different control, an 87C51 with external relays and opto isolated inputs as I prefer the program logic.
 
2nd possible approach that I would prefer for EMC. Using an RS232 serial port connected to a microcontroller, a uniform communication protocol could be devised. An example for a tool change of T12M06 could be byte by byte as follows:
STX - Start of Text
T
1
2
M
0
6
ETX - End of Text
The exertnal control issues ACK or NACK in response to above string where ACK is message acknowledged and understood or NACK which is NOT acknowledge or restransmit.
 
All messages to remote would start with STK and end with ETX, which are standard ASCII codes.
 
In the case of our preselect tool change example we could issue the following to gain status info.
STX
ENQ - ASCII ENQUIRY character.
ETX
Which would instruct the external processor to respond to the status of the last command. i.e. User issues T13 to the processor, EMC issues above before doing the M06 to query the controller that the T13 command is indeed complete before issuing M06.
 
Implementation in EMC.
I imagine a new variable appears in EMC.INI such as EXTERNAL_CONTROL which would equal 0 if not implemented and 1 if it is. The actual code within EMC would need to be changed and I intend to have a look at it when time permits.
 
I am currently working on a serial version of the 87C51 external control and would welcome feedback on this subject of changes in the external interface. The code and design for the 87C51 controller would also be readily made available. The current task I am working on is a control for a newel post machine for a stair manufacturer and I would like to move away from current control to EMC using external control smarts as described simply above.
 
Best Regards To All
Bob Hourigan
Adelaide
Australia.
 
 
 
 


Date Index | Thread Index | Back to archive index | Back to Mailing List Page

Problems or questions? Contact