Articles

Indoor Test

Image
After my first test outside which led to the breakage of 2 propellers, I decided to do tests inside. For that, I tied the quadcopter on a wooden board. Two feets are fixed and the others two are free. Thus, by tilting the board, I hope that algorithm will compensate the inclination and adjust the motors so that the quadcopter is stable horizontally Here is a quick diagram

Raspbian - How to connect to multiple wifi networks

Today, I have configured my raspberry to connect at boot to the HotSpot Wifi of my phone if it is available. If not, It will connect to my home wifi To do this, you need to edit the wpa_supplicant.conf file: sudo nano /etc/wpa_supplicant/wpa_supplicant.conf And you must add a second block "network": country=GB ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="my home network" psk="password" scan_ssid=1 priority=0 id_str="Home" } network={ ssid="my phone network" psk="mot de passe" scan_ssid=1 priority=1 id_str="Phone" } You must add in each block : Scan_ssid = 1 to search the wifi network Priority = 1 to select by default the network that has the highest priority Id_str = "xxx" to give a name to the network (may be optional?) Now when I am outside, I can conn...

I2C Bus speed

It does not look like anything but by changing the speed of the I2C bus, the data reading of the MPU-6050 is done in less than 1 ms instead of 2 ms To change the speed of the I2C bus, you need to edit the file /boot/config.txt and add this line  : dtparam=i2c_arm_baudrate=400000 With this, I manage to run the control algorithm of my Quadcopter in less than 7 ms. I can thus guarantee a frequency of 100 Hz (100 loops per second) As a reminder, at each loop, I read the data of the MPU-6050, I carry out all calculations and adjust accordingly the speed of the 4 engines.

First test outdoor and first breakage !

Image
Yesterday morning, I did my first flight test out. 2 problems: My phone LG3 loses the wifi hotspotan then I can no longer control the raspberry Some propellers randomly do not start or not at the same speed as the others This morning, try again To correct my previous problems, I tested with my wife's Honor 5C phone. No more loss of wifi ;-) Instead of plugging the raspberry on the beak of an ESC, I plugged the raspberry on an external battery. No more problem starting the propellers. But the tests were not very conclusive ... The QuadCopter has indeed raised too much on one side. The other side did not stand up. So he tipped over and flipped over. This resulted in the breakage of 2 propellers. I still struggled to interpret the results of the logs because I do not know which side it rocked. In the future, I will have to film the flight so that I can analyze it later Here are some graphs of my simulations First test : I lean the quadcopter forward by 30 degrees...

QuadCopter using Raspberry Zero W

Image
Today I have mounted my Raspberry Zero W on my QuadCopter If it works it will lighten the total weight of the Quadcopter because the Zero weighs only 9 grams! On the other hand, Raspberry Zero is much less powerful than my Raspberry 2 ... The big problem was ServoBlaster Like RPIO, this library did not want to run on a Raspberry Zero!?! So, I tested pigpio and miracle, it works! Then, I see the pigiod daemon consumes a little too much cpu ... Consumption 7.1% .... Gloups .... I thought it was hardware. I'll analyze that later Here is my python code : import time import pigpio SERVO = 4 pi = pigpio . pi() # Connect to local Pi. print ( "start" ) pi . set_PWM_frequency(SERVO, 50 ) pi . set_servo_pulsewidth(SERVO, 1000 ) # Minimum throttle. print (pi . get_PWM_frequency( 17 )) raw_input ( "Press Enter to 1100..." ) pi . set_servo_pulsewidth(SERVO, 1200 ) # Minimum throttle. raw_input ( "Press Enter to end..." ) pi . s...

Adjustment of motors

Image
I connected the 4 white ESC control wires to servos 0 to 3 (pins 7,11,12 and 13) and the black wires to ground (pin 9): Servo number GPIO number Pin in P1 header Moteur 0 4 P1-7 M1 1 17 P1-11 M2 2 18 P1-12 M3 3 21/27 P1-13 M4 Then I adjust the direction of rotation of the motors as below: In order for the quadcopter to be stable and not to turn on itself, the M1 / M3 motors must rotate in the same direction and M2 / M4 in the opposite direction. If a motor does not rotate in the desired direction, swap 2 of the 3 wires

Building the quadcopter

Image
I start to build my quadcopter The frame is assembled and the motors are fixed I calibrated the 4 ESCs and tested the 4 motors one by one (without the propellers of course). All is OK I still have to buy rilsan (cable ties) to fix the ESC on the arms My Quadcopter name is  ROSETTA ;-) Here is my ESC calibration procedure : Disconnect the battery sudo  /usr/local/sbin/servod --cycle-time=20000us --step-size=10us --min=1000us --max=2000us Connect the motor to ESC Send a pulse max value pi@raspberrypi:~ $ echo 1=200 >/dev/servoblaster Connect the ESC to Raspberry (white wire on gpio on servo1, black wire on gpio GND - Do not use the red wire) Connect the battery Wait Beep Beep Send a pulse min value pi@raspberrypi:~ $ echo 1=100 >/dev/servoblaster Wait Beep Beep Beep (battery 3S = 3 Beeps)  Wait a long Beep. This means calibration is ok ! pi@raspberrypi:~ $ echo 1=0 >/dev/servoblaster You will get a beep every 2 seconds (invalid sign...