OpenTx Project

Discuss your radio gear here!
Post Reply
ian123
Recruit
Posts: 4
Joined: Tue Jan 26, 2021 9:40 am

OpenTx Project

Post by ian123 »

Hi
New here, but thought this was a good place to document a project I have started (please let me know if there is a better place to put this). I will use OpenTX, a receiver, 3 speed controllers and a Benedini TBS mini to replace the Clark controller in my Mato full metal Tiger 1. Attached is a first cut of a mixer script to take care of throttle/steering mixing. Currently it slows the track on the side you want to turn by up to 100% of the drive channel at maximum turn. It has a deadband around centre stick. You can set maximum forward and reverse speeds independently. I will be adding a delay to simulate acceleration and deceleration.

Remove the .txt from the file name. Put the script in the SCRIPT/MIXES folder on the radio and select it as a custom script. Select the throttle and steering channels in the script page. You can see the motor outputs on the same page as you move the throttle and steering. Back on the MIXES page select motorLeft and motorRight as the source on 2 mixes for the 2 ouput channels. You will of course need a speed controller for each motor channel. I'll try and add better instructions in a future post if there is any interest.

Just starting on OpenTx scripts so it may take me a while to get this all going.

Future plans: I hope to get a script to calibrate the 12 position input on the Benedini going next. I want to make a belt drive gearbox to remove drive noise. Scripts for canon recoil, elevation, and turret rotation (via a small speed controller). The Benedini will switch the canon and machine gun LEDs, along with the front lights.

All this just to get away from wiggling sticks on the Clark controller!
Ian
Attachments
tank.lua.txt
(1.42 KiB) Downloaded 217 times
ian123
Recruit
Posts: 4
Joined: Tue Jan 26, 2021 9:40 am

Update

Post by ian123 »

Hi
Updated the code to have maximum acceleration and deceleration values, along with braking deceleration. When moving in one direction pull the stick in the opposite direction to brake. Return stick to centre after braking to change direction. The deadband value is now hard coded in the script, along with the maximum values for forward and reverse (only 6 inputs maximum on a mix script). Code needs a tidy up and more comments. Will probably add some extra steering modes like the Clark, speed one track while slowing the other and spinning on the spot. Also needs an offset as one of my speed controllers has a small offset on the input so starts a little after the other one.
Ian
Attachments
tank1.lua.txt
(3.01 KiB) Downloaded 200 times
ian123
Recruit
Posts: 4
Joined: Tue Jan 26, 2021 9:40 am

Re: OpenTx Project

Post by ian123 »

Hi
A script to calibrate the Benedini sound card.
Put the script in the mixes script folder on the sd card and remove the .txt file extension from the name.
Connect 3 channels in OpenTX to the prop1,prop2 and prop3 outputs from the script.
Select a switch in the script page as the input to start the calibration.
Connect the 3 channels from the RX to the sound card inputs.

Once you start the calibration with the switch you have 5 seconds to push the button on the sound card. After that it runs the whole calibration with no user input.

Use the values in the prop3 array in the script to select sounds/actions on the sound card.

My instructions assume some knowledge of OpenTX and the soundcard. Please ask if you need help.

Still working on the previous script to simulate a 5 speed auto transmission.
Attachments
TBS.lua.txt
(3.19 KiB) Downloaded 190 times
User avatar
jhamm
Staff Sergeant
Posts: 951
Joined: Fri May 19, 2017 7:21 am
Location: Germany
Contact:

Re: OpenTx Project

Post by jhamm »

Hello Ian,
this is very interesting :thumbup:
thanks for sharing
ian123
Recruit
Posts: 4
Joined: Tue Jan 26, 2021 9:40 am

Re: OpenTx Project

Post by ian123 »

Hi jhamm

thanks for your support. I'm a bit slow with an update, so I added a sound output to the last tank file. Works quite well when connected to the TBS on my tank. Sadly the gear noise drowns out the TBS sounds at faster speed! I'll get the belt drive going eventually, plus an amplifier.

If anyone has a copy of the latest tbsflash it would probably help me out. I tried to contact Benedini but I get no reply. He sent me the original copy I have quite a few years ago.

I am still working on simulating gear sounds but debugging is difficult with opentx scripts. I will keep at it.

Ian
Attachments
tank2.lua.txt
(3.06 KiB) Downloaded 200 times
User avatar
Juggmeister
Recruit
Posts: 14
Joined: Thu Jun 24, 2021 5:14 pm
Location: UK

Re: OpenTx Project

Post by Juggmeister »

Hi Ian,
Really interested in this but I have no knowledge of open TX so any advice would be gratefully received.
I am currently printing a 1/10 scale Comet and to keep costs down I am trying to use 'stuff' I have in my spares box. Propulsion will be 2x 540 brushed motors with quicrun 1060 esc's, Turret rotation, barrel elevation and recoil will be servo. I have purchased a 2nd hand Frsky Taranis QX7 from fleabay and watched several how to video's on youtube about mixing channels etc to get the desired response in the tank. What is stumping me at the moment is getting sound into the vehicle and my google search for open tx and benedini lead me here. If you could explain to a complete numpty like me how to use your scripts I would most grateful. Being a cheapskate I was going to use a Dasmikro mini instead of benedini will the scripts still work?
Many Thanks
Regards
Steve
Post Reply

Return to “Radio Gear”