# Building Wireless Control Applications with XBee and LabVIEW
## 5 Case Study
### Discussion  
This section discusses the results of the tests aimed at analyzing the performance of the proposed wireless control scheme, for controlling the position of a PEA according to the layout described in Section 3. A PI controller was selected for these tests but, obviously, other controller strategies could also have been used. All tests were carried out at 5 m distance with a sampling period of 100 ms. Different reference functions were used--ramp functions, for analyzing the behavior of the system to smooth changes, and step functions, for analyzing the behavior against more abrupt changes. The tests carried out and the obtained results have been summarized and some conclusions have been drawn below:  
1. The open loop wireless response of the system was evaluated. In this test it was checked that without any close loop controller, the error between the reference and the measured value was noticeable (which was around the 25% of the reference value), which invalidated this approach at high precision applications. 2. The introduction of a wireless control scheme (implemented in LabVIEW) and its behavior when using a ramp reference was studied. No error detection mechanisms were implemented in this test. The results showed that the percentage of the detected missed/corrupted messages was around 0.5% of the delivered messages. Even though this percentage was not very high for this particular test, the experimental results discussed in Section 4 showed that this percentage could reach higher values, potentially due to spurious interferences that depend on the environmental conditions. Consequently, some error detection mechanisms were included. 3. The behavior of the system when the error detection mechanisms were introduced in the wireless control scheme was also studied. These mechanisms were based on some fields included in the design of the frames, discussed in Section 3 (i.e., checksum and sequence number). A ramp reference signal was used to reproduce the smooth changes. In this test, the percentage difference between the reference and the PEA measured position was below the 1% or even less. 4. The behavior of the system to abrupt changes was also analyzed. For this purpose, a short test with a step reference of 50% of the maximum reference value was carried out. In this test, the delay introduced by the system could be appreciated due to the sampling period of 100 ms, and the inertia phenomena that came up in the PEA. However, in the permanent state, the error measured in the system was always below the 0.5% of the scale. 5. The repeatability of the system was studied. For this purpose, a square signal was used as reference. The square signal ranged between 0 and the 66% of the maximum reference value. The behavior of the response did not present relevant changes from the previous test. These tests showed that a close loop controller was needed. Since the authors focused on the analysis of wireless communications for the control applications, they chose one simple, well-known controller, more specifically a PI controller, even though the performance of the system could have been improved by using more advanced control strategies, such as [33; 34]. In the experiments discussed, the error of the PEA positioning system was eliminated for a constant reference, as expected, since the PI controllers, if properly tuned, permanently eliminated the error. The tests showed that the response of the selected PI controller for this control scheme was especially adequate, when the reference signal changed smoothly. In addition, some mechanisms were introduced to deal with missed or corrupted packages, improving the performance of the whole system. The results showed that wireless technologies introduce significant delay (around 46 ms were measured in Section 4 for two-way communication). However, the jitter was quite steady since the standard deviation of the delay measured in the tests was relatively low (around 5 ms).