Content originally posted in LPCWare by dragilla on Mon Dec 05 11:39:39 MST 2011
Yh, wait, I badly described my problem.
Point 3. should say:
3. I disconnect AND RECONNECT usb cable ...
If I just disconnect it the dicece is unpowered...
Changing to run_cont doesn't change this behavior.
edit: I thought that maybe timing is different and thus my calculation's results differ, but I checked and timing is the same, results differ.
To be more precise about the problem. In my 100hz loop I calculate roll and pitch angles based on data read from my accelerometer and gyroscope. I use the complementary algorithm for that. When I use debug the results for a non-moving device are OK - floating around -0.01 to 0.01 for both axes. When I disconnect the usb cable and reconnect it the results start at 0.0, 0.0 but then grow very fast, to about 10.0, 65.0. Wtf!?
Any ideas please?