Low-latency wireless data transfer for motion control

• A submitted manuscript is the author's version of the article upon submission and before peer-review. There can be important differences between the submitted version and the official published version of record. People interested in the research are advised to contact the author for the final version of the publication, or visit the DOI to the publisher's website. • The final author version and the galley proof are versions of the publication after peer review. • The final published version features the final layout of the paper including the volume, issue and page numbers.


Introduction
In high-tech mechatronic systems a cable slab to the moving part of the machine is a source of disturbances.It introduces friction, stiffness, and damping and limits the stroke of the mover.In addition, the cables break after a certain number of movements due to the strains induced by the motion, resulting in machine failures.The application of wireless motion control is most promising in the semiconductor industry, where increasingly higher throughput and accuracy are demanded, for example, lithography, component placement, surface mounting, and wire-bonding.
When using air bearings or magnetic bearings, the cable slab is the only physical connection to the fixed world.The cable slabs are necessary to provide power to the mover and exchange information between the moving part and the controller, which is located on the fixed world.To omit a cable slab, both the energy transfer and information exchange should be made wireless.Contactless energy transfer is possible by means of an inductive coupling.Many wireless techniques exist that can reliably transmit data, such as WLAN TCP/IP, WLAN UDP/IP, Bluetooth, and Zigbee [1][2][3].These protocols, based on radio communication in the 2. 4 GHz ISM band, are designed to transmit large amounts of data and are optimized for high data throughput.With the exception of WLAN UDP/IP all protocols guarantee that the data arrives correctly at the receiving side, by means of packet retransmission.Since the time between sending and receiving is not critical for sending large data files such as website information, music, and movies, the delay is in the order of several milliseconds for WLAN UDP/IP and up to 20 milliseconds for the other protocols [4][5][6][7].Although a theoretical transmission time as low as several hundreds of microseconds is estimated for WLAN UDP/IP in [7] and for the latest 802.11eMAC level using Immediate Block Ack or Direct Link Protocol [8], measured data in [4] shows that the projected best case performance is not met in real situations.
Moreover, this delay is not constant but it has considerable variation or jitter [4,6].In some applications such a delay is no problem, like sensor systems to monitor temperatures [9] in buildings; however, for high-precision machines delays in the order of milliseconds are unacceptable for fast servo loops.
A lot of work is done to deal with this delay with observers and predictors [10][11][12][13][14] and to prove the stability of systems suffering from variable transmission delays [15,16].There is not much literature about wireless control applications.In one case an inverted pendulum is controlled using WLAN UDP/IP with a closed loop delay of 3.6 milliseconds [4], with a controller sample time between 167 and 250 Hz.The performance is mediocre, with angle errors of more than 20 degrees, although no observer or compensation is used for the delay.In another case, a similar plant is controlled using bluetooth [6] with a transmission delay of 17 milliseconds, which shows similar performance to the results presented in [4] and even instability if the delay compensation is turned off.
All these contributions use the standard protocols that are not developed for data transmission with a minimal delay.Moreover, using a wireless data transmission with delay in combination with observers and predictors will never work as well as removing, or greatly reducing, the delay itself.
The starting point of this paper is that none of the currently existing wireless protocols are suitable in motion control applications.Therefore, a new protocol, specially developed to minimize delays in the transmission, is investigated in this paper.Since all protocols are strongly correlated with the hardware [1,2] and usually low-level parts of the protocol such as MAC are embedded in the hardware, the hardware implementation of such a protocol is important as well.The requirements of such a real-time wireless link, software, and hardware implementation of the protocol and test results of the prototype are discussed in this paper.Finally, the behavior and stability of the wireless link in a real motion system are shown.

Requirements for a Real-Time Wireless Link
First, the requirements for a real-time wireless link are discussed, which are then compared with the characteristics of currently existing wireless techniques.Finally, a choice is made for the wireless channel and the protocol.There are three characteristics that are very important for a real-time wireless link.

Accuracy.
In high-precision systems position is measured in micrometers or even nanometers.For a linear motor with a stroke of one meter and an accuracy of 1 μm, this implies a precision of 20 bits.This prohibits the use of fully analog techniques, since it will be difficult if not impossible to maintain the precision.Therefore, the information should be sent digitally using data packets.

Delay.
A major issue is the definition of real-time, which has different meaning, depending on the application.The transmission delay or latency that is acceptable in the application usually defines whether something is real-time or not.In control, closed loop delay is one of the characteristics that determines the performance (i.e., bandwidth) of the controlled motion system.An ideal plant is considered, which consists of a mass (P(s) = 1/ms 2 ) with 2 milliseconds output delay.To investigate the influence of delay on the control bandwidth a controller with a stabilizing lead-lagfilter with a zero at one-third of the bandwidth and a pole at three times the bandwidth is assumed.The bode diagram of the plant and the controller is shown in Figure 1.This results in approximately 50 • phase lead at the control bandwidth [17] and with a phase margin of 30 • .The phase margin is shown in Figure 2. The following holds for the maximum bandwidth f bw for a given closed loop delay δ cl : In a plant the delay due to the sensor delay, actuator delay, and computing time is typically 1 millisecond; so adding another 1 millisecond by the wireless links reduces the maximum controller bandwidth from 56 Hz to 28 Hz.Since there are two wireless links in the loop, the maximum permissible delay for one link is only 500 microseconds.
In high-precision motion systems, with closed loop bandwidth requirements up to several hundreds of Hz, this delay is still unacceptable so a further reduction of the delay is desirable.However, the requirement of 500 microseconds is used as a start to benchmark the suitability of existing wireless techniques for wireless motion control.
Delay can be split into two parts.
(1) Static Delay.This type of delay is always the same and is caused by processing of the data in the protocol and the limited data rate.This can be kept small by using a simple protocol with small data packets and a wireless channel with a high data rate.
(2) Stochastic Delay.This is delay that is not constant but varies in time, mainly due to the retransmission of wrongly received data.The variation of the total delay is called jitter and is caused by this stochastic delay, which is purely related to the protocol.Moreover, retransmission of data is not useful for control applications, since it is better to wait for the next data packet than to waste time by retransmitting the old one.Other phenomena such as routing also contribute to stochastic delay.

Data Rate.
The data rate of the wireless channel directly influences the delay: if the data rate is doubled than the time needed to transmit, a packet through the wireless channel will halve.The data rate strongly depends on the frequency of the electromagnetic wave used to transmit the data and the modulation technique; for example, in optical systems data rates of Gbps are possible, and the currently available WLAN operates at 54 Mpbs.The data rate necessary to realize a wireless motion control system needs to be estimated.Each position measurement is about 20 bits accurate (1 μm resolution for a 1 m stroke).The sample frequency f s of the controller is 1 kHz, although higher frequencies are increasingly common (up to 20 kHz in nm stages).A significant number of actuators are single phase or 3-phase motors, which require one or two current setpoints, respectively, estimated at 12 bit per setpoint.If the commutation of the 3-phase motor is done locally, only one current amplitude setpoint is necessary.Finally, several enable and status bits are necessary to operate a motor.The manipulator consists of three 3-phase motors, and from this discussion it is assumed that 64 bits of data per packet is sufficient to transmit the necessary information.However, in wireless data transfer additional bits are necessary to encode the data into packets.Assuming that about two times the number of data bits is required and that 64 bits of data is sent at 2 kHz, the required data rate is finally estimated at 256 kbps.

Characteristics of Existing Wireless Techniques and Protocols
Several wireless techniques are currently available that send digital information, such as WLAN, Bluetooth, and Zigbee [1][2][3].Usually these protocols have strong links to the hardware implementation, but in principle any medium could be used to transmit the bits.All of these techniques operate in the 2.4 GHz ISM frequency band and their characteristics are listed in Table 1.From this table it is clear that all techniques have sufficient bandwidth.However, none of the techniques is able to meet the minimum delay specification of 500 microseconds.Another interesting characteristic is the difference between WLAN TCP/IP and WLAN UDP/IP.The delay for TCP/IP is about ten times higher than for UDP/IP.This is caused by the fact that UDP/IP is designed for streaming video transfer over internet and does not use packet retransmission; that is, wrongly received packets are not sent again.To meet the delay specification of 500 microseconds, it is necessary to develop a new protocol.

Custom Protocol
The delay requirement of the wireless system can only be met by means of a custom protocol with small packets that only consist of data and a minimum of additional overhead.Packet retransmission is omitted, since it is undesired in control applications; that is, only the most recent data is relevant.Since wireless motion control is confined to a Zigbee 250 Kbps [3] 15ms [18] machine or system, routing is omitted, since the inclusion of such a system needs to be incorporated from the start of the design.A smart use of channels and the limited range of transmission enables routing on a hardware level.
The wireless link must transmit 64 bits of data in a packet.How this data is acquired will be discussed later in this section.As discussed previously, the packet must be as small as possible to minimize the delay of the transmission.However, some overhead is absolutely necessary to ensure the correct transmission of the data.
(1) Start Bits.The beginning of the packet is marked with sixteen start bits that are the same for every packet.This ensures that the beginning of each packet is recognized by the receiver.
(2) CRC-16.To verify the validity of the data bits a 16-bit key is sent with the data to perform a cyclic redundancy check (CRC).CRC is a polynomial code, which means that bit strings are treated as a representations of polynomials with coefficients of 0 and 1 only.The CRC-algorithm is an error detection code and can be put in the following general form: ( Here M(x) is the original message polynomial, 64 bits of data, and K(x) is the key polynomial, with degree n.The bits of M(x) • x n are the original message with n zeros appended at the end.R(x) is the remainder polynomial, which is the CRC.In communication, the sender attaches the n bits of R after the original message bits of M and sends it to the receiver.The receiver takes M and R and checks whether If it is, then the receiver assumes that the received message bits are correct.From measurements at different data rates, a CRC-16-IBM (n = 16) code was found to be required to detect all errors.CRC-16-IBM is also used in USB.The key polynomial is 1 + x 2 + x 15 + x 16 .
(3) 8b10b Encode.The data transmission is asynchronous, which implies that the transmitter and the receiver do not operate with the same clock.Therefore, the clock rate of the transmission needs to be recovered.In order to be able to do so, there must be sufficient transitions between zeros and ones in the bitstream of the transmission.The 8b10b encoding guarantees that there are no more than three consecutive zeros or ones in the bitstream to accommodate the clock-recovery.The number of bits however increases with 25%.
(4) Error Detection Bits.Since the packet is very small, it is expected that a maximum of 1 bit per packet will be wrong.A Hamming code of 7 bits is added to the packet, which can correct a single erroneous bit and detect two.
Based on this structure of the packet, the total packet size n p will be 16 Start + 1.25 × (64 Data + 16 CRC) + 7 Hamming = 123 bits. (3) As can be concluded from the description of the packet, its structure is very basic and stripped of anything that is not absolutely necessary.Although it seems simple, such an approach is not documented in literature but offers great advantages for real-time motion control by minimizing the delay.

Hardware
The implementation of such a protocol requires a transceiver without any embedded protocol.A lot of transceiver chips for standard techniques (WLAN, bluetooth) have parts of the protocol embedded in the hardware and are therefore unsuitable for the development of custom protocols.Unfortunately, any protocol is strongly related to its hardware implementation; so this is also included in the discussion.
Optical techniques such as laser are not considered, since they require line-of-sight (LOS).This is hard to achieve for a motion system that has a long-stoke movement in the three-dimensional space.The advantage of optical systems is a high bandwidth and low bit-error-rates (BERs), but the LOS requirement makes it more difficult to implement.In a system with a purely rotating or linear movement, optical systems are more feasible.Therefore, radio waves are the best choice for the wireless data transfer, in particular the unlicensed 2.4 GHz ISM band.
There are not many commercially available radio transceivers that have no embedded protocol, and so the choice is limited.Moreover, RF design requires specific skills and it is time consuming.To overcome these issues a readyto-use RF starters kit (ML2724SK-02 from Micro-Linear [19]) is used that is based on a 1.5 Mbps FSK transceiver.If the transceiver is used as a transmitter, it converts zeros and ones on the input to an RF antenna signal.When the transceiver is used as receiver, the RF antenna signal is converted back to zeros and ones on the output.Due to filtering of the RF signal, variation of the time of each bit (jitter), and noise, not all bits are transmitted correctly.In Figure 3 the bit-error-rate (BER) is measured at different data rates.Since the packetsize is 123 bits, data rates higher than 1.5 Mbps are unacceptable due to the high BER.Moreover, this measurement is done with only one link.In the final setup the transmission will be full-duplex, that is, simultaneously transmitting and receiving in two directions, and so there will be two transmitters and two receivers, which will interfere with each other.Therefore, it is expected that the BER in the full-duplex system will be worse than this measurement.High-gain, directional antennas are used to limit the interference between the channels and the influence of other 2.4 GHz transmitters in the lab such as the WLAN router.Since the transmitter and receiver will only be one or two meters apart, the signal from these antennas is very strong within the workspace of the wireless link.Basically, the highgain antennas ensure that any other signal at that channel is overpowered.WLAN routers or bluetooth devices in the same area cannot use the two channels occupied by the wireless motion system, but their architecture is suitable to deal with that.
The transceiver has a adjustable amplifier to change the RF signal strength from the antenna.To prevent clipping of the signal, the gain is automatically adjusted by a microcontroller.This hardware choice of the wireless communication channel is by no means optimal, but given the commercial availability it is the best option.
The protocol itself is implemented on an FPGA (Xilinx Spartan IIE [20]).An FPGA is chosen since it allows parallel execution of code.Moreover, integer arithmetic is very fast due to the use of interconnected logic gates.In addition, it can execute several threads at different clock rates, making the FPGA a flexible development platform.The communication between the FPGA and the outside world (sensors, amplifiers and DSP) is done by means of digital IO and AD/DA conversion.

Transmitter Protocol.
Several operations are performed by the FPGA to sent data by one of the wireless transmitters (Figure 4).First, the sending of the start bits to the parallelto-serial converter is started.While these bits are being sent, the DA converters are triggered and the data is acquired from the AD converters or the incremental decoder.In a single clock cycle, a CRC-16 is calculated from this data, and the 64 bits and CRC bits together are 8b10b encoded, followed by the calculation of the Hamming correction parity bits.This data is added to the packet behind the start bits, just before all start bits are sent.Finally, the rest of the packet is put into the parallel-to-serial converter, driving the transmitter with this serial data.The timing of this A/D trigger assures that the most recent data is sent.The parallel-to-serial converter triggers the transmission of the next packet.

Receiver Protocol.
To retrieve the data correctly from the receiver, and due to the asynchronous reception, a 16x oversampling and clock recovery algorithm has been implemented.The clock recovery is required because the oscillator (24.756MHz) of the transmitter will never have exactly the same oscillation frequency as the oscillator at the receiver.Oversampling is also a necessity caused by each received bit period deviating from the average value (jitter).A Moore state machine is used as the oversampling algorithm (Figure 5).
When 9 consecutive samples are recognized with the same value, it is recognized as a valid input-bit.This algorithm also automatically recovers the clock from the data; hence it is known as a DCR (Digital Clock Recovery) circuit.This oversampling algorithm also compensates for the jitter (variations in bit duration).However, the algorithm only works properly when sufficient logical transitions are present in the data.To ensure sufficient logical transitions, an 8b10b encode has been applied.
While each bit is being received using the oversampling algorithm, each bit is concatenated into a 16-bit register like a sliding window.The data in the register is compared with the start bits.When the data in the shift register is equal to the start bits, a signal is generated which will trigger the data processing of the rest of the packet.The rest of the packet is put in an array of 107 bits.This is followed by a Hamming correction decode, which is able to correct a single erroneous bit.Consequentially, this data is 8b10b decoded, which leaves 80 bits.For the first 64 bits of this array a CRC is calculated, which is compared with the last 16 bits.Equality of the CRC's means that the first 64 data bits are valid and are thus sent to the output port.When a whole packet has been received (valid or not), a signal will trigger the search for the start bits of the following packet.False packets are ignored, due to the useless nature of data retransmission in motion control, and the previous valid data is hold at the output port.The entire protocol is visualized in Figure 6.

Expected Performance.
Using the packet size n p and the data rate d r of the data transmission, the delay in a single wireless link δ sl is estimated: where the factor 3/2 is added to take the sample and holds characteristic of the transmission into account.Besides the delay due to data rate limit, there is additional delay that is introduced by the AD/DA conversions and the buffers in the digital IO.In addition, the sample frequency is calculated by Since a wireless control system consists of two links the additional closed loop delay added by the two links is double  15

Identification of the Wireless Control System
To test these techniques a contactless planar actuator with manipulator is studied as shown in Figure 7.It consists of a moving magnet planar actuator with 6 DOF combining electromagnetic suspension and propulsion with a manipulator on top.The energy transfer is done by means of an inductive coupling between the fixed primary coils and the moving secondary coil.
The manipulator consists of a translating beam with two linear motors and an arm driven by a rotating motor.All three motors are coggingless and are equipped with encoders (1 μm and 40 μrad resolution, resp.).The manipulator on top of the floating platform needs to be controlled in synchronization with the magnetic suspension.Furthermore, in order to ensure accurate positioning of the tool center point (TCP) in 3D space, it is necessary to know the position of the platform and the position of the TCP of the manipulator with respect to the platform in real-time.Finally, the movement of the magnetic suspension and of the manipulator will influence each other, which requires feedforward compensation.The realization of these functions requires a real-time wireless communication link between the ground controller of the magnetic suspension and the floating platform.Ideally, the controller of the manipulator is located on fixed world, together with the controller of the magnetic suspension, which requires the entire control loop of the manipulator to be wireless.The proposed real-time wireless system is implemented to realize a wireless control loop.Measurements concerning the packet loss have been executed to evaluate performance of communication, and delay measurements have been done to determine the effects of the wireless communication compared to wired solutions.A position error measurement determines the performance regarding control.

Packet Loss.
In Figure 8, the packet loss ratio, which is the ratio between the number of noncorrectable erroneous packets and the total number of received packets, has been measured for four different data rates.In addition the ratio between the number of corrected packets, which had a single bit error that is corrected by the Hamming code, and the total number of received packets is plotted.The results show the difference in performance between one active link and two active links, caused by the interference between the links.The figure shows that up to about half of the packets which contained an error are corrected.Consideration should be made what is preferred for a specific plant: a rather large packet loss with the advantage of a very short delay, or a smaller packet loss ratio with a larger delay.

Transfer Function and Delay.
To test the wireless control system, a closed loop wireless control system has been built, in which the arm of the manipulator, driven by a three-phase synchronous rotary motor, is controlled.The controller DSP (dSpace DS1103) generates analog voltage signals, representing the motor current references, which are sent over the first wireless link to the input of the amplifier of the motor.The position of the arm is measured by means of an incremental encoder.The signals from this sensor are decoded to a 16-bit position, which is sent over the second wireless link and is read by the controller DSP using a 16bit digital IO.The transfer functions of the setup at different data rates have been measured using the Siglab spectrum analyzer.These "wireless" transfer functions are compared with the transfer function of the same control system without the wireless communication (wired).Figure 9 shows that the wireless system has hardly any effect on the gain of the system.However, at high frequencies the gain decreases with respect to the wired system, which is related to the fact that the commutation is done by the controller.The additional delay at this frequency influences the accuracy of the commutation, and an error in the commutation results in a lower gain.This can be improved by implementing the commutation on the FPGA and only sending the current amplitude over the wireless link.The phase shift increases when the data rate decreases, which is consistent with the extra delay involved.From the phase shift in the transfer functions, the delay is calculated for each data rate.These delays are variable as shown by   the probability density distributions in Figure 10, which is caused by the absence of synchronization between controller DSP and FPGAs.These difference between the maximum and minimum delay for each data rate is approximately 130 microseconds, which is significant; so synchronization should be a main issue in future improvements.The mean delays are rather consistent with the estimated delays, but slightly higher due to the A/D conversion times, buffers, and unsynchronized operation of the wireless system with the controller DSP.The variable delay can be reduced by synchronizing the wireless link and the controller, that is, start sending a packet with current setpoints directly after the controller finished calculating the setpoint values and transmit the latest position data just before the controller starts with the next sample.At the highest data rate, the average of the extra closed loop delay is just 270 microseconds.This delay is about 15 times shorter compared with the WLAN 802.11b solution [4], while just a fraction of the data rate is used (1.536Mbps against 11 Mbps).In all cases, the additional closed loop delay remains below the 1 millisecond specification.

Position Control
To determine the effects of the wireless communication on the control loop performance the position error of the arm in a wired closed loop system has been compared with the position error of the arm in the wireless closed loop systems.A PID controller is implemented that realizes a position loop bandwidth of 30 Hz, defined as the 0 dB crossing of the gain of the open loop transfer function PC.The phase margin is 46 degrees and the gain margin is 15 dB, if the delay of the wireless link is omitted.Due to the added delay in the loop, the phase and gain margin of the wireless loops are less and depend on the data rate of the wireless link.In Figure 11 the Nyquist plot of the open loop transfer function of the system is shown for the wired case and for the wireless case at different data rates.
If a packet loss occurs, additional delay is induced in the loop which is equal to the sample time of the controller plus the time delay between sending and receiving a packet.In Figure 12, the Nyquist plot of the open loop transfer function is shown including two sequential packet losses.In this case, all systems are stable but the margins have been reduced to approximately 30 degrees and 10 dB, while the maximum

Implementation of the Wireless System on the Manipulator
From the initial tests with a SISO system, the final wireless control system for the entire manipulator is derived.The first requirement is that all information should fit within the 64 bit of data in the packet.The commutation is done locally by the FPGA, which implies that the controller only needs to send three current amplitudes, one for each motor, that are converted to 3-phase current commands to the amplifiers.The allocation of data in the data packets is shown in Table 4.To save space on the manipulator platform, all communication is implemented on a FPGA board.Since the same protocol and packets are used as in the tests with one motor, the performance of the system in terms of packet loss and delay will be the same.

Discussion
The problem with existing wireless communication methods is the large protocol overhead.These protocols are developed for the transfer of large files, and obviously, one does not care whether there is a delay of several milliseconds between the sending of a picture file and its delivery.In addition, a higher data rate does not imply a lower delay due to the protocol overhead.The approach presented in this paper demonstrates that a specific protocol is necessary to realize the low latencies required for motion control.The advantage of this approach is that an increase of the data rate does give an equal decrease of the delay.Since this work has focused on the wireless protocol, the wireless radio (2.4 GHz FSK transceiver) used is far from ideal and improvements can easily be made by using better transceivers (up to 400 Mbps UltraWideBand is now commercially available), infrared (up to 24 Mbps), or laser (up to several Gbps).The choice strongly depends on the application.Using a 54 Mbps transceiver that is used in WLAN in this system would result in an additional closed loop transmission delay of less than 10 microseconds.If transmission delays are reduced to these levels, redundancy can be incorporated, that is, sending multiple packets with the same position information in one sample, to guarantee a 100% reliability.

Conclusions
A new protocol and implementation for low-latency wireless communication is presented that is suitable for wireless motion control and that overcomes the unsuitability of currently existing wireless communication protocols.The additional closed-loop delay is reduced to 300 microseconds which is more than 10 times smaller than other known methods.This low delay was realized with a low data rates up to 1.536 Mbps.Since the delay in this protocol is inversely proportional to the data rate, much lower delays and lower packet loss ratios can be easily obtained by optimizing the wireless channel.The behavior of a wireless motion system, consisting of an arm driven by a 3-phase ironless rotary motor and a PID controller with a 30 Hz bandwidth position loop, is shown.The stability of the system is demonstrated using Nyquist analysis of the open loop transfer function.
The results show errors in the range of several millirads, and the behavior of the wireless motion control system can be further improved by adding synchronization between the wireless communication link and the position controller.

FrequencyFigure 1 :Figure 2 :
Figure 1: Bode plot of an ideal plant and a controller.

Figure 5 :
Figure 5: Moore state machine for the oversampling algorithm.

Figure 8 :
Figure 8: Measured packet loss ratio and packet correction ratio.

Figure 9 :
Figure 9: transfer functions of rotary motor with wireless link at different data rates.

Figure 10 :
Figure 10: Measured additional closed loop delay probability density at different data rates.

Figure 11 :
Figure 11: Nyquist plot of wired and wireless open loop transfer function PC.

Table 1 :
Characteristics of several wireless communication techniques.

Table 2 :
Delay and sample frequency for different data rates.In Table2the additional closed loop delay δ wl and sample frequency f s are listed for different data rates d r , considering only the delay due to the limited data rate.

Table 4 :
Data allocation within the data packets.