Raspberry pi 0 driven quadcopter | kk 2.1.5 | python | towards autonomous

Lets try to autonomously control out quadcopter from the raspberry pi 0 using python scripts This is the fs-r6b receiver interfaced with the kk 2.1.5 flight controller board The receiver is gonna send pwm signals to the flight controller based on the movement of the joystick from the transmitter For these joystick movements, if we can somehow simulate or mimic the exact signals generated by the receiver from our raspberry pi, then we can python scripts in our pi interface it with the kk board and create autonomous movements for our drone. The board has inbuilt gyroscope and accelerometer sensor which it uses for position feedback Using this arduino code, we can measure the duty cycle of the pwm signals generated by the receiver.

The fs receiver is interfaced with the arduino and the graph is plotted between the movement of the joystick and the duty cycle of the incoming signal into the arduino Aileron in channel 1, elevator in channel 2 throttle in channel 3 and rudder in 4 From the graph the leftmost or the downward joystick position generate a pwm signal of around 4% duty cycle the rightmost or the top joystick positions generate around 9% duty cycle and mid stick positions generate a pwm signal of around 7% duty cycle This python code can generate same software pwm signals for our quadcopter movement Now we have removed the receiver from the kk board and we have interfaced our raspberry pi instead of it This script is written in such a way that its gonna take the quadcopter from safe mode to armed mode then increase the throttle from 0 to 50 percent and then decrease the throttle to 0% and finally bring back to safe mode Lets run it and see the result

As found on YouTube

Tags: