'm having some trouble adapting the new IMU v3 to Jean-Louis' code written for tricopters. His code used the APM_Compass library and for some reason, it wont compile with any reference to that library. The new IMU doesnt use that library, so I havent let that stop me from trying. It compiles and gives me output, but something is still wrong. The debug wont print GPS and the attitude values although stable seem way off. I'm hoping some experts can look at my code and tell me what's wrong or even what is right.
I've included the code I have now. Please help if you can.ardimupter-120708b.zip
Tags:
Permalink Reply by Jeff Smith on August 9, 2012 at 5:10pm
Permalink Reply by Harry on August 9, 2012 at 7:26pm The picture of my tricopter at the beginning of this has only the yaw motor spinning in the opposite direction and with the KK board. Then I broke one more and ended up with all in the same direction and found out that's really not going to work . New ones on the way, another lesson learned.
Where are you with your efforts, Jeff?
Permalink Reply by Jeff Smith on August 9, 2012 at 10:30pm LoL, day dreaming :-) I have done lots of reading, but as I have no ArduIMU yet, I have really done nothing but intently watch your progress.
I did get my shipping notice from 3DR today which ROCKS! but the fedex tracker doesn't show it yet, so I still don't have a due date. I suspect either Saturday or Monday and can't see it going past Tuesday at the latest... I'll know more tomorrow.
I have read tons on the DCM functions but still haven't learned much on the mixing of the channels. To be honest I think I will just have to start from what you have and then correct as I go. Once I've got something that will keep my copter in the air I think I will move on to Greg's gimbal code to see what can be gained. Though the more I look the more I am finding on ArduIMU copter controllers so there may be more to work with than I know of.
As a side note I am also intently looking into ARM based processors and 32 bit code written in C++, it seems it will be the future of this hobby. I can use the ArduIMU (with AVR) straight up to act as a bus for raw sensor data and use one of these Cortex-M4 processors with a floating point unit (FPU) to crunch the numbers for full blown DCM/Kalman filters at a crazy refresh rate. There is a fair amount of work being done on the 32bit side of the hobby and the gizmo's are dirt cheap. Here's one of the boards I'm ordering Friday along with about a grand in programmers and starter kits. Micro board with ARM ST32F4 processor. It comes with the companies bootloader, but I'll have a JTAG to load my own.
Can't wait for some hardware :-) I'll catch up to you soon.
Permalink Reply by Harry on August 10, 2012 at 8:42pm Catch up? With the list of hardware you plan to play with, you'll be miles ahead. I'll be making a small change and waiting for props forever.
Whatever you do, wait until I have a successful flight before you take a chance on any code I've touched. Be suspicious and check everything for yourself. I've had a tendency to get all excited when something almost works and that's not good. For instance, I was playing with the code and testing over and over and didnt see that the for loop that gets the offsets was only reading the last three positions in the AN_OFFSET[y ] array.
Read_adc_raw();
for(int y=3; y<=5; y++) // Read initial ADC values for offset.
AN_OFFSET[y]=AN_OFFSET[y]*0.8 + AN[y]*0.2;
I've had a tendency to also think something is more complicated than it really is. It's all part of learning though. Hopefully I get to a point where I'm competent enough to really get creative.
Permalink Reply by Jeff Smith on August 10, 2012 at 10:54pm We will both get there, what we end up spending to do it might not be a good subject though. This was a project to make something small do neat thing after all ;-)
Permalink Reply by Harry on August 12, 2012 at 12:05am Youre right again, Jeff. If I just wanted to get in the air with an Arduwhatever, I could. I wanted to use the ArduIMU to do something that really isnt supported and actually learn something beyond following directions. With the motors spinning in the right directions and not causing wild torque problems, it should work but only if the output is fast enough. I just read something about 100Hz being what a helicopter needs and I think the main loop() is 70Hz but it did work for Jean-Louis on V2
Greg's code might be the best starting point in the end since it's supposed to be faster. I should take another look now that I'm waiting on props.
Permalink Reply by Jeff Smith on August 12, 2012 at 12:21am I just dropped $1100+ on goodies, so I sure hope I'm not heading in the wrong direction LOL
P.s. you're up late... are you installing countless GB of IDE's too?
Permalink Reply by Jeff Smith on August 13, 2012 at 5:42am
Permalink Reply by Harry on August 14, 2012 at 10:06am All I've done is combine other's code in a way which hasnt passed testing yet.
It sounds like youre saying youre going to use Greg's gimbal to physically isolate the optical flow sensor from the rest of the APM. Is that to simplify the APM tuning?
Permalink Reply by Jeff Smith on August 14, 2012 at 11:52am
Permalink Reply by Jeff Smith on August 14, 2012 at 11:56am
Permalink Reply by Jeff Smith on August 14, 2012 at 1:30pm
Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.203 members
24 members
207 members
58 members
1355 members
© 2013 Created by Chris Anderson.
Powered by
