Accelerometer

Support for connecting hardware to the Raspberry Pi GPIO

Moderators: Ralph, russ

Post Reply
Message
Author
User avatar
fweinrebe
Posts: 62
Joined: Mon Dec 14, 2015 10:03 am

Accelerometer

#1 Post by fweinrebe » Mon Jan 22, 2018 2:03 pm

I notice since AM 3.0 you have support for an accelerometer and gyroscope. How did you connect it? I assume it was either using the iPad's sensor or did you guys hooked it up to a Raspberry PI via I2C or SPI?

Reason I am asking is that I have made a helicopter collective using a I2C based accelerometer/gyroscope and Arduino. It work very well. I was thinking of doing the same experiment but using AM 3.0 / AP 3.0 instead of and Arduino Joystick board.

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

Re: Accelerometer

#2 Post by Ralph » Mon Jan 22, 2018 5:41 pm

That was for the iPad, but it has been removed. You still can with the Arduino and the Arduino library.

JackZ
Posts: 1851
Joined: Mon Feb 22, 2016 1:02 pm

Re: Accelerometer

#3 Post by JackZ » Mon Jan 22, 2018 6:24 pm

I don't get it:
What is the use of converting your helicopter collective setup, currently using the Arduino as a Joystick card, into a device handled by AirManager?

In any simulator I know of, a collective movement should be interpreted as a joystick axis, no matter how it's done.
In that case a joystick card, (be it an Arduino converted into a Joystick card or a Joystick interface card like a Leobodnar BBI/BBX), will be more efficient than a complex decoding (and programming) of an analog signal in AM/Arduino using the library. Why reinvent the wheel in that case? I really doubt AM will be efficient as a joystick axis decoder, since axis filtering is involved.

Additional question: What is the program you used to turn your Arduino into a Joystick?

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
fweinrebe
Posts: 62
Joined: Mon Dec 14, 2015 10:03 am

Re: Accelerometer

#4 Post by fweinrebe » Tue Jan 23, 2018 6:30 am

Jacques,

looking at the wheel and improving on it isn't so bad. That's who we humans are. :)

My motivation for the experiment are:
Resolution: Joystick drivers in Windows can only handle 8 bits (0..255) where AM3 (via Simconnect) can handle 0..16383.
Damping: Write my own code to damp the input signal
Signal: Manipulate the signal in any way to simulate control failure, control reversal or erratic behaviour for example.
Cost: Arduinos are cheaper than Leobodnar's joystick boards for example.
Fun: Designing your own joystick has more fulfilment than buying a joystick driver.
Mechanics: Accelerometers uses no gears. Just 2 screws to attach to the bottom of your collective.

I am using UnoJoy. Unojoy is available for the Mega and is called MegaJoy. The workflow for turning an Arduino into a joystick and the joystick back into an Arduino to make changes is the main reason I want to try out doing it with only AM3 and Arduino. Also the resolution mentioned earlier.

I also attached a 0.84 inch OLED screen to the Arduino. I can see a realtime plot of the collective's output. With the flip of a switch I can switch the damper on or off and see the effects of the damping code.

Since the sensor I use also have a gyroscope in, I am thinking of adapting the damper using the speed at which the pilot pulls or pushes the collective. But that's for another day.

Fritz

JackZ
Posts: 1851
Joined: Mon Feb 22, 2016 1:02 pm

Re: Accelerometer

#5 Post by JackZ » Tue Jan 23, 2018 7:49 am

Fritz

That’s a very impressive goal, and I’m now pretty sure You’ll end up with a very nice wheel. 8-)
Let us know of your progresses.

Thanks for MegaJoy, was investigating for such program and could’nt find any for MEGA.

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

frumpy
Posts: 236
Joined: Sat Jan 30, 2016 12:01 pm

Re: Accelerometer

#6 Post by frumpy » Tue Jan 23, 2018 3:56 pm

Concerning the resolution: I thought Unos and Megas can only handle 10 bit (1024 steps) with the ADC?
Or how do you get 16384 steps out of it?

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

Re: Accelerometer

#7 Post by Ralph » Tue Jan 23, 2018 4:23 pm

Because he's using I2C?

User avatar
fweinrebe
Posts: 62
Joined: Mon Dec 14, 2015 10:03 am

Re: Accelerometer

#8 Post by fweinrebe » Wed Jan 24, 2018 9:14 am

Ralph wrote:
Tue Jan 23, 2018 4:23 pm
Because he's using I2C?
Yes I2C and the board has a 16bit output.

flyatr
Posts: 291
Joined: Tue Dec 01, 2015 8:53 am

Re: Accelerometer

#9 Post by flyatr » Mon Jul 16, 2018 10:13 am

fweinrebe wrote:
Tue Jan 23, 2018 6:30 am
Jacques,

looking at the wheel and improving on it isn't so bad. That's who we humans are. :)

My motivation for the experiment are:
Resolution: Joystick drivers in Windows can only handle 8 bits (0..255) where AM3 (via Simconnect) can handle 0..16383.
Damping: Write my own code to damp the input signal
Signal: Manipulate the signal in any way to simulate control failure, control reversal or erratic behaviour for example.
Cost: Arduinos are cheaper than Leobodnar's joystick boards for example.
Fun: Designing your own joystick has more fulfilment than buying a joystick driver.
Mechanics: Accelerometers uses no gears. Just 2 screws to attach to the bottom of your collective.

I am using UnoJoy. Unojoy is available for the Mega and is called MegaJoy. The workflow for turning an Arduino into a joystick and the joystick back into an Arduino to make changes is the main reason I want to try out doing it with only AM3 and Arduino. Also the resolution mentioned earlier.

I also attached a 0.84 inch OLED screen to the Arduino. I can see a realtime plot of the collective's output. With the flip of a switch I can switch the damper on or off and see the effects of the damping code.

Since the sensor I use also have a gyroscope in, I am thinking of adapting the damper using the speed at which the pilot pulls or pushes the collective. But that's for another day.

Fritz
Hi Fritz, do you have an update on your joystick Arduino project? I`ve finally had enough of FSUIPC. With al the new possibilities in AM the joystick interfacing remains the sole reason to holod on to FSUIPC.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest