• Nenhum resultado encontrado

The network implementation started by choosing the best modules that fit the project requirements and budget. The RobôCIn’s robot, shown at Figure 12, already has two nRF24l01 (Nordic, 2008) transceivers modules and uses a NUCLEO-F767ZI (ST, 2019a) board pro-grammed with mbed Operating System (mbedOS) (Arm,2019), which is a real-time operating system for ARM microcontrollers that allows the development of C++ codes, gives support for ARM peripherals, and emulates virtual thread.

Figure 12: RobôCIn’s Small Size Soccer (SSL) robot.

The mbedOS comes with built-ins libraries that implement different interfaces of commu-nication while controlling the board peripherals. So, the SPI between the board and transceivers used the read and write functions implemented in the mbedOS. On the other hand, the transceivers only accept and return messages if the program communicates with the correct register’s address.

The chosen module, the nRF24l01 transceiver, has specific registers for configuring the radio (address, power, and function), sending and receiving bytes. All of them are presented in the module datasheet (Nordic,2008). After configuring the nRF24l0, with the specification shown in Table 5, the radio sends and receives data with Enhanced Shock Burst (Nordic,2008), a proprietary technology. That technology allows the exchange of at most 32 bytes of payload and includes a CRC of bits, calculated inside the transceiver module.

30 30 30 Table 5: Project Modules and Configuration in Base Station and Robots

Base Station Robots

Transceiver nRF24l01 nRF24l01

Embedded Board Nucleo F767ZI Nucleo H743ZI

CPU Frequency 400 MHz 216 MHz

Operating System mbedOS mbedOS

Radio Frequency (Control) 2504 MHz 2504 MHz Radio Frequency (Telemetry) 2529 MHz 2529 MHz

Radio Address 0x753FAD299ALL 0x753FBD299ALL

Together with the RobôCIn’s robots and its software, this work proposes an embedded system for the base station. The Figure 13 shows the base station architecture and interfaces.

There are two nRF24l01 modules coupled by SPI to a NUCLEO-H743ZI (ST,2019b) pro-grammed by mbedOS, using the SPI library. The base station takes into consideration the hardware and software used in robots to maintain the same operating system while adding a faster microcontroller board, as shown by its Control Processing Unit (CPU) frequency at Table 5.

The choice of using a faster board is because even the robots receiving all broadcasted message, there is only one base station for multiple robots, which creates a bottleneck of messages.

Figure 13: Base station architecture of the proposed wireless network with Serial and Ethernet options between the Computer and Base Station.

The control communication from the computer to the robot uses one transceiver at the base station and another at the robot, as shown in Figure 14. In the base station, the transceiver is configured as a sender radio that targets the message to the address of the robots, shown in Table 5. On the other hand, the transceiver configuration in the robots uses the receiver mode with robot’s network address.

Finally, the computer, base station, and the robot share information with the protocols made. The base station and robots exchange bytes with nRF24l01 transceivers using the

configuration presented, but between the computer and station, this work brings two options of the interface: Serial and Ethernet (Figure 15). Moreover, both interfaces have support at the NUCLEO board and have built-in libraries in the mbedOS, allowing the transmission and reception of bytes between embedded boards and computers.

Figure 14: Diagram of radios used for control and telemetry network on the Base Station and Robot, together with its way of communication.

Due to the characteristics of the Serial interface, it is easy to implement, but it can only receive and send one byte at a time. Furthermore, to control the robots, was developed a base station that read each byte until they compose a message. Only with the message complete, the base station transmits packets to the nRF24l01. This concept is shown by Algorithm 1.

Algorithm 1:Transmission Concept for Base Station Serial Interface Approach

1 Initialize byte array and counter;

2 whiletruedo

3 //Read one byte at Serial;

4 byte array[counter] = read serial();

5 counter++;

6 ifcounter == message sizethen

7 //Send message to transceiver;

8 send bytes (byte array, message size);

9 clear (byte array);

10 counter = 0;

The second interface, the Ethernet, is used with UDP protocol present in the chosen embedded board, by the mbedOS support, and present at every personal computer. The UDP protocol is suitable for streaming data, as the control network. Moreover, different from the Serial approach, the Ethernet sends a group of bytes containing the sent message and also a header, as described in Chapter 2. In other words, the developed algorithm only waits for a message and re-transmits its bytes by the payload of the nRF24l01, as shows in Algorithm 2.

32 32 32 Algorithm 2: Transmission Concept for Base Station Ethernet Interface

Ap-proach

1 Initialize byte array;

2 whiletruedo

3 //Receive complete message and send.;

4 byte array = read packet();

5 send bytes(byte array);

6 clear (byte array);

Finally, the telemetry network to monitors the robot was developed using an additional transceiver present in the robot and the base station, as illustrated in Figure 14. First, the robot code was modified to measure robot’s status on top of RobôCIn’s robot code (RobôCIn,2019).

In the code, the telemetry transceiver is configured in sender mode, but different from the control network it uses the telemetry network frequency and addresses the base station (Table 5). With the robot status, the code encodes it, following the telemetry protocol, and sends through the telemetry transceiver to the base station.

At the base station, a virtual thread, parallel to the control code, was developed, and it configures the second transceiver of the base station as a receiver, expecting messages at the telemetry frequency. So, whenever a wireless message reaches the telemetry transceiver at the base station, it forwards the payload bytes to the computer, where the message is appropriately decoded and identified.

Figure 15: Proposed Base Station hardware.

Documentos relacionados