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
siphi
Posts: 3
Hi,

I have recently come into the possession of some old mechanical flight instruments (from an 80's ex-commerical flight simulator) which I am wanting to interface into my existing setup.

Whilst some are stepper / servo controlled, some of them require a simple voltage input to control the needle position. They were originally designed to operate on 0-12v, so I have since modified them to work on a 0-5v range (a change to their internal resistor)

With this mod, I can control these with my own Arduino code, via the PWM pins available on the Mega2560 board (pins 2-13 & 44-46), through the analogWrite(pin, value) function. Due to their analog nature, they give a really nice continuous and smooth analog feel and I would really like to control these through MobiFlight.

Is it possible, or do you have any plans, to add analog output (0-255) in the MobiFlight output methods ?

Thanks

-Simon
2020-10-13 20:32
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

Here i´m again not a Pro.... But in case a standard Servo also is opperated by ONE Wire ( and 5V/GRD) without a controller (Analog) i think the Pin you define for Servo technical do something simmular..... A PWM or a changed voltage form 0-5 .

Please for testing use a Pin as Device SERVO and simply wire it to your Motor.
Report experience !
Good Luck !
2020-10-14 00:09
Avatar
siphi
Posts: 3
Thanks for the great suggestion.

Using a SERVO pin sort of works. It does produce a voltage which the needle does respond to, so I am hopeful.

However, the output from the pin only appears to be outputting in the range 0 to 0.56 volts (corresponding to 0-255 output). I assume the modulation for a stepper motor (even at max value) leaves too big a gap in between the pulses.

I can rewire the resistance of the instruments to be sensitive to 0.5 volts (which would give me full range), but this is getting quite low and might get into some needle stick issues. I will however try this tonight, and I'll report back.

The ideal solution still remains a specific MobiFlight output giving the full 0-5 volts. This would be almost identical to the servo output - a single pin - but with the output using the full range of the PWM voltage (0 - 5v).

Thanks

-Simon
2020-10-14 09:33
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
hhmmm. Sorry Here i´m out.
Maybe others can give you more Input.

Basicly i not think Sebastian like to rework this if thats a MF based problem.
Only some rare users work with real gauges and need special PWM support. All others use the cheap servos that work perfect ( or the pros mostly use Stepper Motors only).

I hope for you that you find a solution. If not then the last way is to rework the real gauges..... Remove there Motors and build them with a standard servo/stepper.
Good Luck !
2020-10-14 17:46
Avatar
siphi
Posts: 3
Thanks for your help on this, and I've learnt a lot.

My current solution is to to take the SERVO OUTPUT from the Arduino MEGA (which I have learnt is a PWM signal with pulses ranging from around 0.5 to 2.0 microseconds) and remap it to a full analog voltage range, using a SECOND BOARD (in my case a NodeMCU / ESP8266).

On the SECOND BOARD ...

I use the pulseIn(pin, HIGH, 20000); function to measure the pulses, which gives me a value from 500 to 2400 microseconds (empirically derived)

I then remap this value to a new range which I can then output to a new pin using the analogWrite(pin, value)

I have 8 pins, so I use 4 as inputs and 4 as outputs.


So with this second $5 board, I can breath some new life into these old analog instruments (4 at a time), without having to replace the internals with digital servos/steppers.

Note: This isn't just limited to my niche case of some analog needles. This could also be used to drive LED brightness, or whatever else someone might want to drive with a variable voltage.

Thanks again.

-Simon
2020-10-15 09:23
icon