Hey guys I am new to the Arducopter platform I have deep experience in the Rc Aircraft field,in fact I have made my own tricopter platform using the plug and play KK multicopter control board,I recently realized the Immense potential of the APM control interface for UAV's I have no experience in coding using embedded c but am reasonably good at arduino,I have created a simple balancing robot using the same by interfacing a gyro and an accelerometer ,I am familiar with PID control and anything RC,Lipo batts brushless motors..you name it..but now just venturing out in the arducopter ecosystem I am really lost at what the code,that I downloaded,really do ,I would really appreciate someone telling me step by step and dissecting the code on the way to tell me what does the code actually do and how does it do it,and how does it interface all the sensors present on the IMU to a single stable output to act as an autopilot for whatever platform it is placed on.Please someone help me...plz plz plz.............I am desperate..(ashamed of calling myself an electronics engineering student........)
You need to be a member of diydrones to add comments!
Replies
That's a tall ask. Here's a quick overview.
There is a main loop that runs at 100hz. It updates the desired pitch and roll and passes it to a Timer which overflows at 490hz and pumps the PWM out to the ESCs.
In the main loop we call DCM update. This is the integration of the Gyros and Accels and Maggy/GPS heading. This gives us the orientation. the DCM object is called ahrs in the code. The imu object is the raw sensors The adc object is the low level access to the sensors on the APM1 only.
Next level up is the control which happens at 50hz. User input is converted to degrees * 100 and throttle is 0 - 1000.
Next level up is navigation and you see this is called when we have GPS data.
A script parser runs mission scripts.
You'll see a bunch of loops called a state machine which divides our time slices into manageable chunks for other peripheral tasks.
Jason