Sampling Time Value Determination Method for Designing a Real-time Control System with Non-deterministic Time Elements such as Rotary Encoder and SPI
Erik Adiwiguna, Aryo Putro Sadono, Asep Nugroho, Estiko Rijanto, Afrias Sarotama · 2022
Different articles have published serial communication characteristics measurements for real-time control system (RCS). However, most of them focused on latency time measurements. Articles addressing a specific case with a combination of non-deterministic time elements such as rotary encoder (RE) and serial peripheral interface (SPI) are limited. This paper proposed a method to cope with a non-deterministic time due to the RE pulse timing by using a separate processor to handle pulse signals from the RE and time delay measurements of the SPI signal. It investigated the consumption time of each process, i.e., reading sensor signal, calculating control command, and sending control command. We used a microcontroller instead of a personal or industrial computer since the control system will be embedded in an electric vehicle (EV) for drive-by-wire (DbW) function. We obtained the experimental results of 4.42 µs and 6 µs for reading the sensor signal and sending the control command, respectively. The microcontroller required 1.2 µs to complete a simple control command calculation. The approach presented in this paper can generally be used for sampling time value determination in designing a RCS using the RE as sensor and SPI for sending the control command signals to the actuators. We obtained the appropriate sampling time value of 25 ms. It will be used for designing a feedback controller.