search.noResults

search.searching

saml.title
dataCollection.invalidEmail
note.createNoteMessage

search.noResults

search.searching

orderForm.title

orderForm.productCode
orderForm.description
orderForm.quantity
orderForm.itemPrice
orderForm.price
orderForm.totalPrice
orderForm.deliveryDetails.billingAddress
orderForm.deliveryDetails.deliveryAddress
orderForm.noItems
COVER STORY


Figure 2: Communication protocol format


is a plug-in module that can be mounted on the MDI prototyping headers of the evaluation boards and can be confi gured for both supplying and receiving power from the data line.


The software To keep the code lightweight and minimise communication overhead, no standard communications protocols were implemented above the data link layer. All the messages are exchanged using the payload fi eld of Ethernet frames with a predefi ned fi xed format. Data is organised into 46-byte segments, composed of a 2-byte fi xed header and a 44-byte data fi eld. The header includes an 8-bit device type fi eld, which determines how received data is processed, along with an 8-bit device ID fi eld, which enables the selection of an individual physical device if more devices of the same type are present. The host interface is written in Python to ensure compatibility with both Windows and Linux hosts. Ethernet communication is managed using the Scapy module, which allows creating, sending, receiving and manipulating packets at each layer of the stack, including the Ethernet data link. Each device type defi ned in the protocol has a corresponding class that includes properties to store data to exchange, and a set of methods that can be used to modify these properties instead of having to directly edit the variables. For example, to change motion direction in speed mode for the motion controller, methods “setDirectionCW()” and “setDirectionCCW()” are defi ned, instead of having to manually assign 0 or


automationmagazine.co.uk


1 values to the direction fl ag. Each class also includes a “packSegment()” method that packs and returns the segment corresponding to the controlled device in the form of an array of bytes according to the predefi ned format for the considered device type. Firmware is written in C using the ChibiOS environment, which includes, among other tools, a real-time operating system (RTOS), a hardware abstraction layer (HAL) and peripheral drivers, allowing the code to be easily ported between similar microcontrollers. The project is based on three custom modules: • ADIN1110.c is the driver used to allow the exchange of data and commands with the ADIN1110 over the SPI interface. It includes low-level communication functions for reading and writing data from device registers, and higher-level functions for sending and receiving Ethernet frames. It also includes the function used to establish communication between 10BASE-T1L transceivers. The pin that notifi es if new frames are available is read on interrupt to minimise latency. • TMC5160.c implements all the functions needed to control the TMC5160 motion controller, confi gured to operate in full- featured motion controller mode. Both constant speed and position control modes are implemented, allowing smooth and precise positioning with six-point ramps. Communication with multiple motion controllers is achieved through a single SPI bus with independent chip-select lines. A set of functions and typedefs is also provided to ease motion synchronisation. • Devices.c is the interface between data


received from the T1L link and physical devices connected to the controller. It includes similar structs to the ones defi ned in the host interface and functions to update them each time a new frame with valid data is received. This module is also used to determine which actions are executed each time a struct is updated – for example, which physical motion controller is related to commands received at a specifi c device address.


Highlights and validations This project aims to demonstrate how the new 10BASE-T1L Ethernet physical layer standard can be integrated into automation and industrial scenarios to connect controllers and user interfaces with endpoints, such as multiple sensors and actuators. This application is targeted to the remote real-time control of multiple stepper motors, widely used in the industry for low-power automation tasks, but also utilised in light robots and CNC machines, such as desktop 3D printers, desktop milling machines, and other types of cartesian plotters. However, its use cases can also be extended to other types of actuators and remote-controlled devices. Its main advantages over already existing interfaces used for similar purposes are: • Simplifi ed wiring, requiring only a single twisted pair. The possibility to also deliver power on the data line allows low-power devices, such as sensors, to be directly powered from this connection, further reducing the wiring and the number of connectors, therefore lowering the complexity, cost and weight of the overall system.


Automation | November 2023 13


Page 1  |  Page 2  |  Page 3  |  Page 4  |  Page 5  |  Page 6  |  Page 7  |  Page 8  |  Page 9  |  Page 10  |  Page 11  |  Page 12  |  Page 13  |  Page 14  |  Page 15  |  Page 16  |  Page 17  |  Page 18  |  Page 19  |  Page 20  |  Page 21  |  Page 22  |  Page 23  |  Page 24  |  Page 25  |  Page 26  |  Page 27  |  Page 28  |  Page 29  |  Page 30  |  Page 31  |  Page 32  |  Page 33  |  Page 34  |  Page 35  |  Page 36  |  Page 37  |  Page 38  |  Page 39  |  Page 40  |  Page 41  |  Page 42  |  Page 43  |  Page 44  |  Page 45  |  Page 46