Wet Compass and Stepper Motor

Support for Arduino in combination with Air Manager and Air Player

Moderators: russ, Ralph

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

Re: Wet Compass and Stepper Motor

#41 Post by Mike Horsten »

Ralph wrote: Thu Dec 10, 2020 10:12 am It is called a button in the script, but that doesn't necessarily say that it has to be a physical button. As long as it gives a pulse it is fine.
Thanks will give it a go soon..
@Kieth, well explained understand the idea and the process better now.
Building a home Cessna 172SP Steam. X-plane/MFS2020
(ex Name on Airmanager forum Polarair)

devidin
Posts: 9
Joined: Fri Aug 21, 2020 4:44 pm
Location: Waterloo (Belgium)
Contact:

Re: Wet Compass and Stepper Motor

#42 Post by devidin »

Ralph wrote: Sat Nov 28, 2020 6:39 pm 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.
Hello Ralf,

Can you please tell me where I can download it please? I would like to migrate my DIY compass from Mobiflight to AirManager...

Thank you.

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

Re: Wet Compass and Stepper Motor

#43 Post by Ralph »

It is a hardware function. You can add it to your panel.
I'm gonna upload a video about hardware functions this week.
This video will also give an idea.


devidin
Posts: 9
Joined: Fri Aug 21, 2020 4:44 pm
Location: Waterloo (Belgium)
Contact:

Re: Wet Compass and Stepper Motor

#44 Post by devidin »

devidin wrote: Sun May 23, 2021 3:32 pm
Ralph wrote: Sat Nov 28, 2020 6:39 pm 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.
Hello Ralf,

Can you please tell me where I can download it please? I would like to migrate my DIY compass from Mobiflight to AirManager...

Thank you.
Great implementation !!!

I found it in "Add hardware instrument":
image.png
To make it work properly with step motors from Amazon https://www.amazon.fr/Elegoo-Moteurs-28 ... 159&sr=8-5
I had to clone it and modify the lua code as follows (replace 2038 by 3072 = 1024*3):

Code: Select all

stepper_id = hw_stepper_motor_add("Wet compass stepper motor", "4WIRE_6STEP",3072,75, true)

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

Re: Wet Compass and Stepper Motor

#45 Post by Ralph »

The provided code should work in theory. But as I said in amp topic, I'm not that sure if all these cheap motors apply to their specifications.

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

Re: Wet Compass and Stepper Motor

#46 Post by jph »


Great implementation !!!

I found it in "Add hardware instrument":

To make it work properly with step motors from Amazon https://www.amazon.fr/Elegoo-Moteurs-28 ... 159&sr=8-5
I had to clone it and modify the lua code as follows (replace 2038 by 3072 = 1024*3):

Code: Select all

stepper_id = hw_stepper_motor_add("Wet compass stepper motor", "4WIRE_6STEP",3072,75, true)
Hi
Where did you get the idea to use '4WIRE_6STEP' from for the hw_stepper_motor_add ??
I am guessing it should probably read

Code: Select all

stepper_id = hw_stepper_motor_add("Wet compass stepper motor", "4WIRE_4STEP",2038,75, true)
However, you can use 6 or 8 if you modify the step count, if using '6' then your step count should be 3057 as opposed to 3072.
I must confess a step of 4WIRE_6STEP, in this context which appears to be 2/3 step.... :shock: is 'unusual' to say the least. Normally, the steps are full, half, 1/4 etc where in this context, 4WIRE_8STEP would be half stepping ?
The 2038 (as per original code) is correct as is the number of steps (within a fraction) for the full step mode of the stepper, not 2048. Even then it is likely to drift over time as it is not 'exactly' 2038,, but near enough. Hence why auto calibration is better.
However, if it works, then that's all that matters. :)
Joe
Joe. CISSP, MSc.

Post Reply