PX4 · configuration
TF-Luna with PX4 I²C / CAN / UART / TTL / UART: integration and configuration guide
Setup, connection, configuration and code guidance for TF-Luna with PX4. The original files are available in Materials and downloads. Documented interface: I²C, CAN, UART / TTL, UART.
Applicable setup
TF-Luna · PX4 · I²C, CAN, UART / TTL, UART
Technical instructions and steps
Configuring TF-Luna with IIC interface using Pixhawk (Px4 Firmware)
Introduction
the guide provides first-time testers with instructions on how to test TF-Luna using Pixhawk (Px4 Firmware).
Applicable product model of the guide :TF-Luna-IIC(Confirm the hardware version and firmware version of the product before testing.)
Test Preparation
----------------------------------- ----------------------------------- Preparing Tools Number
PC with windows system 1
4pin dubond wires 1
TF-Luna-IIC 1Pixhawk(PX4 ) 1
USB-UART converter 1QGroundControl
Px4 Firmware px4fmu-v3main1.13.px4 ----------------------------------- -----------------------------------
Slave Address Changing
Because multiple LiDAR sensors are involved, it is necessary to use the command to change the slave address (the default address of TF-Luna-IIC is 0x10, for example, change the slave address to 0x11) to send the command 5A 05 0B 11 00 in the input box ,as shown below:
To save the changed slave address, please remember to send 5A 04 11 00 in the command box, as shown in the following figure:
That is, changing the slave address is complete.
The following example was tested with six TF series sensors, the addresses were set to 16 (0x10), 17(0x11), 18 (0x12), 19 (0x13), 20 (0x14), 21(0x15), and the rotation directions were front, right, back, up, down and left.
Px4 Firmware Burning
To upgrade firmware using QGC ground station, go to Vehicle Setup -> Firmware page of QGC
Use USB to connect to the flight control, select ‘PX4Pro’ in the pop-up firmware Settings, check ‘Advanced Settings’, and select ‘Custom firmware’.
After loading our test firmware’px4fmu-v3main1.13.px4’, we enter the upgrade process.
Wait for the upgrade progress bar to complete.
Hardware Configuration
The Pixhawk is connected to the LiDAR and the computer (note that the LiDAR ID matches the ID set by the computer), as shown below:
[](schematic diagram)
[b4b44a51128f2b08bb8ae19acc80e06]
(Connection Example - for reference only)
Parameters Settings
Go to the Parameters page in the Settings and enter the keyword TF in the search box to find SENSENTFI2C, and change the value to 6. Parameter changes require a restart to take effect.
Restart the flight control and check the parameters again. There are 6 more SENSTFX_ADDR (slave address parameter of the x-th TF device), which is used to set the slave address. After setting, connect the LiDAR sensors to restart the flight control.
After the restart, set the test direction in turn.
This experiment set the direction in turn as follows:
Here, we tested six TF modules with configured addresses, and set their rotation into six directions: front, right, back, left, up and down. After restarting the device, the ranging value can be seen on the flight interface.The parameters are described as follows:
SENSTFX_ADDR //The slave address of the x-th TF device
SENSTFX_ROT //The orientation settings for the x-th TF device
SENSTFX_MAXD //The maximum ranging setting for the x-th TF device in cm
SENSTFX_MIND //The minimum ranging setting for the x-th TF device in cm
Above 16 (0x10) 17(0x11) 18 (0x12) 19 (0x13) 20 (0x14) and 21(0x15), the rotation directions are forward, right, backward, up, down, and left, respectively.
Data Test
Edit the data sheet below the QGC flight interface and add the range display value
Click the pen flag to enter the edit mode, and click the value to modify the display content and modify the display of six ranging direction values.
After modification, the display effect is as follows:
Note: After installing 4 LiDAR sensors, the data is stuck and refreshing is slow.
The solution can be: I2C pull-up resistor resistance and power supply voltage, transmission speed, bus capacitance (load factor) are related, at different rates of resistance generally have the following: 1.5K, 2.2K, 4.7K. 100KHz. The rate we use is 100Khz. The recommended pullup resistor is 4.7K.
Use and verification
The technical content follows the readable source material. Confirm the product hardware revision, flight-stack or software version, and field safety boundary against the original material and current platform documentation.
Materials and downloads
- Configuring TF-Luna with IIC interface using Pixhawk (Px4 Firmware) · English source (DOCX)Complete inquiry to download
- TF-Luna IIC接口在开源飞控Pixhawk(PX4)固件上的应用 · Chinese source (DOCX)Complete inquiry to download
