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
prince
Posts: 1
Hi, I 3d printed a cessna 172 style trim wheel, I can get it to read the position from a rotary encoder, but I would like to motorize the device. I've had a little success getting the motor to spin and read it's position via a built in hall effect encoder via the arduino IDE, but I'd like to connect the motor to MSFS to both get and set the trim position.

Unfortunately as far as I can tell, only stepper motors and servo motors are supported in the software. I can get the behavior I'm looking for by using a stepper motor to be active while autopilot is on and a rotary encoder when autopilot is off, but forcing a stepper motor to turn when it's deactivated is not only difficult, but very bad for the motor, my next thought was to use a servo to activate according to the autopilots state, either pushing the motor shaft into the trim or pulling it out, essentially acting as a clutch, but this is not only a lot of work, but also prone to cause problems, either with timing or positioning.

The best strategy I can come up with is to use a DC motor with an encoder on the shaft, but as I said, I don't see an option to set up a DC motor with mobiflight.
I am open to more ideas or insights, and if I missed something, I'd love to know. I've been working at this for a while.

Thanks.
2021-10-11 07:26
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

Should be no big problem.

For Throttles this is difficult.... We got a Poti here instead a Encoder.... and the Throttle got a clear position ( indicated to the lever).
For the Trim Wheel the position not need to be sync correctly. So it is more easy.

What you need.....

1. A Indication when the Encoder work and when not....... Cause if it would be active also in AP mode then a turning of the Encoder would also create a Input from the Encoder and "overwrite" the AP commands.
Here AP ON/OFF should be a perect Indicator !

2. You need a LEFT RIGHT System indicated to the Virtual Trim System. MF not directly controll those Motors.... But mostly we have a simple logic here.
Those Motors work e.g. with 2 Pins..... Pin 1 define if Motor Run or Not ..... Pin 2 define if Motor run Clockwise or Counterclockwise.
Those Pins work simply High/Low Boolean. Means MF can controll 2 Output Pins as LED ..... We can define if these Pins are ON or OFF by configs.
So we can say e.g. "if Motor should be run Clockwise then set Pin A to High and B to Low" .

*****
This is a nice Project !
Whatever my time is limmited..... If you like we can try to figure out together.
Contact me on Discord. may we find a spot to do this !
Good Luck !
2021-10-11 13:35
icon