You can now adjust PID, rates and VTX settings right from your Taranis menu with Betaflight using LUA script and Smart Port. In this tutorial we are going to show you how.
This article is written by Artur Banach, edited by Oscar.
PID tuning has been made extremely convenient by the developers. It’s possible to do so with MinimOSD, your goggles and your radio transmitter, and now you can do it just using your TX with the PID values displayed on your TX screen! You can even adjust VTX settings such as channel and power with Tramp or Unify Pro.
This guide is written specifically for Betaflight firmware, however you can do the same with Raceflight and KISS.
- For KISS: https://oscarliang.com/change-pid-vtx-settings-taranis-lua-kiss/
- For RaceFlight: https://oscarliang.com/pid-vtx-settings-taranis-lua-raceflight
- Taranis X9D or QX7 TX
- X4R-SB or XSR RX (Smart Port required)
- F3/F4 Flight Controller with Betaflight 3.1.X installed and spare serial ports (For F4 FC, find out if Smart Port is supported natively. Some F4 might require inversion hack in order to get S.Port working)
- TBS Unify Pro VTX or ImmersionRC Tramp – Only needed if you want to be able to change VTX settings from Taranis
To allow PID tuning from Taranis, simply connect S.PORT from X4R-SB or XSR RX to any UART TX pin on the flight controller. It’s completely up to you which UART TX you want to use as long as it’s free.
For changing VTX settings, SmartAudio port from TBS Unify Pro (or Telemetry port from Tramp) also needs to be connected to one of the unused UART TX
This following image is an example connection of the Betaflight F3 flight controller.
Update Taranis OpenTX Firmware
Your Taranis TX has to be updated to the latest OpenTX firmware (we tested V2.2 RC14 successfully). The process is simple, and it’s covered here: https://oscarliang.com/flash-opentx-firmware-taranis/.
Download LUA Script for Betaflight
The LUA script for Betaflight can be downloaded here: https://github.com/betaflight/betaflight-tx-lua-scripts/releases
Please be aware that the LUA script files are different for Frsky X9D, QX7 and the Horus. Download the latest version available for your transmitter model.
The zip file contains 2 folders: BF and TELEMETRY, and the files needs to be copied to the SD card in your Taranis.
- Copy BF.lua file in TELEMETRY folder to the /SCRIPTS/TELEMETRY/ folder in your Taranis SD Card.
- And copy the whole BF folder to /SCRIPTS/ folder in the SD card. These are the script interface files needed to make it work.
Betaflight Configurator Settings
First of all, make sure SmartPort is setup properly:
- In Betaflight configurator, PORTS tab, find the UART where you have connected S.PORT to, then select SmartPort as the Telemetry Output
- Enable option TELEMETRY in Configuration tab
Extra Steps for Unify Pro and Tramp
If you have TBS Unify Pro or ImmersionRC Tramp, go to PORTS tab, find the UART you connected the VTX to, and choose which VTX you have under Peripherals.
For example on my LUX V2 FC (screenshot below), I am using SmartPort in UART1, TBS SmartAudio in UART2, and SBUS in UART4.
Choice of VTX, and Blackbox logging under Peripherals.
Don’t forget to hit “Save and Reboot” when you finish.
Setting up LUA script on telemetry page
We are almost there!
Once you have SmartPort set up, and you have copied the BF.lua file to /SCRIPTS/TELEMETRY/ folder on the Taranis SD card, we can proceed to the final step.
Go to page 13 DISPLAY in your Taranis. Here you can configure which telemetry screen to execute the LUA script. In Screen 1, choose Script as the first option, and then select the BF Lua script in the 2nd option.
You should be able to activate BF LUA script now by holding down the PAGE button (LUA script is triggered by entering Telemetry Screen 1).
Page 1 of the script is for VTX settings.
2nd page is for PID.
Last page of the script is for RC Rate, Super Rate and RC Expo.
After making PID or VTX setting changes on your Taranis, you can save it by long press MENU button.
That’s it!! I hope you enjoyed it, and have fun playing with PID tuning and changing VTX channels from your Taranis in the field! :)