10DOF model sensors

Firmware/software/electronics/mechanics
ak1394
Beginner
Posts: 12
Joined: Fri May 03, 2013 9:53 pm

Re: 10DOF model sensors

Post by ak1394 »

That's something I thought of doing, nice to know it wasn't such a bad idea. Magnetic fields generated in flight don't seem to bad (although I did quite limited testing so far) it seems that running motors on the increasing speeds simply adds to magnetometer readings depending on the speed, so hope it would be possible to correct.
mjc506
Beginner
Posts: 13
Joined: Wed Feb 20, 2013 1:41 pm

Re: 10DOF model sensors

Post by mjc506 »

Hmm, that's not a bad plan, it'd be reasonably easy to see the offsets from the motors at various speeds by logging the mag readings while the cf is strapped down and rev'd :D
DesTinY
Member
Posts: 97
Joined: Sat Feb 09, 2013 5:18 pm
Location: Bünde, Germany

Re: 10DOF model sensors

Post by DesTinY »

Sounds like a plan! :D
ak1394
Beginner
Posts: 12
Joined: Fri May 03, 2013 9:53 pm

Re: 10DOF model sensors

Post by ak1394 »

I got some results using the magnetometer data. With my current very hackish changes to (mostly) the client, I can lock heading of CF and fly it around the room with its front always pointing the same direction. If I manually rotate it with joystick, it returns to pre-set direction in a few seconds.

Getting correct readings from magnetometer require calibration of CF to correct for soft and hard iron errors, and also calibration with the motors running at a different speeds.

In the next few days I plan to publish my changes. It would be nice as well to figure out a way to get some of it into the mainstream source, for example:

1. Read the raw magnetometer values in CF firmware, and report it to the client.
2. Display compass widget in the client

Regards,
Anton
rmirwin2
Member
Posts: 51
Joined: Mon May 13, 2013 6:06 pm

Re: 10DOF model sensors

Post by rmirwin2 »

Looking forward to that, Anton!
Rich
VGer's v1.7.1 frame, 10DOF Crazyflie, Wireless Xbox360 Controller, Virtual Machine on VMware/Windows 7
ak1394
Beginner
Posts: 12
Joined: Fri May 03, 2013 9:53 pm

Re: 10DOF model sensors

Post by ak1394 »

I was flying outdoors with the heading lock on, which is quite fun - you can trow CF up in the air - in almost in any orientation like sideways, hit the throttle and it steadies itself and rotates so you know where the forward is, and you ready to fly it.

In the process I crashed it, hitting the ground. This probably resulted in something moving, maybe a battery or the engine wires, because my calibration when off somewhat (the north moved ~20 degrees left). Now I have to re-calibrate it, which is good, so I have a chance to cleanup and rewrite my code a bit :)
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: 10DOF model sensors

Post by tobias »

Great work Anton, I'm looking forward of trying it out!

Some thoughts. I'm actually thinking the battery wires and connector are the biggest cause of the dynamic magnetic field distortion. The motors are already so magnetized that the electric magnetization shouldn't do much of a difference. The motor wires on the other hand could generate some fields as well.

A long term goal of this would be to have a calibration tab in the client that is similar to what Fabio did (RIP): http://www.varesano.net/blog/fabio/free ... 3d-spheres
It is written in python and QT as well so it might not be that hard to port.
ak1394
Beginner
Posts: 12
Joined: Fri May 03, 2013 9:53 pm

Re: 10DOF model sensors

Post by ak1394 »

I've published my code for magnetometer calibration, it is available at:

https://github.com/ak1394/crazyflie-mag ... alibration
https://bitbucket.org/ak1394/crazyflie-pc-client
https://bitbucket.org/ak1394/crazyflie-firmware

Start with the README file available in Github repo.
rmirwin2
Member
Posts: 51
Joined: Mon May 13, 2013 6:06 pm

Re: 10DOF model sensors

Post by rmirwin2 »

Excellent news, Anton. I definitely need to give that a try!

Tobias, during construction my thought was to minimize such fields by twisting together all two-wire leads between the board and battery or motors. Effectively this creates twisted pairs. Such twists help cancel out magnetic fields that grow with the current.

Here's a link: http://www.teamdelta.com/pdf/tde_an1.pdf

It is worth noting that the length of the motor wires are amenable to this although it is a bit tight for M4.

I would recommend adding such practice to the construction guide. Apologies if it is there and I missed it!

Rich
VGer's v1.7.1 frame, 10DOF Crazyflie, Wireless Xbox360 Controller, Virtual Machine on VMware/Windows 7
foosel
Expert
Posts: 175
Joined: Sat Feb 02, 2013 9:59 pm
Location: Obertshausen, Germany
Contact:

Re: 10DOF model sensors

Post by foosel »

rmirwin2 wrote:my thought was to minimize such fields by twisting together all two-wire leads between the board and battery or motors. Effectively this creates twisted pairs. Such twists help cancel out magnetic fields that grow with the current. [...] I would recommend adding such practice to the construction guide. Apologies if it is there and I missed it!
Assembly Guide wrote:2. Twist the two motor wires together so they are easier to handle
;)

To be honest, it doesn't mention that twisting will also reduce electromagnetic noise, I just added that.
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
Post Reply