Wet Compass and Stepper Motor

Support for Arduino in combination with Air Manager and Air Player

Moderators: russ, Ralph

Message
Author
Blue_Wings
Posts: 14
Joined: Sat Nov 28, 2020 2:11 pm

Wet Compass and Stepper Motor

#1 Post by Blue_Wings »

Hi guys,

I have just purchased my Air Manager license and I am trying to make a wet compass with Arduino Nano and 28BYJ-48 Stepper motor with the ULN2003 board.

I am very new to arduino, AM, and i'm certainly not a coder. The more I researched how to do this the more I got confused. I have seen people on youtube doing this successfully with Mobiflight which is a free software and I expected that it would be simple with AM.

I cannot add a stepper motor in the hardware settings of the compass. I looked at the wikis but what I found requires programming knowledge. In the forum there doesn't seem to be consensus if this is possible. Also since I am not a programmer, I couldn't test the codes that some people included. It feels like you need to be an electrical engineer with a masters in programming to be able to get a stepper motor turn with AM. I really wish that product developers would not complicate the hobby as flight simulation is becoming way more complex than real aviation.

I would really appreciate any help i can get.

Thanks!

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

Re: Wet Compass and Stepper Motor

#2 Post by Ralph »

I made one for Air Manager 4.0, but I haven't uploaded it yet. I'll upload it on Tuesday and maybe also post the script here.

Blue_Wings
Posts: 14
Joined: Sat Nov 28, 2020 2:11 pm

Re: Wet Compass and Stepper Motor

#3 Post by Blue_Wings »

Hi Ralph

many thanks for your help man.

Do you have a guide or a link that explains what to do with the script ? I am very new to AM and I can't figure out where to paste the scripts.

Thanks again.

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

Re: Wet Compass and Stepper Motor

#4 Post by Ralph »

In 4.0 you don't have to do anything with scripts. Just add the hardware function. I'm gonna upload it tomorrow.

Mike Horsten
Posts: 79
Joined: Tue Dec 01, 2020 8:50 am

Re: Wet Compass and Stepper Motor

#5 Post by Mike Horsten »

Ralph,
can you also look at the zero point, including a Hall Effect sensor or a reed switch or a IR eye. Some thing in the code to make it stable. It needs to know the Zero point. With Mobi they have no zero but they resetit after the flight. its not nice but works.
so we would need one of these sensors in AM for many devices. Hall or reed are my favorites.

Mike
Building a home Cessna 172SP Steam. X-plane/MFS2020
(ex Name on Airmanager forum Polarair)

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

Re: Wet Compass and Stepper Motor

#6 Post by Ralph »

Already in there with a button. A hall sensor generates a analog value right? That would be more tricky.

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

Re: Wet Compass and Stepper Motor

#7 Post by Ralph »

It is online now. If the position would have to be done with an analog signal, then it would have to find out where the signal value was the highest. Not impossible, but a bit more work than a button :)

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Wet Compass and Stepper Motor

#8 Post by Sling »

There are such things that use the Hall effect as the sensing element but have a normal switched output rather than analog.

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

Re: Wet Compass and Stepper Motor

#9 Post by Ralph »

Good to know, then the button would still be the input to use.

Blue_Wings
Posts: 14
Joined: Sat Nov 28, 2020 2:11 pm

Re: Wet Compass and Stepper Motor

#10 Post by Blue_Wings »

hi Ralph,

I have spend many hours trying to figure this out without success. The stepper continues to turn endlessly even if the plane in x-plane is on the ground with engines off.

the version of AM 4 I found is BETA 19. Is this the latest one that I'm supposed to try?

Here is what I have done:

1- Downloaded AM 4 Beta from the Wikis and activated it.
2- Added new device: Arduino Nano and flashed it (using old bootloader)
3- Added new blank panel
4- Added new instrument : Wet Compass
5- Added new hardware: Wet Compass
6- In the configuration of the new added hardware, I selected Arduino Nano and the pin numbers
7- Started x-plane (plugin version 3.2) and ensured that AM shows the status as connected.
8- In AM, right clicked on the new panel I created and selected show.

The instrument is synced with x-plane but the stepper motor keeps turning regardless of what the plane is doing.

I am not sure what I am doing wrong. I tried to reverse the pin numbers and stepper turns endlessly in the other direction.

Could the calibration be the issue ? and how to go about it ?

Hope you can help.

thanks

Post Reply