MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
HBilliet
Posts: 28
Supporter
I'm planning to get back on MobiFlight after more than a year. Looks like a lot has changed since then. What an improvements!

I looked at several release video's, and just see that shiftregister output is now possible. Great, because my PCB ordered with JLCPCB is about to arrive in a few days, and this contains a few STP16CPC26MTR, which are 16 bit shiftregisters to drive LEDs (constant current outputs). I hope they are supported by MobiFlight, but I guess they are - they have the common SPI interface using SDI, CLK and LE inputs. Fingers crossed.

But I also see that there is a PWM option? How can this be used? The STP16CPC26MTR has an OE pin that can be used with a PWM signal. This means that if I use the chip to drive LED's, that I can dim all LED's using this PWM signal.

I seem not to find anything on google, which is a bit weird. Maybe because this is a relative new feature? Does somebody has an idea how to use this?
2021-12-02 22:01
Avatar
HBilliet
Posts: 28
Supporter
Not sure if this is in the right category? Should I post this on software?
2021-12-03 12:01
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

I have no confirmed information about this.

PWM Support is something prety new..... We not support this all over the years. Just in case a rare number of users want this, we implement it and as i know it work fine for single Pins ( i not use it cause for my project PWM is no factor..... but the feedback from other users sounds good)

So..... logical i would say PWM not work for Shifts..... Cause how should a PWM Output define different "individual" States for multiple Outputs that are selected to a Shifter ???

For sure.... If the Shifter have a "indicator" Pin that define the PWM Status for ALL used Outputs on that register.... then i think we can do it....
Means the Shifter is controlled in basic state ( By the required pins) AND it have a Additional Pin that define the PWM Status.....
Then we could use ONE Output Config ( LED) that is located to THAT Pin and this PWM State define all connected LED Outputs on that shifter.

I not test it..... Just logical i think this is working.... But for sure it is not possible to define multiple PWM Values on a single Shift Register, Right ??
Good Luck !
2021-12-05 02:06
Avatar
HBilliet
Posts: 28
Supporter
As far as I know, shiftregisters have an OE pin, which enables or disables all outputs at once. If you connect a PWM signal to that pin, you can control the brightness of all outputs at once with that PMW signal. I want to control that OE pin with PWM, because I'm using this to drive the brightness of my backlighting. (for people interested in why I'm using a shiftregister for backlighting, I give some reasoning at the end of this post).

I was kind of hoping that the PWM setting of the shiftregister could be connected to a separate output pin, which could then control the OE pin. But honestly, this might be overkill, because you can also do that by just creating an additional output and make it PWM controlled. Connect this to the OE of the shiftregister, and this works exactly the same. So the PWM functionality in the shiftregister is not very relevant - I'm not even sure if it is implemented at all?

Today I experimented with the analog input as well, and used this to control the brightness of my backlighting. I used a MobiFlight variable for that:
Potentiometer --> Analog input --> MobiFlight variable --> output pin PWM enabled
It worked as a charm! I even added a push button with toggle functionality (if($=0,1,0)) to switch my backlighting on or off, also using a MobiFlight variable.

>>> Reason why I'm using a shiftregister for controlling backlighting.
I'm connecting my backlight to a shiftregister because it's cheap, and allows me to control brightness through PWM. First of all, I don't like to use resistors in series with LED, because especially for backlighting, sometimes you have 1 LED, 2 LEDs, 3 LEDs... all in series. I connect the LED's to 12V supply, which means that the resistor has to be recalculated every time depending on the number of LED's in series. And it's also not very stable, because the Vf of the LED is not always the same. I originally used for each channel a single LED driver that gives a constant current of 20mA. Example is the NSI45020AT1G, which costed me about 0.58 EUR a piece. But to be able to use PWM for brightness control, I also needed to add some transistor logic. All that is the reason why I considered a shiftregister with constant current outputs. I'm using the STP16CPC26MTR which has 16 constant current outputs (can be controlled with an external resistor - 1k gives me 20mA outputs), and it has an OE pin that can be driven with PWM to control the brightness of all outputs at once. And this costs only 1.67 EUR (!!!), all included! Even if I'm only using 8 of the 16 channels, it's still a lot cheaper than using a set of individual NSI45020AT1G and adding transistor logic for PWM. And it even uses less space on my PCB.
2021-12-05 19:03
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi Again

Your situation is discussed a lot of time.....

The important Factor is : Do you need a "Sim Sync" Situation ??

Some people build for example just a "Multi Box" that include some systems of the Aircraft..... BUT they use the Virtual Cockpit same time ( e.g. for the Overhead they not build already)
those users sometimes wants to controll the Backlight in a SYNC mode..... means if they turn a real Encoder on there Multibox, then the Backlight of the Real Box AND also the Backlight of the Virtual Cockpit should be dimmed. Or inverted.... if they dimm the Virtual Cockpit by turn the Mousewheel over the virtual Encoder, then also the Real Backlight must be involved!

I will say..... THIS is a small Group.... Cause most users build simply a Full Cockpit ( and no longer think about the Virtual Backlight) OR they simply not care about Backlights anyway.


***************
So ask yourself....
Do you need to interface your Panel Backlight to the Sim ???
If NOT....
then not think about Shifters or any Mobiflight Variables....
Simply Build your Backlights fully indipendet by the sim....

E.g. LED Stripes with a PWM Controller (12V Power Suply).
So You Dimm the real lights with a cheap Poti (Controller) and this have no effect to Sim Status anyway!
Cheap, Easy, and no Transistors or Resistors needed, in case its PWM already !

EDIT:
For Sure.... then the Backlight for example also workes whatever the sim is not loaded or the Master Battery Switch is OFF. ( Cause no indication to the sim anymore)
You can solve this by a simple Relais....
So Backlight is OFF-Power aslong the Relais is OFF...... This relais e.g. is controlled by Mobiflight ans say "Only if Sim is Running and Master Avionics Switch is ON then give Power to the LED Backlights"

I hope you understand!
Good Luck !
2021-12-07 01:08
Avatar
HBilliet
Posts: 28
Supporter
Hello pizman82,

Thank you very much for your long answer. And yes, sure, I understand you completely. I am probably part of that small group. I really love to build the things, and dig into the full details of it. My personal challenge is building the A320 FCU as close as the real thing - and I'm pretty close. I know that many people will say "are you crazy?". But maybe it's because I like more the building than the flying.

And the reason I used a MobiFlight Variable to control the backlighting with PWM was for me just a learning experience, to better understand your tool. And the proof that your tool is really good and intuitive is that in only 2 days time, I was able to control things with a button, have LEDs light up, use an encoder to tune the SPD, control a 7-segment display, read analog inputs and control a backlighting based on PWM. Honestly, I don't think that there are many tools that would allow me to achieve this in such a short time. But because it is so "easy" to achieve these goals with MobiFlight, it of course means that you quickly start digging in the details. If there are things in the tool that are not that intuitive, or for which there is no documentation, then this forum is (I hope) the right place to ask, right?

And about "Sim Sync" related to the backlighting. You are right, and I thought about it, that I can control this completely "out of the sim". But if the Fenix A320 will be released (if ever), and they have a lot of failure possibilities, and a breaker trips that shuts the backlighting down, then I would like to have this effect in my real cockpit. I'm sure that there is only a small group that will look in such detail, but that's just the fun of making a "real simulation "B)
2021-12-07 19:03
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
iconHBilliet:

Hello pizman82,
If there are things in the tool that are not that intuitive, or for which there is no documentation, then this forum is (I hope) the right place to ask, right?



Yes. Whatever... Lots of the Support is meanwhile done on DISCORD.... In case there we have posibility to share Pics, Files and make Conversation via VoIP for free.
https://discord.gg/99vHbK7

About last comment.....
iconHBilliet:

I know that many people will say "are you crazy?". But maybe it's because I like more the building than the flying.
.... I'm sure that there is only a small group that will look in such detail, but that's just the fun of making a "real simulation "B)



Thats fully OK and your on the right place !

I always remeber to the guy who built a Aircondition for his Homecockpit and combine the RPM of his Ventilation motor to the RPM of the Engine and the ALT Value to simulate Airflow and Temperature of his Homecockpit to the Real Aircraft style.

Nothing is Stupid..... Aslong it´s possible !
Good Luck !
2021-12-08 00:10
Avatar
HBilliet
Posts: 28
Supporter
iconQuote:

I always remeber to the guy who built a Aircondition for his Homecockpit and combine the RPM of his Ventilation motor to the RPM of the Engine and the ALT Value to simulate Airflow and Temperature of his Homecockpit to the Real Aircraft style.



Happy to see that there are even people that are more crazy than myself :w00t:

I'm not so familiar with Discord. I have an account on it, but don't really know how to use it. I've been on it, and it was all very .... messy. Lot's of people talking, but couldn't easily follow a conversation. I think I will need a training course from one of my sons.:lol:
2021-12-09 22:22
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
iconHBilliet:


I'm not so familiar with Discord. I have an account on it, but don't really know how to use it. I've been on it, and it was all very .... messy. Lot's of people talking, but couldn't easily follow a conversation. I think I will need a training course from one of my sons.:lol:



Yeah.
Discord is not a Forum....
You not have a Topic for one Question or Thematic..... Its like a neverending conversation you can scroll up and down.

So YES.... On first view its messy and not so profitable like the forum here..... ( Thats why i use the forum already to solve Problems)
BUT
Its more helpfull if you have simple questions like "Does anybody know what the little switch next to COM1 in the Cessna172 do"
Cause hopefully one of the 300 other people that are online at the moment read this same moment you write it and awnser directly to you.
Here in Forum the Disadvantage is... Your question is read only by 2 Poeple who have the job to reply.... May by luck a other user can help. But normaly not.

So.... Simply choose the best Plattform for your request....
A detailed Question you need support from the "devs" here the FORUM is a good spot.
A easy short "by the way" question that can be known by a lot of users ..... DISCORD is the spot.

And finally .... A Deep Project you need backround informations, brain stormings and verry verry much of help.....
Here a DISCORD Private Chat is the Best.
There we can Talk ( if you got a Headset) , share our Screens to demonstrate things and we can easy share Files, Pics and so on.

So... Forum and Discord.... Both got it´s benefits !
Good Luck !
2021-12-10 15:05
icon