Receiver/PIC Integration

For our project, there were two major coding aspects. The first was to control the motor for the bomb drop mechanism, based on a PWM output from the airplane receiver. The second was to relate the PWM output of the receiver to change between the straight forward camera view and a gyro stabilized bomb drop view. The gyro must then output the angle and be able to control the angle of the servo in relation to the airplane so that it always points downwards. To do all of this, we used a PIC18F2455 microcontroller with two PWM input ports from the receiver and a gyro input. 

Gyro Stabilization

When the camera is in the downwards pointing view, or the bombing view, the camera is stabilized by a gyro. This allows the camera to constantly point downwards, regardless of the angle of the airplane. The gyro we used is the ADXRS15EB, which measures yaw rate of up to 150 degrees per second. In order to determine the angle frrom this yaw rate, we used numerical integration onboard the PIC. Knowing the angle of the airplane, the PIC simply sends out a signal to the camera servo that is opposite of the angle of the airplane, so that the camera always faces downwards. When the bombing process is complete, the pilot can press the same button as before when lowering the camera to raise the camera back to a flying view.