ZIBO speed breaks

Support for Arduino in combination with Air Manager and Air Player

Moderators: russ, Ralph

Message
Author
bebe100
Posts: 59
Joined: Sat Sep 19, 2020 3:22 pm

Re: ZIBO speed breaks

#11 Post by bebe100 »

Hello
I'm not capable to integrate map function on this code:

function sb(val)
xpl_dataref_write("laminar/B738/flt_ctrls/speedbrake_lever","FLOAT",val)
end

hw_adc_input_add("HW_PORT_A0",sb)
Can you help me.
Thx again

User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: ZIBO speed breaks

#12 Post by Ralph »

Why are you using HW_PORT_A0?

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: ZIBO speed breaks

#13 Post by Keith Baxter »

Hi

There is a speed brake HW instrument in the store. Uses a sh90

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

bebe100
Posts: 59
Joined: Sat Sep 19, 2020 3:22 pm

Re: ZIBO speed breaks

#14 Post by bebe100 »

Ok.I shall look.still I need this map func to calibrate also the throttle becouse I use only 90 degree of the potentiometer and I start with 0 value after lets say 30% of travel

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: ZIBO speed breaks

#15 Post by Keith Baxter »

bebe100 wrote: Fri Nov 04, 2022 7:56 am Ok.I shall look.still I need this map func to calibrate also the throttle becouse I use only 90 degree of the potentiometer and I start with 0 value after lets say 30% of travel
Hi,

OK I will knock up something for you later this evening.


Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

bebe100
Posts: 59
Joined: Sat Sep 19, 2020 3:22 pm

Re: ZIBO speed breaks

#16 Post by bebe100 »

Thx Keith.
With help from everyone(almost you and "formula one" I finished throttle quadrant for Zibo with servos for throttles and it works just fine.it remain only to calibrate the throttle,flaps and speed breaks(I used potentiometer for speed break)
Thx again

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: ZIBO speed breaks

#17 Post by Keith Baxter »

Hi,

Here is a quick and easy for your speed brake lever.

You can add extra points into the interpolate table to suite your needs.
The first value is the potentiometer value. The second value is the value you write to the sim.

Code: Select all

--Zibo 737 MTU - SPEED-BRAKE LEVER

--*************************************************************************************--
--**                                  LEVER FUNCTION                                 **--
--*****************************************X*******************************************--
-- Create interpolate settings in ascending order
local sb_settings = { {0,0},
                      {0.3,0},
                      {0.5,0.8},
                      {1,1}}

-- Create a ADC input
hw_adc_input_add("autobrake", function(value)
   local brake_var = interpolate_linear(sb_settings,value)
   xpl_dataref_write("laminar/B738/flt_ctrls/speedbrake_lever","FLOAT", brake_var)
end)
Let me know how you get along.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

bebe100
Posts: 59
Joined: Sat Sep 19, 2020 3:22 pm

Re: ZIBO speed breaks

#18 Post by bebe100 »

Thx. I shall try Monday

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: ZIBO speed breaks

#19 Post by Keith Baxter »

bebe100 wrote: Fri Nov 04, 2022 3:06 pm Thx. I shall try Monday
No problem.

I will do the flaps lever shortly. Same principle. You will just have to add the pot values.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: ZIBO speed breaks

#20 Post by Keith Baxter »

Hi,

Here is your flaps lever code. All you have to do is change the pot values

Code: Select all

--Zibo 737 MTU - FLAPS LEVER

--*************************************************************************************--
--**                             FLAPS LEVER FUNCTION                                **--
--*****************************************X*******************************************--
-- Create interpolate settings in ascending order
local flap_settings = {{0.0,0},
                       {0.1,0},
                       {0.2,0.125},
                       {0.3,0.25},
                       {0.4,0.375},
                       {0.5,0.5},
                       {0.6,0.625},
                       {0.7,0.75},
                       {0.8,0.825},
                       {1.0,1}}

-- Create a ADC input
hw_adc_input_add("flaps", function(value)
   -- This print statement will give you your pot value for your flaps settings table above

   print("Pot value is   "..value)
   local flap_var = interpolate_linear(flap_settings,value)
   xpl_dataref_write("laminar/B738/flt_ctrls/flap_lever","FLOAT", flap_var)
end)
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Post Reply