Obsidean_VM/01-Documentation/Vetromeccanica/Micromeccanica Guides/Micromecanica Motor Guides ...

8.3 KiB

Gateway and Motor-Box System Programming Guide

System Overview

The system consists of three main components:

  1. Gateway board
  2. Motor-box board
  3. Actuators

The Gateway board communicates with Motor-box boards through two independent serial ports. Each serial port can communicate with up to 32 Motor-box boards, for a maximum capacity of 64 Motor-box boards. However, the maximum number of Motor-box boards may be limited by the technical characteristics of the network master (PLC) used. Each Motor-box board can control up to eight actuators (motors).

Network Architecture

  • The gateway communicates with the network master (PLC) via an Ethernet interface (EthernetIP, Profinet, etc.)
  • The gateway communicates with Motor-box boards via RS485 serial communication
  • Communication with Motor-box boards uses polling methodology, starting from node 0 and proceeding sequentially

Gateway Board Configuration

DIP Switch Settings

Switch Number Description OFF Position ON Position
1-5 Highest Motor-box node number (0-31), binary coding Binary values: 1,2,4,8,16
6 Motor-box network baud rate 38400 bps 57600 bps
7 Port enable Disabled Enabled
8 Reserve

Notes on configuration:

  • The highest node number determines how many Motor-box nodes will be polled
  • When using Ethernet/IP (e.g., Rockwell), the sum of the highest node numbers on both gateway ports must not exceed 18
  • Setting switch 6 to ON increases communication speed but decreases noise immunity and maximum network length
  • If one of the two ports is not used, set only switch 7 to ON for that port and all others to OFF

Baud Rate Settings

  • OFF (recommended):

    • Baud rate: 38400 bps
    • Polling interval: 25ms
    • Example with highest node set to 10: 11*25ms = 275ms to communicate with all Motor-box boards
  • ON (not recommended):

    • Baud rate: 57600 bps
    • Polling interval: 17ms
    • Example with highest node set to 10: 11*17ms = 187ms to communicate with all Motor-box boards

Motor-Box Configuration

DIP Switch Settings

Switch Number Description OFF Position ON Position
1-5 Motor-box node number (0-31), binary coding Binary values: 1,2,4,8,16
6 Motor-box network baud rate 38400 bps 57600 bps

Important notes:

  • Set Motor-box nodes in sequence without skipping intermediate nodes
  • Avoid using node 0 as it is the factory default
  • The baud rate setting (switch 6) must match the Gateway's baud rate setting for the corresponding port

Communication Protocol

ADI Structure Sequence Order

ADI Type Description
ADI#110 GATEWAY "P1" READ Gateway firmware and connected boxes on port P1
ADI#111 GATEWAY "P1" READ Status of motors and boxes on port P1
ADI#120 GATEWAY "P2" READ Gateway firmware and connected boxes on port P2
ADI#121 GATEWAY "P2" READ Status of motors and boxes on port P2
ADI#211 GATEWAY "P1" WRITE Motor commands for boxes on port P1
ADI#212 GATEWAY "P1" WRITE Motor current limits for boxes on port P1
ADI#221 GATEWAY "P2" WRITE Motor commands for boxes on port P2
ADI#222 GATEWAY "P2" WRITE Motor current limits for boxes on port P2

Programming Details

Motor Status Bit Definitions (ADI#111, ADI#121)

Bit Description
0 Forward movement in progress
1 Reverse movement in progress
2 Position reached
3 Error or alarm
4 In zero position
5 Moving at low speed
6 Reserved
7 Reserved

Motor-Box Status Byte Definitions

Byte Bit Description
0 0-4 Firmware version
5-7 Firmware revision
1 0 24V fuse blown
1 24V line low (<18V)
2-7 Reserved

Motor ==Command== Byte Definition (ADI#211, ADI#221)

Byte Bit Description
0 0-7 Position requested bits 0-7 (0-4095 = 0-409.5mm)
1 0-3 Position requested bits 8-11 (0-4095 = 0-409.5mm)
4 Position sign (1=positive, 0=negative)
5 ==Position mode (0=relative position, 1=zero then position)==
6 Stop motor (1=stop)
7 Reset alarm (1=reset)

Current Limit Byte Definition (ADI#212, ADI#222)

Bit Description
0-2 Reverse movement current limit
3-5 Forward movement current limit
6-7 Reserved

Current Limit Values:

Bit 2/5 Bit 1/4 Bit 0/3 Current Limit Value
0 0 0 650mA (default)
0 0 1 200mA
0 1 0 300mA
0 1 1 400mA
1 0 0 500mA
1 0 1 600mA
1 1 0 700mA
1 1 1 800mA

Programming Considerations

Command Execution

  • Commands are executed when either of the two command bytes changes, provided they are not both zero
  • When both bytes are zero, the command has no effect on the current movement
  • Due to asynchronous communication between the network master and gateway, and between the gateway and Motor-box, once a command is given, maintain the command active while monitoring the motor status until command execution is complete
  • Only stop the command when intentionally stopping the motor

Movement Limitations

  • Maximum stroke for actuator commands is limited to 409.5mm
  • For motors with longer strokes, use multiple relative positioning commands, waiting for positioning to complete before sending a new command
  • Sending a different command while a movement is in progress will interrupt the current movement and start the new command
  • To ensure accurate positioning, only send a new command when the current command has successfully completed
  • In case of error during positioning, the only way to ensure the actuator's position is to reset the actuator and repeat the commands

Configuration File Generation

GSDML File Generation (for Profinet)

  1. Make sure the Gateway board is not powered
  2. Set the Gateway's DIP switches based on the number of boxes connected to each gateway
  3. Power up the Gateway board
  4. Connect the PC to the Gateway's Ethernet port via Ethernet cable
  5. Start the "IP CONFIG" program and set the IP address for the Gateway board
  6. Start the "HMS PROFINET GSD Generator Tool"
  7. Follow the configuration screens to generate the GSDML file
  8. Import the GSDML file into the PLC project, inserting the modules in the following order:
    • ADI#110
    • ADI#111
    • ADI#211
    • ADI#212
    • ADI#120
    • ADI#121
    • ADI#221
    • ADI#222

EDS File Generation (for EthernetIP)

  1. Make sure the Gateway board is not powered
  2. Set the Gateway's DIP switches based on the number of boxes connected to each gateway
    • Note: Be careful not to exceed the sum of 18 as the total of the values set via DIP switches for the boxes connected to both gateway ports
  3. Power up the Gateway board
  4. Connect the PC to the Gateway's Ethernet port via Ethernet cable
  5. Start the "IP CONFIG" program and set the IP address for the Gateway board
  6. Start the "HMS EtherNetIP EDS Generator"
  7. Follow the configuration screens to generate the EDS file
  8. Modify the generated EDS file as needed
  9. Import the EDS file into your PLC project, disabling the electronic key check

Troubleshooting

Motor Does Not Move

  • Cause: Incorrect connection
    • Solution: Check the correct connection of the motor to the M12 connector of the Motor-box
  • Cause: Motor failure
    • Solution: Replace the motor
  • Cause: Motor has reached its maximum stroke
    • Solution: Verify the set positions or replace with a motor with greater stroke

Motor Stops with Alarm After a Few Millimeters

  • Cause: Incorrect connection
    • Solution: Check the motor wiring
  • Cause: Encoder failure
    • Solution: Replace the motor

Motor-Box Not Recognized by the Network

  • Cause: Incorrect 24VDC power supply
    • Solution: Verify power supply is never below 19VDC
  • Cause: Incorrect RS485 termination resistors
    • Solution: Properly install termination resistors based on network topology
  • Cause: Incorrect DIP switch settings
    • Solution: Verify DIP switch settings are correct
  • Cause: Wiring error
    • Solution: Check electrical wiring