Lanciers: Difference between revisions
| Line 114: | Line 114: | ||
Dancer software is an extended version of the Regbot software, where IO is extended to accept commands from the LoRa receiver. No return channel is enabled. | Dancer software is an extended version of the Regbot software, where IO is extended to accept commands from the LoRa receiver. No return channel is enabled. | ||
Version 0 control parameters: | |||
[[file: control-rev-0-velocity.png | 400px]] | [[file: control-rev-0-velocity.png | 400px]] | ||
Revision as of 09:13, 25 September 2025
Lanciers demo robots
Eight of these robots are planned to perform a group performance, similar to one of the tours in Lanciers.
Therefore, the robot is called a dancer, and the robot group manager a dance master.
Hardware
Each of the robots consists of two motors and a driver board of the same type used by Regbot.
The dance master is a Raspberry Pi.
The communication between the two is a (maybe one-way) LoRa radio connection at 433 MHz.
The dance master obtains the position of each dance from either Optitrack or by using a camera. The robots are then either equipped with a unique pattern of reflectors or a unique ArUco code.
Radio RFM98W to Regbot 6.3 board
Connector 1 (5-pin JST-ph 2mm)
1 black - 3.3V 2 red - SCK 3 white - MOSI 4 yellow - MISO 5 orange - GND
Connector 2 (line sensor 10-pin connector)
1, 2 NC 3 blue - DIO0 4 green - DIO5 5 yellow - reset 6 orange - NSS (CS) 7 red - DIO1 8 brown - DIO4 9,10 NC
LoRa radio
The LoRa radio connection uses an RFM98W radio module from HOPERF Electronics.
Connections
ant GND GND top DIO5 DIO3 view reset DIO4 NSS (CS) 3.3V RFM SCK DIO0 98W MOSI DIO1 MISO DIO2 GND
Antenna 16cm wire.
Dancer side
On the dancer side, the library used is the RFM98W_library from https://github.com/weustace/LoRaLib.
The configuration is controlled by 6 register values, of which only 4 are used:
/* # data sheet
* # register
* # byte 1: reg 1D, 4msb = BW 7 = 125 kHz, 9 = 500 kHz, 4 = 15.6 kHz
* # 4lsb = error coding 2 = 4/5, 8=4/8
* # byte 2: reg 1E, 4msb spreading factor: 7=128 chips / symbol, 9=512 c/s, c=4096 c/s
* # 4lsb mode: 4 = CRC on
* # byte 3: reg 09, bit 7=PAboost 1=used, 0=not, bit 6-4 = base power 0=10.8dBm,
* 4lsb power reduction 0=full power, 8 = half power f=minimum power (1dBm)
* # byte 4,5 not used.
* # byte 6: reg 26, 4msb = 0,
* # 4lsb: 4=AGC internal, not mobile, C= AGC internal + mobile node
*/
byte my_config[6] = {0x72,0x74,0x8F,0xAC,0xCD, 0x0C}; // fair - Pi ok
radio.configure(my_config);
radio.setFrequency(434700000);
This gives the following:
- The bandwidth used is 125kHz with coding rate of 4/5 (minimal overhead of 25%).
- Spreading factor 7 increases the sensitivity by 7.5dB
- Automatic AGC loop and flag as mobile.
The first two values need to be equal on both the receiver and the transmitter.
An interrupt is activated when a message is received. This should enable the rapid implementation of new mission plans without the need for constant polling for messages.
Note that at times, garbage is received, but then the CRC will return false.
Dance master side
The dance master is on the Raspberry Py and uses the pyLoraRFM9x library.
This is configured with 3 bytes:
from pyLoraRFM9x import LoRa, ModemConfig import time from enum import Enum class MC(Enum): Bw125Cr45Sf128 = (0x72, 0x74, 0x04) # Radiohead default fast = (0x92, 0x74, 0x0C) # a bit too much (500kHz bandwidth) fair = (0x72, 0x74, 0x0C) # mobile bit set (used)
The full setup is when the radio is instantiated:
# LoRa(CS pin, interrupt, ID, port, reset, frq, Tx power, modem config, ack lora = LoRa(1, 24, 127, 0, 25, 434.7, 10, MC.fair, True)
- Uses chip select pin 1 (GPIO7, NSS on radio), reset is pin GPIO25, and tx-interrupt is GPIO 24 (DIO0 on radio side).
- The device port is 0 (pins GPIO9 (MISO), GPIO10 (MOSI), and GPIO11 (CLK).
- Additionally, 3.3V and ground are connected.
- In total, 10 pins of the Raspberry Pi connector are used.
Dancer software
Dancer software is an extended version of the Regbot software, where IO is extended to accept commands from the LoRa receiver. No return channel is enabled.
Version 0 control parameters:
Dance master software
To be made.