Home » Build » Taranis LUA Script : Tune PIDs from your Taranis

Taranis LUA Script : Tune PIDs from your Taranis

Taranis LUA Script : Tune PIDs from your Taranis
[x_video_embed type=”16:9″][/x_video_embed]

The Taranis lua scrip is a super cool feature you can run on your Taranis.  It lets you tune PIDs and change vtx settings right from your Taranis.  If you are using a TBS Unify Pro or ImmersionRC Tramp VTX you can change your band, channel and even power output.

Learn how to tune your PIDs in this post.

Requirements for the Taranis LUA script
  • Taranis must be running at least firmware 2.2.0
  • A spare UART port on your flight controller that’s is at least F3.  Two spare ports if you are setting up the VTX controls.
  • RX that has a SmartPort wire like the XSR or X4R-SB
  • If setting up VTX, TBS Unify Pro or ImmersionRC Tramp
Parts Used in this Post

See how to build a Tokio X

Download and Prepare

First step is flash your Taranis to a compatible firmware.  You’ll need OpenTX Companion 2.2.0.  This is the program needed to connect your Taranis to the computer and flash the firmware.

Go to OpenTX and click OpenTX 2.2.0.  Scroll down to the bottom and download the OpenTX Companion 2.2.0 for your system.  I’m using Mac so I download the Mac version.

taranis luaClick the “SDCard content for 2.2.0″.  Make sure you download the correct file for your radio.

Download the lua scrips for the Taranis.  Get the downloads HERE.  Make sure you download the correct file for your radio.  I’m using the Taranis X9D+, BFSetup-X9-v0.3-0-g4cd7539.zip.

In the zip file there are two folders BF and TELEMETRY.  Go into the new SD card folder for the Taranis card.  Drag the BF folder into the SCRIPTS folder.  In the TELEMETRY folder there is a file BF.lua, drag that into the SCRIPTS/TELEMETRY folder inside the sd card.

Flash the Taranis

Put your Taranis into boot loader mode by pressing both the left and right horizontal trims towards the center and powering on.  It’s the same for the QX7.  Now plug your USB into your Taranis and computer.

Click the Settings Icon.  In the settings windows make sure you have the correct Radio Type set and the Build Options set.  Select the location where you downloaded the new SD card structure you downloaded earlier.

taranis lua

taranis lua


Spash Screen: If you want a different splash screen (the image that shows up when you first turn on your radio) this is where you add it.  Choose the location of the file on your computer.  The splash screen must be a .bmp file format and 212×64 pixels.  You can download the FlightClub splash image if you want :p

Welcome Audio:  To change the default audio sound when you first turn on your radio.   In the Sounds folder sdcard-taranis-x9-2.2V0010/SOUNDS/en/SYSTEM, change the hello.wav file to the sound file you want.  The audio file must be a .wav file.  You can use a free program like Audacity to convert .mp3 to .wav.  Export the wav file 32khz, 16bit, mono and uncompressed.  Save as hello.wav and replace your new file to the existing file in the SYSTEM folder.  The Taranis will play whatever file you named hello.wav

Next go to Application Settings and select the options you want.  Click OK.

taranis lua

Next download the new firmware for the Taranis.  Click the Download Icon.  In the popup click “Check for updates” then “Download FW”.  Click OK.  Then click the Write Firmware to Radio icon.

taranis lua
Flight Controller and RX Setup for Taranis LUA

All you have to do is connect the yellow SmartPort wire from the RX to any free UART port on your flight controller.  If you followed the Tokio X build, there’s nothing you need to do.  The Smartport wire is connected to UART 5 on the LUX v2.  It’s already set up.

For VTX channel/band/power control.  On the TBS Unify Pro, connect the SmartAudio wire from the VTX at any spare UART on the FC.

In Betaflight on the Ports tab, enable SmartPort for the UART you connected the yellow Smartport wire on your flight controller.

best race dronetaranis lua

For the SmartAudio wire, for the UART you connected, under Peripherals enable “TBS SmartAudio”.

In the configurations tab, make sure Telemetry is enabled.

Taranis LUA Setup

Go to DISPLAY 14/14 screen in the Taranis and setup a screen for the scrips.  Select Scripts / BF.  Done!

To get to the PID tuning screen, press and hold the PAGE button on the Taranis.  The first page is the PIDS, 2nd is Rates and third is the VTX channel and power if you are using the TBS Unify Pro or ImmersionRC Tramp.  Press menu to scroll through the pages.  Press and hold MENU to save your new PIDS.  Done.  Go rip!

If you found this post helpful, it would be super cool if you purchased the components from my store or purchase items from my Amazon links.  These posts are expensive and take a loooong time to make so the purchases make it possible for me to keep making them.  Thanks in advance, I greatly appreciate it 🙂

2018-01-06T06:24:46-06:00 Build|27 Comments


  1. Dan 06/02/2017 at 2:41 pm - Reply

    I have this setup on one build with no issues. In another build I am using an SP Racing F3 and XSR rx and it’s not fully working. I have the smart port wire going to UART1 tx (i think, might be rx but I’m not home to check) and I can see my PID values on the Taranis but only while Armed. Also I can not save the values at all. Any ideas where I messed up on this one? My KISS FC running betaflight with an xsr works perfectly.

  2. Jake Brown 06/04/2017 at 7:29 am - Reply

    Does this work for all video transmitters? The fx799t to be specific?

    • Mike Tseng 06/05/2017 at 11:29 am - Reply

      no right now the VTX settings only work with the unify pro and immersionrc tramp.

  3. David Lewis 06/05/2017 at 9:47 pm - Reply

    Just fyi I spent far to much time trying to get a wav file for my new hello.wav (used to be the tada.wav) as the welcome file to work only to find out it had to do with the sound settings so far any one following Mike’s vid, make sure you audio files at set like this (if using Audacity).

    In Audacity:
    – Open your file
    – Tracks -> Stereo track to mono
    – Set Project Rate to 32000Hz at the bottom left of the window
    – File -> Export, Wav Signed 16 bit PCM
    – Click “clear” on the metadata screen that appears

  4. Armond June 06/09/2017 at 7:57 pm - Reply

    Can the FrSky D4R-II be used to set this up?

    • Mike Tseng 06/09/2017 at 8:49 pm - Reply

      No it needs a smartport wire which the d4r doesn’t have

  5. Brad 06/15/2017 at 5:51 pm - Reply

    Mike this is a Very nice option to have when on the go Great Video as always Will you be doing A DTF version with this in mind the current version isnt and was wondering

    • Mike Tseng 06/16/2017 at 11:00 am - Reply

      yes I will have some DTF builds of this soon. thanks!

  6. Eric 06/20/2017 at 9:39 pm - Reply

    I tried to do what you said. Tx firmware is updated and the models are all there but I’m getting an “SD Card Warning Expected version 2.2:V0010” on start up and at page 14/14 it says “No Scripts on SD” when I try to setup page 2 for the PIDS. Oh well. Thought I had it made but don’t know what to try next besides a complete redo. I’ll do that tomorrow if no one has any advice. I am using the 16 gb card that came with the Tx. My models transferred over.

    • Mike Tseng 06/22/2017 at 7:51 am - Reply

      did you put the new card hierarchy on the card? the new firmware has different folders. it’s all in the post

  7. Eric Schellenberger 06/21/2017 at 3:31 pm - Reply

    First: Thank you for this tutorial. But now I have the dreaded start up message “SD Card Warning Expected version:2.2V0010” even though I have that version loaded on the SD card. Note that when I view the SD card outside of the Taranis Tx it comes up as “No Name” but all the files are in there and in place as shown on your video. Then when I try to select the Lua script on Screen 2 I get a message “No Scripts on SD”. I spent a few hours today messing with this but I’m out of my league. Maybe you could recommend a way to simply go back to a stable set up on my Taranis X9D+. I did get the radio updated to V2.2.0 and it works fine. It is just the SD card has issues. Thanks for your time.

  8. Eric 06/21/2017 at 6:51 pm - Reply

    Hi Mike, Good news! I was able to get rid of the SD card error screens and I now have the PID screen on page 2. It was a lot of trial and error and watching youtube but I think the issue was the SD card did not get a complete overwrite when I followed your instructions. I finally removed the SD Card from the transmitter and deleted its entire contents. Then I downloaded a fresh copy of the SD Card contents from Open Tx 2.2 and loaded that without the extras. That solved the SD Card error problem. Then I dragged the BF and BF.lua files into the correct spots on the SD Card. Now everything is good. I don’t expect to see my posts here since I got it sorted. Just delete them. But it may be helpful for you to know what happened to me. Thanks again for giving me a lot of the tools I needed to try this.

    • Mike Tseng 06/22/2017 at 7:52 am - Reply

      sweet, glad you figured it out!

  9. Eric Schellenberger 06/27/2017 at 5:29 pm - Reply

    Having a blast flying my Tokio X with your setup! But (there’s always a but!) I don’t have some of the setup/sound/switch things you have in your Taranis. For instance there’s no tracks for “engine off” and in special functions I only have L01 to L03 where you have many more. I’ll go back and look at the sound files stuff in your video but it looks very personal. I don’t want to put little sound bites into my Taranis but if there is a whole folder of stock sounds to drop into the Tx somewhere that would be cool.
    Thanks again, I can’t wait to play around with PID settings at the field someday.

    • Mike Tseng 06/27/2017 at 9:55 pm - Reply

      there are sound packs you can dl from opentx:


      • Eric 06/27/2017 at 10:24 pm - Reply

        Hmm, thanks, I thought I did download those! The SD card one for 2.2… I’ll have a look at the files when I get a chance. To me it looks like I still have the older Taranis files from before the upgrade. Plenty of You Tube videos on this subject Thought.

  10. Oscar 07/03/2017 at 2:57 am - Reply

    No you need “smartaudio” that the TBS vtx have or whatever thing the tramp vtx have.

  11. Eric 07/03/2017 at 8:52 pm - Reply

    I wish I understood last post but I will try to figure out what you said… Thanks!

  12. Troy Matthews 09/09/2017 at 1:43 pm - Reply

    Thanks a bunch for this…. got me running PIDs and TBS vTx info on my QX7. My quad is using a RotorGeeks ss3 FC.

    • Mike Tseng 09/11/2017 at 9:46 am - Reply

      sweet! I don’t think I can do another build without the LUA scrip

  13. jeremy 09/17/2017 at 11:10 am - Reply

    Are you willing to provide the wav file for your “welcome to flight club” greeting?

  14. Luc 09/18/2017 at 3:26 am - Reply

    Hi, thanks for all your guidelines and products !!! Last weekend I got in trouble with this configuration . My Taranis gone mad with strange sounds on the left stick and completely inoperative on Betaflight Configurator. (3.1.7) .
    I had to install the old firmware (2.1.9) back, but I don’t want give up for this issue because LUA Script it’s a great feature!
    Do you have any hint?

    Taranis x9d+
    FC : Lumenier Lux V1

    Luc B

    • Mike Tseng 09/19/2017 at 10:50 am - Reply

      i don’t know. i would flash it with 2.2 because this is the version needed for the LUA script.

  15. david2 03/23/2018 at 8:25 am - Reply

    I can’t seem to find any help on getting this to work.

    I have the Cicada F4 AIO running BF 3.3.0
    I have a Taranis Qx7 running OpenTX 2.2.1
    I have a Xsr running the latest firmware
    I have a TBS Unify Pro Race

    I have Telemetry making it back to the Tx with A2, RxBat, and RSSI showing up.

    I have the Lua script installed as shown in the directions.

    Due to limited UARTs on the Cicada, I have it wired with the following setup:

    s.Port on softserial on UART6 Rx
    smartaudio on UART6 Tx

    None of the PID settings or vTx settings show up in the LUA script. They all show ‘—‘

    Any recommendations?

    • Mike Tseng 03/23/2018 at 11:02 am - Reply

      for this setup, since there is only one spare UART, I would choose the BetaFlightOSD over the LUA script. I don’t believe you can have both on one UART. Connect the white smartaudio wire to TX6 and configure the Peripherals on TX6 to SmartAudio.

      • david2 03/23/2018 at 12:44 pm - Reply

        Thanks. I was afraid of that. I verified that it is working with BetaFlightOSD.

Leave a Reply

%d bloggers like this: