potentiometer as Trim wheel

Support for Arduino in combination with Air Manager and Air Player

Moderators: russ, Ralph

Message
Author
User avatar
jph
Posts: 2857
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: potentiometer as Trim wheel

#21 Post by jph »

chefpilot wrote: Mon Nov 15, 2021 10:05 pm Thanks alot, that is exactly what I want to have.
I only have one problem. Instead of the Pololu Stepper driver I have the Sparkfun easy driver because my stepper motor needs 12V. I have to check how that will work.
The manuell trim function is already working perfect.
Marc
Hi Marc - what stepper are you planning to use the 'needs' 12V ? .
Joe. CISSP, MSc.

chefpilot
Posts: 90
Joined: Wed Aug 02, 2017 12:51 pm

Re: potentiometer as Trim wheel

#22 Post by chefpilot »

I'm using the stepper motor SM-42BYG011-25.
Marc

chefpilot
Posts: 90
Joined: Wed Aug 02, 2017 12:51 pm

Re: potentiometer as Trim wheel

#23 Post by chefpilot »

The easy driver from Sparkfun is working fine!
Now there is one problem left, which I don't know how to solve.
The Mode C from Chuck enables to use an electric Trim switch to control the elevator trim system and turns the wheel. Unforunately I can not integrate an extra trim switch into my setup because I'm using a Saitek Yoke with integrated switches. My intention is to use one of these switches for the electrical trim but I'm unable to find the correct datarefs or commands that the system can recognize the trim switch on the yoke is being pressed.
My idea is to implement a "Mode D" in the lua script which recognize that the trim switch on the yoke is pressed to move the trimwheel.
Does somebody has an idea how to do?

Marc

Tetrachromat
Posts: 236
Joined: Sun Feb 14, 2021 6:55 pm

Re: potentiometer as Trim wheel

#24 Post by Tetrachromat »

Hi Marc,

If you nedd a fast solution, you can get the input from your yoke through the AirManager API function 'game_controller_add'.

If you can wait one or two weeks, I am in the final stage of preparing a package for easy game controller integration, that would make such things a piece of cake...

Paul

User avatar
jph
Posts: 2857
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: potentiometer as Trim wheel

#25 Post by jph »

chefpilot wrote: Tue Nov 16, 2021 9:14 am I'm using the stepper motor SM-42BYG011-25.
Marc
Ok.
Please bear in mind that the '12V' is not the max voltage - or even the 'recommended' voltage. This is dependent on the inductance and current. It is a reference only. 12V is a common supply, but if you want to use 24, or 15, or anything up to around 36V there is no issue. Higher voltage can offer a greater acceptable speed which is often easier than gear alteration if ever needed as can the current limit on the control board - both /wither can also alter torque if needed. But, again, if you are happy with how it is the great. ;)
Joe
Joe. CISSP, MSc.

User avatar
jph
Posts: 2857
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: potentiometer as Trim wheel

#26 Post by jph »

Tetrachromat wrote: Tue Nov 16, 2021 10:36 am Hi Marc,

If you nedd a fast solution, you can get the input from your yoke through the AirManager API function 'game_controller_add'.

If you can wait one or two weeks, I am in the final stage of preparing a package for easy game controller integration, that would make such things a piece of cake...

Paul
I wish you well with that Paul.
Joe. CISSP, MSc.

ChuckK
Posts: 95
Joined: Sun Nov 06, 2016 2:33 pm

Re: potentiometer as Trim wheel

#27 Post by ChuckK »

Marc,

I don't think I saw in the thread, are you using X-plane? If so the yoke trim switches need to be wired directly to an Arduino and managed in the provided Lua script. The reason for this is that when x-plane is trimming the plane with the autopilot, it actually is sending the trim up and trim down commands. If you set your trim switches up to fire the trim up and down commands when you manually trim, there is no way to distinguish between the autopilot sending the commands or you sending the commands. This becomes a problem when with the autopilot engaged and you manually move the trim switch. The correct behavior is to have the autopilot disconnect, but in the Lua code, movement of the trim switches cannot be determined if it was done by the autopilot or by the human pilot.

The way I found around this is to directly wire the trim up and down switch to an Arduino and handle it in the sketch. For the Saitek, since the switches go thru USB, you would need to disconnect the wires at the trim switch and run separate wires directly to the Arduino.

And I'll throw my 2 cents in on the stepper voltage. Joe is correct, in that there is not really a voltage rating for steppers. What determines the voltage is the required torque and holding current. Since the stepper isn't really doing serious any work, just spinning a wheel pretty slowly, 5V would actually work fine. I will say make sure the current limit is set in the Easy Driver to avoid damaging the driver if the mechanism were to get jammed.

Chuck

chefpilot
Posts: 90
Joined: Wed Aug 02, 2017 12:51 pm

Re: potentiometer as Trim wheel

#28 Post by chefpilot »

Hi All,
thank you very much for all your competent answers. I appreciate to be part of this community.
I gues I'll try Paul's advice a check out the possibilities of the game_controller API-Funktion. Right now I do not really know how it will work but I'll testing it. As long as I can get the information to AM that a button on the game controller is pressed or realeased I'm sure that I'll find a solution.
I'll try different voltages for powering the stepper motor as well, that is a very important information as well!
Marc

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

Re: potentiometer as Trim wheel

#29 Post by Ralph »

Coming back to the original question. You are aware that there's by default a hysteresis of 0.02?
http://siminnovations.com/wiki/index.ph ... #Arguments

chefpilot
Posts: 90
Joined: Wed Aug 02, 2017 12:51 pm

Re: potentiometer as Trim wheel

#30 Post by chefpilot »

Hi,
@ChuckK you are right, I'm using X-Plane.

@Ralph You are right as well, that was my original problem. I was not aware about the default hysteresis. Thanks to Chuck posting his lua-Code. While checking the code I found the solution for my resolution problem. I have to read all the information in the WiKi more intensively.

Marc

Post Reply