Replies: 3 comments 2 replies
-
If you find or code any LUA scripts to allow that, please tag me and let me know as I too could use this. |
Beta Was this translation helpful? Give feedback.
-
See if you have any luck with this custom mixes Lua script. i.e. save it as You can display the output value "mph" on the telemetry screen on B&W - check under "Lua Scripts" category in the popup menu when looking for it, as well as with widgets on colorlcd. -- To find mph from the rpm
-- Take the diameter of the object and multiply it by 3.14 = total feet
-- Multiply the total feet (diameter in feet) by the rotational speed (rpm)
-- This will give you a value for feet traveled per hour based on the rotational sped and the circumference.
-- Multiply this number by 60, then divide it by 5,280 this now converts the mph from the rpm.
-- https://www.omnicalculator.com/everyday-life/rpm
-- Vehicle speed = Wheels RPM × Tire diameter × π × 60 / 63360
-- where:
-- π is the circle constant; it represents the ratio between the tire's perimeter and its diameter;
-- 60 is the number of minutes (from "rounds per minutes") in an hour (from "miles per hour"); and
-- 63360 is the number of inches (from the Tire diameter) in a mile (from "miles per hour").
-- https://www.rctech.net/forum/radio-electronics/795026-converting-rpm-speed-mph.html
-- Step 0: y = x/12, to convert inches to feet
-- Step 1: Calculate diameter in feet. For example, if the diameter equals 1.2 inches enter 0.10.
-- Step 2: Multiply by "Pi" 3.14159265 (This changes your diameter to a circumference, also called "rollout" in R/C circles)
-- Step 3: Enter the rotational speed of your tire. If your telemetry is telling you motor RPM, then divide your motor RPM by your final drive ratio. Taking into account your transmission ratio and your spur/pinion ratio.
-- Step 4: Multiply by "60" because you need to multiply by 60 to convert from feet per minute to feet per hour.
-- Step 5: Divide by "5,280" to find the speed in mph. You divide by 5,280 to convert from feet per hour to miles per hour.
local input =
{
{ "Rpm", SOURCE}, -- user selected rpm telemetry value
{ "Ratio", VALUE, 1, 100, 100 }, -- final drive ratio
{ "Wheel", VALUE, 1, 1000, 250 } -- wheel diameter in inches (multiplied by 100 to get two decimal places from integer)
}
local output = { "mph" }
-- Called once when the script is loaded
local function init()
end
-- Called periodically
local function run(Rpm, Ratio, Wheel) -- Must match input table
local Mph, rpmValue = 0
if Rpm ~= 0 and Rpm ~= nil then
Mph = Rpm * (Ratio/100) -- RPM divided by total geartrain ratio
Mph = Mph * (Wheel/100) -- diameter in inches
Mph = Mph * 3.14159265 -- circumference / rollout
Mph = Mph * 60 -- feet per minute to feet per hour
Mph = Mph / 63360 -- inches per hour to miles per hour
-- print("Mph: " .. Mph)
end
-- return Mph -- colorlcd
return Mph * 10.0 -- bw
end
return { input=input, output=output, run=run, init=init }
|
Beta Was this translation helpful? Give feedback.
-
Looks good. Will have a play with that. I had a skyrc Bluetooth gps arrive today so can see if it's working.
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: inventor7777 ***@***.***>
Sent: Friday, August 9, 2024 11:07:55 PM
To: EdgeTX/edgetx ***@***.***>
Cc: Gaz-B ***@***.***>; Author ***@***.***>
Subject: Re: [EdgeTX/edgetx] Displaying motor RPM from Spektrum telemetry as MPH. (Discussion #5370)
Ooooo...that looks promising!
—
Reply to this email directly, view it on GitHub<#5370 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AF5PA2CI6YOJD6ZKKNWEGJLZQU4TXAVCNFSM6AAAAABL6FEMGWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAMRZGE3TIOA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I'm looking to put the final drive ratio and wheel diameter into the TX to log max speed on the telemetry screen. Probably a job for a lua. Any help greatly appreciated. Gary
Beta Was this translation helpful? Give feedback.
All reactions