You need to be a member of diydrones to add comments!

This reply was deleted.

### Activity

RT @chr1sa: Donkeycar 4.4 released with tons of new features, including path learning (useful with GPS outdoors), better Web and Lidar supp…

RT @NXP: We are already biting our nails in anticipation of the #NXPCupEMEA challenge! 😉 Did you know there are great cash prizes to be won…

RT @gclue_akira: レースまであと3日。今回のコースは激ムズかも。あと一歩
#jetracer https://t.co/GKcEjImQ3t

RT @chr1sa: The next @DIYRobocars autonomous car race at @circuitlaunch will be on Sat, Dec 10.
Thrills, spills and a Brazilian BBQ. Fun…

RT @arthiak_tc: Donkey car platform ... Still training uses behavioral cloning #TCXpo #diyrobocar @OttawaAVGroup https://t.co/PHBYwlFlnE

RT @emurmur77: Points for style. @donkeycar racing in @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/Y2hMyj1…

RT @SmallpixelCar: Going to @diyrobocars race at @UCSDJacobs https://t.co/Rrf9vDJ8TJ

RT @SmallpixelCar: Race @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/kK686Hb9Ej

RT @PiWarsRobotics: Presenting: the Hacky Racers Robotic Racing Series in collaboration with #PiWars. Find out more and register your inter…

RT @Hacky_Racers: There will be three classes at this event: A4, A2, and Hacky Racer! A4 and A2 are based around UK paper sizing and existi…

RT @NeaveEng: Calling all UK based folks interested in @diyrobocars, @f1tenth, @donkey_car, and similar robot racing competitions! @hacky_r…

RT @araffin2: 🏎️
After hours of video editing, I'm happy to share a best of my Twitch videos on learning to race with RL.
🏎️
Each part is…

## Replies

I'm still having no luck getting my device to correctly track a fixed pitch and roll angle when I spin in on a test fixture. It does seem to track fairly well when I change just pitch and/or roll without spinning.

I hesitate to add my code, since I would imagine all viewers are very busy with your own projects, but if you do have time to look at (I cut the applicable portions and attached), much appreciated again. I "brute forced" and tried all possible sign combinations for the delta thetas, but to no avail thus far. Note that the attached is cut and pasted test code which is horribly expensive in CPU cycles, I know!

I am considering calibrating the gyro gain, instead of using the hardcoded numbers based on spec and ckt analysis of op-amp gain that currently determine the "magic numbers" in translating analog inputs to radians.sec.

Thanks much,

-Mike

DcmTestCode.c

The theory supports what you are trying to do. It should work.

I have helped a few RC pilots port DCM to their own custom boards, and the most common mistakes that I see are confusion over assigning the 3 gyros to their correct axes, and getting the signs right. A common error is confusion over which is the pitch axis and which is the roll axis.

In the situation that you describe, if you get the axis assignments or signs wrong, the values will go immediately wrong when you spin. I suspect that is the problem.

Best regards,

Bill

hmmmmm....

You raise an interesting question that has been in the back of my mind for some time...

I sometimes run my roll-pitch-yaw demo without benefit of yaw drift compensation. It works beautifully. Roll and pitch lock in, while there is a very slow yaw drift. The point is, roll and pitch work ok without having yaw alignment. So, it would seem that there should be a way to maintain the bottom row only...

Off the top of my head, it would seem to me that what you are trying to do should work. I think that you should be able to ignore yaw, and maintain just the bottom row of the R matrix doing what you said. Multiply the bottom row vector by the rotation matrix to do the update. I assume that you did that in the right order? (vector times matrix, not matrix times vector?). Then you would renormalize the bottom row for magnitude, and perform the drift cancelation with the accelerometer. (You said that you are not doing that yet, but I do not think that it would matter.)

In any case, up until now, I have not dug into the theory of this question, but now that you have asked, I will look into it when I get a chance to see whether the theory supports what you are trying to do.

Best regards,

Bill Premerlani

But I do not understand why, for my application, I cannot get by with just using and maintaining the bottom row only. I can calculate pitch and roll completely from this bottom row by using the following, can't I?

first, perform -asin (first element) to get theta

then once I know theta, I can get its cosine, divide the second element by that, and do asin( result ) for roll.

To update the bottom row completely at each interval, all that seems to be needed is the complete delta matrix as well as the current bottom row.

Something's not clicking to me.

To be a valid DCM matrix you can't just initialize the bottom row. You need to initialize and maintain the entire matrix. What are you putting in the other matrix elements, 0's or 1's or something else?? To initialize the matrix to a starting angle, you can use the same approach as creating the delta matrix, but if the angles are significant you shouldn't use the small angle approximations, but rather the full blown trig implementation. You only have to do that once at he beginning, so time shouldn't be an issue. I was looking to do this myself at some point but it's down the list a ways. Let me know if you need the full trig representation of the matrix.

I should also add that currently I boost the gain of the drift compensation loop by a factor of ten at power up for a few seconds to help force the DCM to align with the accelerometers, then I back off on the gain.

Brian