Page 2 of 3
Re: 10DOF model sensors
Posted: Thu May 23, 2013 9:48 am
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.
Re: 10DOF model sensors
Posted: Thu May 23, 2013 10:00 am
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

Re: 10DOF model sensors
Posted: Thu May 23, 2013 11:47 am
by DesTinY
Sounds like a plan!

Re: 10DOF model sensors
Posted: Thu May 30, 2013 2:18 pm
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
Re: 10DOF model sensors
Posted: Thu May 30, 2013 6:56 pm
by rmirwin2
Looking forward to that, Anton!
Rich
Re: 10DOF model sensors
Posted: Thu May 30, 2013 10:53 pm
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

Re: 10DOF model sensors
Posted: Fri May 31, 2013 7:15 am
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.
Re: 10DOF model sensors
Posted: Sun Jun 02, 2013 6:09 pm
by ak1394
Re: 10DOF model sensors
Posted: Mon Jun 03, 2013 6:07 pm
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
Re: 10DOF model sensors
Posted: Mon Jun 03, 2013 9:32 pm
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.