Jump to content
newboerg

Head Tracking for under 10€

Recommended Posts

Hi everyone!

I tried all the versions of newboerg's arduino files but it was very unstable for me so i ported my algorithm into newboerg source.

It is mutch better now, but still need some tweaking.

Here you can download the ino file.

NOTE: The device must be stationary for a 1-2 sec after and durring plugging in(Calibration).

Share this post


Link to post
Share on other sites

UPS, looks like the Thread is not dead :) haven tlooked in since page 4 :)...

oh and for the ppl asking which orientation is needed, i put mine on top of the headset so that the connector pins face to the left

Edited by newboerg

Share this post


Link to post
Share on other sites
Hi everyone!

I tried all the versions of newboerg's arduino files but it was very unstable for me so i ported my algorithm into newboerg source.

It is mutch better now, but still need some tweaking.

Here you can download the ino file.

NOTE: The device must be stationary for a 1-2 sec after and durring plugging in(Calibration).

I'm running a test on that ino file right now and so far it's been rock solid

@ 5 mins

FT Yaw 0.0 - Raw Yaw 1.1/1.2

I'll leave it running but it's looking much better as I'm also not getting any spikes.

Previously every minute it would jump to -12

I have had the odd good day before so it will take a while to fully evaluate it.

Cheers Sel.

Update ------------------------------

Over one hour and nothing has changed still no drift.

I've even restarted it as sometimes doing that gives different results but again no drift after 15mins.

I've still to test in game but that's for another day.

Awesome job danczer thanks.

Update ------------------------------

I've noticed an issue the spring effect seems too strong and when you turn your head the software pulls the picture back to zero even though your head is still turned.

Now in my racing sims this isn't such a big issue for me, if anything I kind of like it at least compared to the way it drifted before.

It's more like a glance option though that's triggered by your head movement.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

danczer: typo! missing ; after

sensitivity = 1.0/FS_SEL

and its always returning into the start position

Edited by newboerg

Share this post


Link to post
Share on other sites

Thx,

Yes i know, mostly because of fast head movement.

Share this post


Link to post
Share on other sites

For those who experience drag along the Z-Axis. Try not to move the Sensor after Power-up (plug in usb). if you move it right afterwards you'll get drag.

Share this post


Link to post
Share on other sites
For those who experience drag along the Z-Axis. Try not to move the Sensor after Power-up (plug in usb). if you move it right afterwards you'll get drag.

That doesn't work for me even if it's never moved from starting the PC it will still move rapidly off centre.

I did increase one of the settings in the sketch from I think it was 0.01 to 0.02 and it seems to help but I haven't tested fully since.

I started to get motion sickness so I may have to pass on head tracking as I've never had it before in any racing sim.

I do get it if head bob is turned on in games.

Share this post


Link to post
Share on other sites
That doesn't work for me even if it's never moved from starting the PC it will still move rapidly off centre.

I did increase one of the settings in the sketch from I think it was 0.01 to 0.02 and it seems to help but I haven't tested fully since.

I started to get motion sickness so I may have to pass on head tracking as I've never had it before in any racing sim.

I do get it if head bob is turned on in games.

Are you using filtering or dead zones in FTNoIR?

Share this post


Link to post
Share on other sites
Are you using filtering or dead zones in FTNoIR?

I don't think it makes much difference, today it just won't centre either way including changing the settings in arduino.

As soon as I plug it in and start FT the raw yaw is all ready over -10 when this happens I know it won't work.

I have to keep plugging it and out until it's at -1 at that it stands a chance of of working but today it just won't do it.

Share this post


Link to post
Share on other sites

Is there an i-phone app for this? -- any way i can duct-tape my wife's i-phone to my head for some head-tracking joy?

Can you guys, whom got it working, give us a step-by-step for parts and set-up?

Who to buy from is a question for me.

Share this post


Link to post
Share on other sites

I can try to type in a few lines, but OP has it covered pretty well already.

Pro Micro ATmega32u4

MPU-6050 Module

Those are the ones I used, the price of the Pro Micro has come up more than £20 tho :eek:

Use this instead.

Solder your wires like this, use clean wires and solder which has flux in it, don't overheat.

uZ5c6TO.jpg

Done.

- Install Arduino software and dowload the sketch for your device.

- Install FacetrackNoIR and hatire plugin for it.

- Plug in your device via USB.

- Start Arduino software and set proper Serial Port and Board type (Arduino Leonardo).

- In Arduino software, open the sketch you downloaded earlier and hit Upload.

Done.

- Start FTNoIR and select Hatire Arduino as Tracker Source.

- Hit Start.

- Fiddle around with the settings until to your liking.

- Look all over the place in Arma.

Share this post


Link to post
Share on other sites

just to add something could be useful in future developing and upgrading this.

---------- Post added at 00:10 ---------- Previous post was at 22:28 ----------

here is the example of using it in RC but I put this video more because of that nevous bird who constantly attack the plane.

Similar interest but problem and difference is we want 6DOF and they using only 2DOF.

For 6DOF we need 6 axis sensors and all this boards are no matter 2 or 3 sensors are only 3 axis.

Do we gain something with two boards with sensors? One will calculate rotations other movemant so 3+3 is 6DOF in the end.

Share this post


Link to post
Share on other sites

Thanks newboerg for sharing this :)

Using "gy_521_send_serial_HAT_ITG_spring_reset" it gives me an incredible smooth experience compared to my Bluetooth+Wii Remote+3Point LED+Freetrack 2.0.

No stutter or jittering like in Freetrack, I'm loving it!

There is one thing: when I configured it for infanterists (yaw&pitch, thats enough for me) it is completely fine. When I am in a cockpit like the Buzzzard, there is a strange roll and the settings seems to be odd.

Share this post


Link to post
Share on other sites

Okay right now I am confused about the hatire plugin. Can anyone confirm/correct my understanding of the hatire plugin, what the input/output is? Thank you :)

jnUKLQi.png

Share this post


Link to post
Share on other sites

Thanks for the guide CaptainObvious, I just got my 6050, and it seems I have some soldering to do tormorrow.

I was just wondering if there would be a maximum cable length between the 6050 and the arduino, since I have the old Arduino Duemilanove which is quite big to strap to my headset. Are the signals TTL level?

Share this post


Link to post
Share on other sites
Thanks for the guide CaptainObvious, I just got my 6050, and it seems I have some soldering to do tormorrow.

I was just wondering if there would be a maximum cable length between the 6050 and the arduino, since I have the old Arduino Duemilanove which is quite big to strap to my headset. Are the signals TTL level?

That is an interesting point, right now I have a 2 meter cable between arduino and Gyro but get an awful lot of drift. I should really chop it down to see if it helps.

---------- Post added at 11:27 AM ---------- Previous post was at 11:21 AM ----------

Okay right now I am confused about the hatire plugin. Can anyone confirm/correct my understanding of the hatire plugin, what the input/output is? Thank you :)

http://i.imgur.com/jnUKLQi.png

I'm sure others can answer this better but how I see it.

Game output is how facetracker sends the info to the game and Mpu6050 are the settings from the Gyro and these you can swap around to match the facetracker settings.

Share this post


Link to post
Share on other sites

2m could be too long i guess, as the I2C bus used is not suitet for long cables lenghts ( it was developed to be used INSIDE TVs) i use about 15cm and a long USB cable for the connection to the pc.

Oh and for those who dont want to tweak the facetrack settings endlessly, here is my config file:

https://www.dropbox.com/s/hcs73q87o29238t/bennihat.ini

Share this post


Link to post
Share on other sites

määääh - I must be doing something totally wrong :(

my yaw goes between 23 and 25 the whole time.

pitch increments endlessly from 0 upwards

and roll is the whole time between 58.0 and 58.9.

What may I have done wrong?

By the way I noticed now that it has the same behaviour when MPU is not connected.

Anyone want to help me?

Edit:

Using spring reset:

setup()

-> after the first MPU6050_read()

Who am I: A9 (Sometimes other values)

error = 2

same message with and without mpu connected.

What do you guys get there?

I also see that my acceleration brings the whole time:

0, -11.15, 0

0, -76.21, 0

delaytime was 5000 - Edit: Okay, this is because the 2 bytes get swapped after reading, but because my device doesn't read, it swaps everytime the same 2 bytes

I would say there is no Connection to the MPU - but would i get 0 in that case?

Now I am sure there is no connection, but I don't know why.

as information - I have the Arduino Nano V3.0 with Atmega 328 processor.

As I don't have any experience - can I be sure that on my board (or any other arduino board) the Number 3 and 2 are SDA and SCL?

Edit: Have seen that nano would use 4 SDA 5 SCL - buuut... I loaded the I2C scanner now, and I tried 4,5 - 5,4 - 3,2 - 2,3 - nothing could be found

I guess - something doesn't work, but I don't know how I could test it :(

--------------------------

Motherfaqing - awesome - monster stuff :) - got it working now (was almost crying before)

I had to connect sda scl to analog 4 and 5

Guys if you would know how big my smile is now after all that story :D

By the way, after all was working fine, I wanted to fix it in my small little case.

I almost destroyed it while doing that, as i soldered my ground I damaged it so I got only 1.8V for the MPU. Thank god there are other grounds too - now I will not touch it anymore.

https://dl.dropboxusercontent.com/u/40940714/20140315_001.jpg (536 kB)

Edited by SnowSky

Share this post


Link to post
Share on other sites
That is an interesting point, right now I have a 2 meter cable between arduino and Gyro but get an awful lot of drift. I should really chop it down to see if it helps.

A little search brought me this: http://raspberrypi.stackexchange.com/questions/7432/i2c-cable-length-and-type

So it depends on what kind of cable you use, but if you use cat5 cable, you should be fine with 1 or 2 m.

Share this post


Link to post
Share on other sites

Actually I'm using an old length of USB cable. I will shorten it any way when and if I get the new gyro

Share this post


Link to post
Share on other sites

Sadly but true: I also have some problems with occasionally yaw-drifting (to the right side). Playing ArmA 3 3h it occured 4-5 times I guess. Sometimes it helps to just restart FTNOIR. Sometimes I have to reflash the arduino sketch to the board. Then it mostly works for another hour. :-/

Edited by telejunky

Share this post


Link to post
Share on other sites

Bah, I have a lot of trouble getting mine to work, or actually, I can't get the I2C communication to work at all. Using the i2cscanner, I got to see the MPU adress once by magic, but it never worked after that. So I'm pretty sure my wiring is ok. Does anyone of you use any pull up resistors for the data lines? Seems that it might fix unreliable communication, so I'll nick some 4.7K ohms from work tomorrow I guess...

Share this post


Link to post
Share on other sites

@ All who got the drifting problem

Reflash your board with the given files and don`t touch it after installing for like 5-10sec! Otherwise the axis will get input during initialization and this will screw them up like hell...

Share this post


Link to post
Share on other sites
Bah, I have a lot of trouble getting mine to work, or actually, I can't get the I2C communication to work at all. Using the i2cscanner, I got to see the MPU adress once by magic, but it never worked after that. So I'm pretty sure my wiring is ok. Does anyone of you use any pull up resistors for the data lines? Seems that it might fix unreliable communication, so I'll nick some 4.7K ohms from work tomorrow I guess...

are your 5v stable?

how long are your cables?

whats the return value of your endTransmission?

Edit: @audioCustoms

Doesn't the device at each startup calibrate? But I noticed, also if I let it at the desk, I can watch how it slowly drifts away. And I have the feeling, the more I move my head around, it will do some drifting to so after a few head turns (well - not 360 turns, but a bit left and a bit right) I have to recenter. Do you have that problem too?

Also I noted that the first drift comes from 0 to 1.0 - then it will stay stable (when laying on the desk without movement)

Edited by SnowSky

Share this post


Link to post
Share on other sites
@ All who got the drifting problem

Reflash your board with the given files and don`t touch it after installing for like 5-10sec! Otherwise the axis will get input during initialization and this will screw them up like hell...

Reflashed it about 50 times and until it's working correctly it's in a fixed position. Even then it only seems to work about once in twenty tries.

Also I noted that the first drift comes from 0 to 1.0 - then it will stay stable (when laying on the desk without movement)

If I'm lucky I get it at 1.0 other wise it's usually around mid 20's and the only way to fix it is to keep plugging and unplugging, even then there are some days I can't get it to 1.0

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×