Could MWC Be Used as a Head Tracker?

Could MWC Be Used as a Head Tracker?

Postby spagoziak » Tue Jun 14, 2011 6:55 am

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
spagoziak
 
Posts: 171
Joined: Thu Jan 20, 2011 1:18 am

Re: Could MWC Be Used as a Head Tracker?

Postby UndCon » Tue Jun 14, 2011 6:36 pm

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
User avatar
UndCon
 
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Could MWC Be Used as a Head Tracker?

Postby spagoziak » Wed Jun 15, 2011 6:37 am

LOL!

Short & Long question: Why not?

Seems spektrum doesn't play well with others, most of the time :(
spagoziak
 
Posts: 171
Joined: Thu Jan 20, 2011 1:18 am

Re: Could MWC Be Used as a Head Tracker?

Postby UndCon » Wed Jun 15, 2011 10:19 am

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
User avatar
UndCon
 
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Could MWC Be Used as a Head Tracker?

Postby Alexinparis » Wed Jun 15, 2011 12:37 pm

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.
Alexinparis
 
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Could MWC Be Used as a Head Tracker?

Postby UndCon » Thu Jun 16, 2011 2:57 pm

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
UndCon
 
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Could MWC Be Used as a Head Tracker?

Postby EOSBandi » Sun Jun 19, 2011 11:38 am

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
EOSBandi
 
Posts: 802
Joined: Sun Jun 19, 2011 11:32 am
Location: Budapest, Hungary

Re: Could MWC Be Used as a Head Tracker?

Postby c2po » Fri Jun 24, 2011 7:34 pm

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?

Postby PatrikE » Fri Jun 24, 2011 10:52 pm

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: 1923
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: Could MWC Be Used as a Head Tracker?

Postby PatrikE » Sat Jun 25, 2011 11:51 am

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: 1923
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: Could MWC Be Used as a Head Tracker?

Postby PatrikE » Thu Jul 07, 2011 9:20 am

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
PatrikE
 
Posts: 1923
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: Could MWC Be Used as a Head Tracker?

Postby UndCon » Thu Jul 07, 2011 10:06 am

I dont think it works with my Spektrum gear...but not tested yet
User avatar
UndCon
 
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Could MWC Be Used as a Head Tracker?

Postby PatrikE » Tue Jul 12, 2011 6:45 pm

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

/Patrik
PatrikE
 
Posts: 1923
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: Could MWC Be Used as a Head Tracker?

Postby msev » Sat Mar 24, 2012 1:27 pm

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.
msev
 
Posts: 186
Joined: Thu Apr 14, 2011 11:49 am

Re: Could MWC Be Used as a Head Tracker?

Postby PatrikE » Sat Mar 24, 2012 2:31 pm

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
PatrikE
 
Posts: 1923
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: Could MWC Be Used as a Head Tracker?

Postby msev » Sat Mar 24, 2012 3:28 pm

I'll probably go just with sensors bobs (clone wm+ 8$, adxl345 10$ and mag 13$)...I'm cheap :D..
msev
 
Posts: 186
Joined: Thu Apr 14, 2011 11:49 am

Re: Could MWC Be Used as a Head Tracker?

Postby PatrikE » Sat Mar 24, 2012 5:37 pm

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
PatrikE
 
Posts: 1923
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: Could MWC Be Used as a Head Tracker?

Postby not » Sat May 12, 2012 7:33 am

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
not
 
Posts: 3
Joined: Sat May 12, 2012 7:22 am
Location: cologne germany

Re: Could MWC Be Used as a Head Tracker?

Postby PatrikE » Sat May 12, 2012 10:04 am

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
PatrikE
 
Posts: 1923
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: Could MWC Be Used as a Head Tracker?

Postby not » Sat May 12, 2012 10:34 am

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

sönke (with rolling head)
not
 
Posts: 3
Joined: Sat May 12, 2012 7:22 am
Location: cologne germany

Re: Could MWC Be Used as a Head Tracker?

Postby PatrikE » Sat May 12, 2012 11:29 am

Keep it Rolling... :lol:
PatrikE
 
Posts: 1923
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: Could MWC Be Used as a Head Tracker?

Postby Goetz » Thu May 24, 2012 11:09 am

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
Goetz
 
Posts: 82
Joined: Sun Mar 04, 2012 3:40 pm

Re: Could MWC Be Used as a Head Tracker?

Postby PatrikE » Wed Aug 22, 2012 3:36 am

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: 1923
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: Could MWC Be Used as a Head Tracker?

Postby PatrikE » Wed Aug 22, 2012 3:41 am

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
PatrikE
 
Posts: 1923
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: Could MWC Be Used as a Head Tracker?

Postby sgt.meirelles » Fri Sep 21, 2012 2:16 am

Thank you! I managed to make it work:

http://www.youtube.com/watch?v=9dHrsdDv5xw&list
sgt.meirelles
 
Posts: 1
Joined: Fri Sep 21, 2012 2:13 am

Re: Could MWC Be Used as a Head Tracker?

Postby dr.tom » Thu Oct 18, 2012 9:09 pm

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

Re: Could MWC Be Used as a Head Tracker?

Postby dr.tom » Fri Oct 19, 2012 3:12 pm

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

Re: Could MWC Be Used as a Head Tracker?

Postby dr.tom » Fri Oct 19, 2012 4:12 pm

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.
dr.tom
 
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia

Re: Could MWC Be Used as a Head Tracker?

Postby PatrikE » Fri Oct 19, 2012 7:13 pm

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
PatrikE
 
Posts: 1923
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: Could MWC Be Used as a Head Tracker?

Postby dr.tom » Fri Oct 19, 2012 7:59 pm

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
dr.tom
 
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia

Re: Could MWC Be Used as a Head Tracker?

Postby PatrikE » Fri Oct 19, 2012 10:05 pm

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.
PatrikE
 
Posts: 1923
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: Could MWC Be Used as a Head Tracker?

Postby dr.tom » Sat Oct 20, 2012 11:21 am

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.
dr.tom
 
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia

Re: Could MWC Be Used as a Head Tracker?

Postby PatrikE » Sat Oct 20, 2012 2:53 pm

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: 1923
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: Could MWC Be Used as a Head Tracker?

Postby PatrikE » Sun Oct 21, 2012 1:02 am

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.
PatrikE
 
Posts: 1923
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: Could MWC Be Used as a Head Tracker?

Postby dr.tom » Sun Oct 21, 2012 8:32 am

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.
dr.tom
 
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia

Re: Could MWC Be Used as a Head Tracker?

Postby msev » Sun Oct 21, 2012 4:59 pm

Make sure to put some videos :)...Which TX do you use?
msev
 
Posts: 186
Joined: Thu Apr 14, 2011 11:49 am

Re: Could MWC Be Used as a Head Tracker?

Postby dr.tom » Mon Nov 05, 2012 8:44 pm

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.
dr.tom
 
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia

Re: Could MWC Be Used as a Head Tracker?

Postby msev » Mon Nov 05, 2012 10:08 pm

So you managed to make it work (the headtracker)?
msev
 
Posts: 186
Joined: Thu Apr 14, 2011 11:49 am


Return to Ideas

Who is online

Users browsing this forum: No registered users and 2 guests