Hello Guest it is March 28, 2024, 03:19:35 PM

Author Topic: Can A Modbus control a.........  (Read 33340 times)

0 Members and 1 Guest are viewing this topic.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Can A Modbus control a.........
« Reply #30 on: July 29, 2008, 04:33:10 PM »
Basically the same, you would have a home switch and the PLC would know where the motor is.
I still think however the PLC controlling the motor is the expensive option and is it needed?

Hood

Offline TT350

*
  •  113 113
    • View Profile
Re: Can A Modbus control a.........
« Reply #31 on: July 29, 2008, 05:38:45 PM »
Are you using a home switch?
Do you have a DRO in Mach?

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Can A Modbus control a.........
« Reply #32 on: July 29, 2008, 05:47:49 PM »
No and No
Reason is my rear turret and front toolpost (its a lathe) are both hydraulic so no motors. I suppose you could say there is a home switch in as much as there are switches to show that the toolpost is clamped and the rack has been pulled back. Also there are 3 switches on the toolpost and 4 on the turret to show which tool is in position depending on the sequence of these switches.
My VB in the M6 macro looks at the current tool DRO and the requested tool number in the G Code, if they are the same it does nothing and Mach is told to carry on. If the tool numbers are different then Mach sends a signal over modbus and the PLC starts the toolpost or turret indexing, when the correct sequence of switches show the chosen tool is in position the PLC stops indexing and sends a signal to Mach to say that the tool is in position and Mach continues with the Gcode.

Hood
Re: Can A Modbus control a.........
« Reply #33 on: July 29, 2008, 08:15:59 PM »
Hi,

 To show how a toolchanger can be controlled through a Modbus device,  below is some information about how I've implemented a changer module in the ModIO for an Emco changer.

Cheers,

Peter.

Code: [Select]
/*******************************************************************************

                                   Emco.c

********************************************************************************


/********************************************************************************
The ModIO will read the 2 optical switches and drive the Motor direction Relay.


The EMCO changer has 2 inputs, a turret home switch and a Turret position
switch. The home switch indicates that the turret is lined up with tool position
one locked. This switch will activate whenever the turret passes position 1.

The other switch the turret position switch input is the input from 6 turret
position switches in parallel. If any one of the 6 switches are activate then
this input will be active. Therefore, this input doesn't indicate what tool
position we are at, just that the "Next" tool position has been reached. There it
is necessary to keep track of where the changer is relative to the home
position (Tool 1)

The changer will work as follows;

On startup or after an error occurs we assume we are lost. When the first
toolchange request comes in, the changer will rotate until it sees the home
switch input go active. When it sees this it knows where it is, tool 1, and can
then move to the requested position.

There is also a timeout. If the home switch is not found within the configurable
timeout, an error is assumed to have occured, and the changer stops.

When a tool change is requested and the current position is known, the changer
rotates the turret counting the number of times the position input goes active
until the desired tool position is reached.

There are also 6 outputs used as position indicators, plus a status indicator
output. The position indicators will illuminate when the turret is at the
indicators position. That is, indicator 2 will illuminate when tool position 2
is reached.

The status indicator will illuminate whenever the tool changer is activated.
It will extinguish when the change operation has completed. If an error has
occured and the change is aborted, the indicator will flash until the next
valid operation has completed.

Once the desired position is reached, the motor forward relay is de-energised
and the motor reverses, locking the turret into the desired position.

Note, the position switches on the turret are positioned to be activated once
the turret has passed the tool location. The reversing of the motor rotates the
turret back to lock into the tool position.

There is also a manual change input switch. When activated, the turret will jog
to the next tool position. 


Modbus Interface
================

The Emco changer interfaces by a number of Modbus registers as defined below. A
number of the registers are configuration registers and are used to initially
configure the changer. There are also a set of registers that are then used to
control the changer during normal operation.

Config registers
----------------
register 150 Turret Config

This config register is used to enable the EMCO toolchanger module. To turn ON
the module, bit 1 needs to be cleared. Therefore 0x00FD should be written to
register 150 to enable the changer.


register 151 Change Delay timeout HI BYTE
register 152 Change Delay timeout LO BYTE

These 2 registers make a 16 bit timeout which if it expires will abort the change
and error. If you set the time out registers 151 and 152 to 0x10 and 00x0, you
will get a time out of approximately 30 seconds. each bit in the hi register 151
is worth about 2 seconds. With the default value of 0xFF and 0xFF the timeout
is over 500 seconds


register 153 Reverse Delay timeout  HI BYTE
register 154 Reverse Delay timeout LO BYTE

These 2 registers define the time delay between between turning off the forward
relay and indicating that the toolchange has completed. This delay is to allow
the changer enough time to lock the turret. With the default value of 0xFF and
0xFF the timeout is turned off.


Output Registeres
-----------------
register 1100 Requested Tool

This register contains the tool position for the next tool change. If this
register contains 0 when the tool change is requezsted, a dummy tool change
occurs. This is a good way to synchronise the Tool Change Counter 1101 output
register and the Tool changed count 1201 input register.



register 1101  Tool Change Counter

This register is used to initiate a tool chage operation. Whenever this register
value is changed a tool change occurs. Therefore to change a tool position, the
position to chage to is first written into register 1100, then the contents of
register 1101 are changed. It is best to increment it as this helps debugging.


Input Registers
-----------------
register 1200 Current Tool

This register contains the current tool position If this register contains 0
it indicates that the tool changer is "lost"


register 1201  Tool Changed Count

This register is used to determine when a tool chage operation is complete. This
is indicated by this register having the save value as register Tool Change
Counter 1101.

To perform a toolchange, the value of 1101 is changed to initiate the change.
When the change is complete, register 1201 will contain the same value that was
written to 1101.


register 1202  Tool Change Error Code

This register is used to determine the state of the last change request. If the
change was completed with an error, this register will contain 0x0000, otherwise
it will contain an error code.


register 1203  Tool Change Mode

This register contains the changers internal state as the change is occurring. It
is only used for debugging purposes.


Changer Operation
=================

To use the changer, the module must first be enabled by writing 0x02 to register
150.

Initially register 1100 should be written with 0x0000. Then, write0x0001 to
register 1101 to perform a dummy change.

Then to perform a tool change, write the new tool position to register 1100, then
increment register 1101 to start the change operation. Register 1201 is then checked
until it changes to the same value in register 1101

*******************************************************************************/
« Last Edit: July 29, 2008, 08:18:57 PM by phomann »
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com

Offline TT350

*
  •  113 113
    • View Profile
Re: Can A Modbus control a.........
« Reply #34 on: July 29, 2008, 08:29:45 PM »
Hood:
So let me see if I'm understanding this.

You are using a set of switch's in a particular order
to tell the PLC what tool is in postion.

Mach tells the PLC witch tool it needs and the PLC
moves to that tool.

phomann:
Thanks for the post!

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Can A Modbus control a.........
« Reply #35 on: July 30, 2008, 02:27:54 AM »
Yes thats correct, also the tool signal is always passed to Mach so that for example if on the rear turret tool 1 is in position and the front toolpost tool 7 is in position. Now presently Mach is using tool 1 but the code calls for tool 7, mach looks to see if tool 7 is in place, because it sees the signal that it is, the only thing that happens is the tool number DRO and the offsets are changed.
 Will post a jpeg of a snippet of the ladder when I get to the workshop.

Hood

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Can A Modbus control a.........
« Reply #36 on: July 30, 2008, 04:36:09 AM »
Heres the some of the code in my M6Start.m1s macro and also a snippet from the PLC ladder for the rear turret.

Hood

If GetSelectedTool <1 Then   'If tool called is less than 1
MsgBox("Tool Out Of Range")  'show message
End                          'End macro
End If

If GetSelectedTool >10 Then  'If selected tool is greater than 10
MsgBox("Tool Out Of Range")  'Show message
End                          'End macro
End If

If GetselectedTool = GetCurrentTool Then  'If selected tool is the same as current tool then end macro
End
End If

 If GetSelectedTool=1  Then               'If selected tool = 1
 Do                                       'Start loop
 Call SetModOutput (9,1)                  'Toolchange signal to PLC to start turret indexing
 If GetInput (0) Then Exit Do             'Correct tool in position signal from PLC and exit loop
 Loop                                     'Continue loop if above signal is not present
 End If
 Call SetModOutput (9,0)                  'Cancel tool change signal to PLC
 
 If GetSelectedTool=2 Then                'If selected tool = 2
 Do
 Call SetModOutput (9,1)
 If GetInput (1)  Then Exit Do
 Loop
 End If
 Call SetModOutput (9,0)

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Can A Modbus control a.........
« Reply #37 on: July 30, 2008, 04:46:59 AM »
As can be seen the modbus signal to start  is Modbus 9, if the rack is back (switch LS24) then the output Y7 is activated to unclamp the turret, when the turret unclamped signal is present the output to rotate the turret is activated (rack fwd output). The signal for rack forward is now present so the turret clamp signal is lost and the turret clamps, the turret clamping loses the signal for the rack so it now moves back to the start and the routine repeats and repeats until the signal from the tool chosen is seen by Mach, Mach then stops the Modbus signal to the PLC and the indexing is complete.
 As can be seen Mach always knows which tool is present from the signals it gets from  LS 20, LS 21 and LS22 and unless the turret is clamped it will not see these signals.

Hood

Offline TT350

*
  •  113 113
    • View Profile
Re: Can A Modbus control a.........
« Reply #38 on: July 30, 2008, 07:19:11 AM »
Who's PLC are you using?

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Can A Modbus control a.........
« Reply #39 on: July 30, 2008, 07:31:23 AM »
mine :D

Seriously though its the DL-06 (D0-06DR) from Automation Direct.
 Oh and BTW the software is free (for up to 100 words I think)

Hood