I've been reading the most recent Arducopter 2.5.4 version, I cannot understand how the commands are sent to the servos/motors.
I understand that the function "set_servos_4()" is doing the job, but after that I'm lost.
An instance of the class AP_MotorsQuad is created (and called "motors") and the method "output" should use the "output_armed()" function whose definition I cannot find...
Sorry I'm a newb!
Ciao,
Michele
Tags:
Permalink Reply by entropia666 on May 6, 2012 at 3:23am Ok I found the output_armed() function definition in AP_MotorsMatrix.cpp file.
set_servos_4() calls motors.output();
motors.output() (output() defined in AP_Motors.h) calls output_armed() (defined in AP_MotorsMatrix.cpp).
I hope this helps someone like me who is lost with objects/classes/methods...
I've been thinking about removing that set_servos_4 call and just directly calling motors.output(). It's a bit silly to have a function with just one line of code in it. It use to have a lot more in there before we moved it all to the AP_Motors library.
If you look inside the AP_Motors files you will see lines like below. This is the call to send the message to the servos.
_rc->OutputCh(_motor_to_channel_map[i], motor_out[i]);
_rc is a pointer to an APM_RC object. The first parameter, _motor_to_channel_map[i], determines which actual output pin on the apm to send the message to (i think we have about 12 output pins/channels).
the 2nd parameter, motor_out[i], is the actual pwm value to send (a value from 1000~2000 i believe).
APM_RC is the library which we use to make the very low-level pwm output to the ESCs and servos. you can check out it's OutputCh method to see the very low level registry update it does to send out the signal.
Permalink Reply by entropia666 on May 12, 2012 at 2:15am Thank you for your explanation!
Permalink Reply by vaqas afzal on May 12, 2012 at 11:49am michele, here can i get a c file for this code......i wanna c if i can change it according to my model???? so can u please gimme a link????
Permalink Reply by entropia666 on May 12, 2012 at 2:06pm Sorry, I don't understand your question!
If you don't find the source code, here is it:
http://code.google.com/p/arducopter/downloads/detail?name=ArduCopte...
Permalink Reply by vaqas afzal on May 12, 2012 at 8:12pm thats was actually " Where can i find the C code for this"....i missed a "W".....so can this APM be changed or modified for a different vehicle????? like VFO`s.....????? And where should i start??? i mean which file of the c code??? i wanna change the outputs........like with pitch these control surfaces should move??? any ideas???
Permalink Reply by vaqas afzal on May 12, 2012 at 9:16pm yes i am talking abt the C ++ code!!!!!!! so i have designed this model with takes of vertically....so it has a very different controls....http://www.sussex-model-centre.co.uk/shopexd.asp?id=30453...can u please tell me where should i start to modify the controls????

Yikes. Not sure what vehicle that would fit best under. It has surfaces, so plane, but requires constant power to control altitude, so copter.
I would go with a traditional heli configuration, perhaps and modify from there. The heli has servos and a rotor, so it would fit better.
You will find that if you look for the keyword HELI in the ArduCopter code, it is a set of
sections like:
#ifdef HELI
which modify the main ArduCopter to do a traditional heli. You could presumably make a
#ifdef VFO
section to make your own type of vehicle.
Permalink Reply by vaqas afzal on May 12, 2012 at 9:44pm hahahahaha....same problem here!!!! so i should download arducopter source code????riiiteee???
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.249 members
183 members
693 members
24 members
51 members
© 2013 Created by Chris Anderson.
Powered by
