HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Jul 06, 2012, 06:57 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
915 Posts
Quick and dirty, but here goes. Not really tested much etc. but should help a little

No need to tell me a little text, graph-color etc. should be changed.
http://code.google.com/p/open-headtracker/
(The new code for the Headtracker must also be used)

To calibrate magnetometer:

- Open Magnetometer_cal.exe

- Select com-port and press connect

- Press "Start plot"

- You must turn the magnetometer around to get a good max/min reading for all axis. In my case max is with the axis pointed towards north but pointed more or less down.

The difference between min and max reading should in the end be pretty close for all axis.

When you have the readings, open the code in Arduino IDE, go to the tab sensors.cpp and find this:
float mag0Max = 625;
float mag1Max = 625;
float mag2Max = 625;

float mag0Min = -625;
float mag1Min = -625;
float mag2Min = -625;

Copy the max/min readings from the GUI.
Let's take an example:

- would give:
float mag0Max = 703;
float mag1Max = 481;
float mag2Max = 962;

float mag0Min = -444;
float mag1Min = -481;
float mag2Min = -293;

This was a quick test, so the difference is not very similar here. - but you get the point.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 06, 2012 at 07:20 AM.
Reply With Quote
Sign up now
to remove ads between posts
Old Jul 06, 2012, 08:29 AM
Flying like an Angel.
BlueAngel2000's Avatar
Austria
Joined Sep 2007
1,488 Posts
thanks Dennis.

Plejad did a how to video, to calibrate the mag on the Plejad PCC flight control:
Kompass-Kalibrierung (2 min 6 sec)

i think this should work here too, to find the max. values in all possible directions.
BlueAngel2000 is offline Find More Posts by BlueAngel2000
Reply With Quote
Old Jul 06, 2012, 08:34 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
915 Posts
Quote:
Originally Posted by BlueAngel2000 View Post
thanks Dennis.

Plejad did a how to video, to calibrate the mag on the Plejad PCC flight control:
http://www.vimeo.com/41133772
i think this should work here too, to find the max. values in all possible directions.
Haha, year that might work too
But the magnetometer gain is calibrated automatic using a self test in the magnetometer, so it's only the offset that's necessary to calibrate.

It might be easier just to rotate the magnetometer 180 degrees and set the offset. It should give the same result. I'll write a bit more after my vacation
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 06, 2012, 04:46 PM
If it's to be, it's up to me.
subsonic's Avatar
Sydney, Australia
Joined Jan 2007
3,091 Posts
Quote:
Originally Posted by BlueAngel2000 View Post
Sometime ago somebody build already a 3 axis camera gimbal.

but you will need a plane or copter with level mode, else you will have quite problems to fly. In the plane you can feel the angles, on the ground, we use just the camera image to know how we are flying.
What I'm building is a large scale piper cub with the FPV camera in the cockpit. I'm going to be able to see the window frames, engine cowling, dash, stick etc. I'm hoping that will provide me with the reference to tell me which way I'm facing, tilting and rolling the camera. I'll try it, and see how it goes.

I only ordered my Arduino and sensor the other day, and the cub is still in build. Really looking forward to trying it!

sub.
subsonic is online now Find More Posts by subsonic
Reply With Quote
Old Jul 06, 2012, 05:00 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
915 Posts
Quote:
Originally Posted by BlueAngel2000 View Post
Sometime ago somebody build already a 3 axis camera gimbal.

but you will need a plane or copter with level mode, else you will have quite problems to fly.
In the plane you can feel the angles, on the ground, we use just the camera image to know how we are flying.

but this headtracker opens the possibility to use as a controller, to steer the plane with it.
Just this HT in the hand, flip the trainer switch and fly the plane with your hand.
Yep, it supports all 3-axis so it shouldn't be any problem to control the plane, helicopter etc. with this unit. You just need something to control the throttle. I'll let you know how it works for controlling a tri-copter when I get some sparetime

It can also be used for stabilisation, auto-pilot etc.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 07, 2012, 10:34 AM
Registered User
Joined Jul 2011
83 Posts
Hi,

It would be awesome when this headtracker also stabilize my plane :-)

Pohlaris
pohlaris is offline Find More Posts by pohlaris
Reply With Quote
Old Jul 07, 2012, 10:46 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
915 Posts
Quote:
Originally Posted by pohlaris View Post
Hi,

It would be awesome when this headtracker also stabilize my plane :-)

Pohlaris
It will need a bit of work, but you should be able to use the calculated angles etc. and "just" add a P/PI/PID regulator.

I have a few projects I need to finish atm, but I would be fun to code an autopilot sooner or later.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 07, 2012, 01:28 PM
Registered User
Joined Jul 2011
83 Posts
Hey Dennis,

yeah "just" a PID Regulator I like your DIY OSD and i will like your Headtracker/Autopilot.

Pohlaris
pohlaris is offline Find More Posts by pohlaris
Reply With Quote
Old Jul 07, 2012, 04:57 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
915 Posts
Quote:
Originally Posted by pohlaris View Post
Hey Dennis,

yeah "just" a PID Regulator I like your DIY OSD and i will like your Headtracker/Autopilot.

Pohlaris
A PID implementation in C is just a few lines of code, shouldn't take more than a few minutes
But you are probably gonna need a bit more than just that.

Anyway, Ardupilot should be a great place to look if you want a ready-made system. If I'm ever gonna write an autopilot, it will probably just be for fun and not an official project.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 07, 2012 at 05:11 PM.
Reply With Quote
Old Jul 08, 2012, 05:31 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
915 Posts
I'll be on vacation for 2 weeks (I'm leaving in a couple of hours), hope you guys can help each other with basic questions.
Hopefully it will be pretty straight forward with the software etc.

Hope to see a few headtracker builds when i get back
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 09, 2012, 12:43 AM
Flying like an Angel.
BlueAngel2000's Avatar
Austria
Joined Sep 2007
1,488 Posts
For sure, just a matter of postal speed.

Have a nice trip.
BlueAngel2000 is offline Find More Posts by BlueAngel2000
Reply With Quote
Old Jul 12, 2012, 02:23 AM
Registered User
Italy, Emilia-Romagna, Ferrara
Joined Sep 2003
41 Posts
Good morning,
First of all, congratulations to all.
I assembled the circuit.
I tested the circuit connected to the PC, Windows XP, everything was perfect.
I have set the magnetometer, as described.

I connected the hd to my Futaba T9C and nothing worked.
A few seconds later I touched the arduino, and I felt very hot, close to the USB port.

I pulled the plug Trainer.

After a bit 'of the second I connected the PC to change some value in the interface.

When connected, Windows XP has written something like: excessive voltage (or current, I can not remember) in USB HUB.

Then I smelled something burning and the Arduino is gone.

The computer no longer sees the arduino when connected.
The arduino, connecting it to the USB port, no LEDs will not light.

I reconnected the circuit shortly after the Futaba and the arduino has warmed up again.

My PC and interface, the head tracker could see perfectly.
I believe that the problem was on the jack to the Futaba Trainer, where I found 10.1V (3s lipo with 2 capacitors).

I have attached a few pictures taken of Futaba, I ask for confirmation if everything is correct.

I thank you in advance.
mikenet76 is offline Find More Posts by mikenet76
Reply With Quote
Old Jul 12, 2012, 04:49 AM
Flying like an Angel.
BlueAngel2000's Avatar
Austria
Joined Sep 2007
1,488 Posts
connection on Trainerplug looks okay to me.

maybe a short on the arduino vcc input?

and, don't connect HT to the Futaba and USB at the same time. Can cause problems.



My sensor board has arrived, so hopefully i will build mine in the next few days.
BlueAngel2000 is offline Find More Posts by BlueAngel2000
Reply With Quote
Old Jul 12, 2012, 05:24 AM
LKJ
Lars k Jensen
Denmark, Central Denmark Region, Tostrup
Joined Apr 2006
619 Posts
I don't know about connections on Trainerplug is ok, but i know it is OK to connect USB and F9 to DFHT on the same time, Dennis told me when he guided me by telephone and i did it when i adjusted center positions, ie. change a value and then click test HT settings, and see what the servo do, change the value a bit more and so on, when you hit the right value then click save HT settings.

Lars.
LKJ is online now Find More Posts by LKJ
Reply With Quote
Old Jul 19, 2012, 07:49 AM
Praying for better weather
Coyote64's Avatar
Joined Dec 2007
4,174 Posts
Great work Dennis I just got my bits, put it together and it works !

Sort of

It works fine, but only if I connect to PC USB with sensor boards -ve not connected, if it is a error message of USB not recognized. If -ve is removed and I plug it in its fine, then re-attach the -ve and arduino and GUI work fine.

When I plug it into my Turnigy 9 the same problem, it sends the voltage display of the Turnigy mad and the Turnigy shuts down But if I connect it with -ve ( sensor board ) off, then reconnect it the HT works fine ???
Coyote64 is online now Find More Posts by Coyote64
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Build Log Diy osd (Arduino and opensource) Dennis Frie FPV Equipment 2413 Aug 08, 2014 01:30 AM
Discussion PPM to PWM circuit for headtracker 38cjc38 DIY Electronics 18 Mar 04, 2011 06:43 AM
Question Adding additional PPM inputs to a headtracker/module setup. SebastianJ FPV Talk 0 Aug 19, 2009 07:38 AM
Question Adding additional PPM inputs to a headtracker. SebastianJ DIY Electronics 0 Aug 18, 2009 03:37 PM