Could MWC Be Used as a Head Tracker?

Post Reply
spagoziak
Posts: 171
Joined: Thu Jan 20, 2011 1:18 am

Could MWC Be Used as a Head Tracker?

Post by spagoziak »

For FPV fliers, having a head tracker is really cool.

They all seem to be expensive and struggle to integrate into most transmitters.

While I have no idea how difficult it is to interface with a transmitter in this way, it seems to me that the MWC has everything that's needed to send a signal to a pair of servos (assuming hijacking a radio link is accomplished).

In fact, just an ACC seems all that would be needed to do the job. Take a BMA020 for example... if direction of 'forward' is facing the same direction you are, you could tip it backward 90 degrees, so that the top of the ACC is facing you. The pich axis would work the same from here, but now the roll axis would sense the rotational direction of a head turning. Et voila!

Alex, how possible is this? I know... very much NOT a multi rotor helicopter. But it seems like you've already done the work for this, really.

spag

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Could MWC Be Used as a Head Tracker?

Post by UndCon »

short description - NO
long description - NO :)

BUT....

You can take the gyro signals from WM+ and send them into your radio just like a regular headtracker - but it requires different coding than we have here...so you better start an entire new project for this.

The problem as I see it is that regular headtrackers dose not work with Spektrum...they have different trainer signals.


//UndCon

spagoziak
Posts: 171
Joined: Thu Jan 20, 2011 1:18 am

Re: Could MWC Be Used as a Head Tracker?

Post by spagoziak »

LOL!

Short & Long question: Why not?

Seems spektrum doesn't play well with others, most of the time :(

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Could MWC Be Used as a Head Tracker?

Post by UndCon »

Multiwii is built to be connected between your receiver and your motors/servos - adjusting the signals depending on sensor inputs and send them on to your motors/servos

A headtracker is connected to your transmitter. reading the gyro, injecting the signal as PPM into your transmitter over trainer connection


So the 2 are used in different ways

//UndCon

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Could MWC Be Used as a Head Tracker?

Post by Alexinparis »

Hi,

I think you're right UndCon.
I don't think a TX head tracker friendly would accept independent RC signal outputs.
However, an adaptation to the code to supply the required PPM frame should be possible.

Another thing: the magnetometer is mandatory to be able to follow the exact heading.
An ACC alone can't give this indication.

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Could MWC Be Used as a Head Tracker?

Post by UndCon »

Alex is right - I forgot to mention the mag sensor.

I think parts of code can be reused (like reading sensors) and some parts require new code (inject ppm into TX)

This could be a spinoff
Best regards - UndCon

User avatar
EOSBandi
Posts: 802
Joined: Sun Jun 19, 2011 11:32 am
Location: Budapest, Hungary
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by EOSBandi »

Hi All,
No need to reinvent the wheel. Here is a project for Headtracking with Arduino and WM+. Not built yet by myself, but it's on the list.
http://www.rc-cam.com/forum/index.php?/topic/3425-diy-htwm/
Regards,
EOSBandi

User avatar
c2po
Posts: 22
Joined: Fri Jun 24, 2011 7:31 pm
Location: Atlanta, GA

Re: Could MWC Be Used as a Head Tracker?

Post by c2po »


PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by PatrikE »

Well. I invented a new wheel based on MultiWii. :roll:

A little teaser..
http://youtu.be/Ep0IeJkxxkE

I constructed a PPM-injector for multiwii and uses Accsmooth for tilt and roll to control a Pan/Tilt.

I guess a Mag is better to control the pan with.
But it's possible to use Roll from Acc by tilting the head sideways.
It feels quite natural.

The Injector is working but there's some more work left on the gui.

It can be used to inject PPM to trainerport on a radio.
Or do injekt it to a TX-module. I do that.
That way it's possible to use Headtracker even if you have a basic radio.

If there is intresting i can put some more work in it and develop the NEW wheel. 8-) ;)

I'll try to present the code tomorrow.

/Patrik

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by PatrikE »

This is a PPM-injector for the MWii projekt.
Se it as a Raw Beta.

Scetch can be used with MultiWiiConf_dev20110607
But for simulation use MultiWiiConf_dev20110607_HT

Things needed
-Arduino PRO mini
-Gyro
-ACC

The PPM injector works fine
Some adjusting is needed on the controls.
Make more accurate......
Implement MAG etc.
GUI PID:s

It's done Using only accSmooth from roll and pitch.
Mag is probibly best but acc is easier to do.

Control PAN By Tilting head sideways.
Control TILT By "looking" up & down.

To Setup....
Select PWM pin to send PPM sinal from.

Setup your TX settings.

Adjust PID settings to match headmovemoents with AXP ( In HT-file )
increase to give bigger throws.

Adjust endpoints and center for Headtracker in Config.h

Download latest from...
http://code.google.com/p/multiwii/source/browse/#svn%2Fbranches%2FPatrikE
/ PatrikE
Last edited by PatrikE on Tue Aug 21, 2012 10:27 pm, edited 1 time in total.

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by PatrikE »

Is there anyone who Have tested this?

I'we only run it by feeding signal to a Tx-module...
That way it works like a 2 channel transmitter.

/Patrik

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Could MWC Be Used as a Head Tracker?

Post by UndCon »

I dont think it works with my Spektrum gear...but not tested yet

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by PatrikE »

It works fine on my Turnigy 9X.
Just got it and haven't reprogrammed it yet.

/Patrik

msev
Posts: 186
Joined: Thu Apr 14, 2011 11:49 am

Re: Could MWC Be Used as a Head Tracker?

Post by msev »

Patrik what would be the ideal sensor combo for this project: gyro+acc,gyro+mag or gyro+acc+mag...could an acc in last combo be used for self centering.

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by PatrikE »

At the moment mag isn't used in Headtracker.
Only Gyro & Acc.
Mag can be added But theres some more code to add to get it to work.

I would go for one of the Allinone boards supported of MWii.
A complete FC with everyting on one board.

A lot of sensors have been added to the project.
And Headrtacker is buildt from a old version of MWii and need updating.

/Patrik

msev
Posts: 186
Joined: Thu Apr 14, 2011 11:49 am

Re: Could MWC Be Used as a Head Tracker?

Post by msev »

I'll probably go just with sensors bobs (clone wm+ 8$, adxl345 10$ and mag 13$)...I'm cheap :D..

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by PatrikE »

I ported the Headtracker to Preversion4.
You can find it in my Branch.
http://code.google.com/p/multiwii/source/browse/#svn%2Fbranches%2FPatrikE

It compiles but i haven't tested it on any hardware yet.
If you test it please report back.

/Patrik

not
Posts: 3
Joined: Sat May 12, 2012 7:22 am
Location: cologne germany

Re: Could MWC Be Used as a Head Tracker?

Post by not »

Hi,

I tried the headtracker pre4 with a
minipro, wmp and bma 180,
via graupner mx 16,
and mulitiwii 2.0 on a quadx.
cam pan/tilt.
had to increase P for tilt to 8, else i had to move my head as hell to move the cam...
works well, no probs, thanks a lot-
Sönke

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by PatrikE »

NIce to hear..

You can also adjust the Multiplicator in the HT file.
int AXP[2]={5,4}; // Adjust effect of ACC PAN,TILT to match headmovemoents


The Pan is taken from Roll axis and not the Yaw axis.
It will react better if you "Roll" the head sideways instead of rotate.

/Patrik

not
Posts: 3
Joined: Sat May 12, 2012 7:22 am
Location: cologne germany

Re: Could MWC Be Used as a Head Tracker?

Post by not »

... excuse me, that is what I did - adjusting the multiplicator, not P.

sönke (with rolling head)

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by PatrikE »

Keep it Rolling... :lol:

Goetz
Posts: 82
Joined: Sun Mar 04, 2012 3:40 pm

Re: Could MWC Be Used as a Head Tracker?

Post by Goetz »

As I understand it is possible to
a) connect the defined outputpin to an HF-TX or
b) connect to trainerport

i'm afraid this works with TX with selecable channels for Trainer only (?)
I know there are PPM-Injectors extending channels e.g of Futaba 6EX, injecting HT-Signal on Channel 7+8 (behind the chanels used by tx), using the trainerport

Is it possible to do this with this Project too?

With the date of the code of the ht and the wm+ as gyro i think it uses wiring-diagram with D18 for wm+ (not vcc as code since 1.9)?


Greets, Götz

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by PatrikE »

It is possible to inject on any channel you chose.
VM+ Don't need to use D12 as Vcc any more. Can be connected direct to VCC.

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by PatrikE »

HeadTracker is now updated to V2.1 codeBase.

I also added support for using MAG to handle Pan.
MultiWii_2.1_HT.rar

I also updated the Guide.
http://fotoflygarn.blogspot.com/2011/09/headtracker-for-dummies.html

sgt.meirelles
Posts: 1
Joined: Fri Sep 21, 2012 2:13 am

Re: Could MWC Be Used as a Head Tracker?

Post by sgt.meirelles »

Thank you! I managed to make it work:

http://www.youtube.com/watch?v=9dHrsdDv5xw&list

dr.tom
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by dr.tom »

Great stuff!
I would like to try it on my fpv plane.

but I tested it on my mwc boards, that fly well. and gimbal works well of them, so nothing broken.
http://www.youtube.com/user/TomRi25

CRIUS SE on the left, and GY86 on the right
Image

sadly, I have random servo twitches, around +/- 5° in both directions, :(
will record if it can help. on both boards!
same if MAG is activated, or disactivated and acc used for pan axis.

in GUI there are no twitches in output numbers to servos,
so it seems to me like it is a timer issue in generating the signal causing wrong output values

please help. :)

dr.tom
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by dr.tom »

here's the video,
with both analog and digital servo for eliminating them as cause of twitches.

http://youtu.be/2OLyNvUSnso

first test: MWC code for flying, with gimbal active,
(could work for headtracker but doesn't have PPM out to inject it into stream...)

second test: this HT code, just uncommented the type of board, everything else left default.

third and fourth test, same, with other board. same result :(
boards are functional 100%

please can someone help to find the error?

dr.tom
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by dr.tom »

i tried to remove acc readings, and force code to output same value (middle) no matter what acc input is.
and it is working, no response on tilting the board, servos are staying in center, but still twitching.

Image

Image



so error is somewhere in output part of the code.
not in sensor readings or sensor interpretation.

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by PatrikE »

Hi,

I have made some changes for you to test.
You can disable the servoTimer in Config.h

Code: Select all

//#define HT_DEBUG        // For debug with servos in GUI Test for DR.Tom

Baro is not nessesary so i permanently disabled if Headtracker is selected.
https://dl.dropbox.com/u/9750287/MultiWii/MultiWii_drTom.rar

please test if it makes difference.

/Patrik

dr.tom
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by dr.tom »

Thank you very much for your will to help.

here are the GUI scrnshts if needed for debug

1. with new version and HT_debug commented, servos react the same way, move like they should, but with some lag and random jitter like in video

Image


2. with new version and HT_debug uncommented (active, deleted '//#' in front of it), servos do not work
Image


all tests: servos connected to HT directly, like in vid.

I even tried connecting Pin D10 to rangelink HT input (ground and signal pin) but no reaction on any of 12 channels, tried them all.
receiver works because I can control servos when I move sticks on my radio unit

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by PatrikE »

If you connect the servos to the headtracker The PPM-timer isn't used for the servos.
The original servotimer within MWii controlls the servo outputs.

If you uncomment HT_debug The servo-timer will be disabled.
Means servos connected to the headtracker will no longer work. :shock:

The importent part is that the PPM timer works as it should.
It's not intended to be used with servos connnected!
You would need very long servocables to the plane ;)
The servos is just for debugging and setting up things.

Test to connect the PPM and se if it works better.

In the video in my Howto it's connected via a 2.4Ghz TX-module to RX
http://fotoflygarn.blogspot.com/2011/09 ... mmies.html

Not a superclear answer but skip the servos and set up with the radio instead.

dr.tom
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by dr.tom »

Yes, I am aware that servos go to rx on the plane,
I emphasysed that in my video,
gimbal code would be usefull for HT too if it was giving out the PPMsum for injecting into rc link. 8-)
(imho it gives better response, no lag and more precise, as seen in my vid, if it could be modded to give PPM out, it would be great,
especially already available pure gimbal option in defines, where all pids are just for it, not a flying model define where gimbal part ends up only with end points and ratio adjustment)

back to servos :)
just wanted to bench test if all works ok, before connecting to my gear,

thnx for your debug,
it seems to work fine with it over PPMsum.
will post some flying video as soon as I record some.

mag gets new heading hold every time ardu reboots,
it is great of you change position during flight(turn whole FPV gear to direction of a plane that went from one to other side for example),
then you reboot it and all is OK again.
is it possible to set acc calib to happen then too?

because this way acc gets calibrated one time, in GUI, and stay like that forever,
and every flying time there's a little bit different angle of looking onto the fpv monitor,
or sitting in a chair with goggles on,
not to mention the cap or some band that is holding HT to your head :)
so HT thinks it is tilted,

I will try to look into the code, what gets called when stick input is detected(for acc calib),
and c/p that somewhere and see if it can be executed on boot :)

also, although mag feels more natural for pan, works ok when pitch is 0°
but it doesn't seem to work well when combined with looking down/up,
it changes by itself, (did calibration procedure right),
it's not seen in multirotor flying when same board is used for FC,
because for stable aerial photography, angles are really small <10°
http://tinyurl.com/DrTomYoutube
and in acro flight, flips do make 360° turns, but last so short that they cannot affect rudder output too much like here in HT
http://tinyurl.com/MAGinflipsnotaffectingrudder


so I stick with acc for HT pan too, roll the head for pan :)

Thank you for your help PatrikE :)
hope to post vid in a week or so
Last edited by dr.tom on Sat Oct 20, 2012 7:09 pm, edited 2 times in total.

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by PatrikE »

The MAG looses the accuracy when it's tilted.
I have tested a ArduPilot board to and there MAG direction is "glued" no mather the angle.

Try to add this in void setupHT()

Code: Select all

void setupHT() { // PPM timer
  conf.angleTrim[ROLL] =accSmooth[0];
  conf.angleTrim[PITCH]=accSmooth[1];
.
.


In my theory it will Zero ACC at reboot.

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by PatrikE »

New test version with Acc reset.
Test version

Not shure if direction of calib is correct.
Can be changed in

Code: Select all

void setupHT() { // PPM timer
  conf.angleTrim[0] =accSmooth[0];
  conf.angleTrim[0] =accSmooth[1];
.
.

just set( = - accSmooth[ ) if calib is in wrong direction.

dr.tom
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by dr.tom »

thnx :)
will try it, and report.

this seems to be executed when doing stick input calibrations,
http://multiwii.googlecode.com/svn/bran ... 721566.pdf

from multiwii2.1, multiwii tab, line 724
else if (rcData[THROTTLE] > MAXCHECK && !f.ARMED) {
if (rcData[YAW] < MINCHECK && rcData[PITCH] < MINCHECK) { // throttle=max, yaw=left, pitch=min
if (rcDelayCommand == 20) calibratingA=400;
rcDelayCommand++;



If so, the bolded part could be c/p somewhere in the begining of HT code to execute rigth after the boot.

msev
Posts: 186
Joined: Thu Apr 14, 2011 11:49 am

Re: Could MWC Be Used as a Head Tracker?

Post by msev »

Make sure to put some videos :)...Which TX do you use?

dr.tom
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia
Contact:

Re: Could MWC Be Used as a Head Tracker?

Post by dr.tom »

sorry for late reply,

I fly with Hitec Aurora 9 + Rangelink 433MHz
for FPV flying with 1.5W readymade video TX + IBCrazy's cloverleaf+ crosshair antennas .

http://www.youtube.com/watch?v=zbk3ipTgMqo
http://www.youtube.com/watch?v=m6dy-0DVsuc


here's a little vid of new HK 180°servos in action
http://www.youtube.com/watch?v=brk76oVfHY4
Last edited by dr.tom on Thu Nov 29, 2012 11:17 pm, edited 1 time in total.

msev
Posts: 186
Joined: Thu Apr 14, 2011 11:49 am

Re: Could MWC Be Used as a Head Tracker?

Post by msev »

So you managed to make it work (the headtracker)?

Post Reply