Articles

Affichage des articles du mai, 2017

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...

Motor one tow three four go !

Image
I do it. I finally managed to start my 1st motor! On top: 2 wires to the LIPO battery On left: the 3 control wires of the ESC. Black to mass and white on a pine GPIO of raspberry (red is not used)  I use  ServoBlaster to control l'ESC Parameters are : /usr/local/sbin/servod --cycle-time=20000us --step-size=10us --min=1000us --max=2000us What you must know : a pulse of 1ms = motor at 0% : echo 1=100 >/dev/servoblaster a pulse of 2ms = motor full at 100% : echo 1=200 >/dev/servoblaster I created a python function to drive my motor : def servo(servo, val): servoStr ="%u=%u\n" % (servo, val) with open("/dev/servoblaster", "wb") as f: f.write(servoStr) Processing time is very good (1ms) PS: I was unable to run RPIO even on my Raspberry Pi Zero W. So, I drop RPIO because it is too hardware dependent. ServoBlaster seems to work properly

RPIO = Rest In Peace

I wanted to use RPIO library to drive motors I did however some tests of the python library RPIO. I was confident ... In fact, I have a 2.0 beta version unknown (I don't remember whre i find it...) and it does not work well. Unable to address certain pins, the output is not in OUT .... In short it is a real problem. As a reminder, this library is essential to drive the motors. It allows to make PWM control in hardware without soliciting the cpu. PS: After a lot of search on Google last night, it seems that the RPIO library is not compatible with all the models of Raspberry. In any case, it does not work on my Raspberry Pi 2. I will test other libraries like ServoBlaster or PigPio PPS: Another solution, less headache, buy an add-on card that manages the PWM in hardware. For example, this  Adafruit 16-Channel  PWM

Building a Quadcopter using Raspberry Pi

Image
Building a Quadcopter using Raspberry Pi... The idea came to me during my holidays by reading an article by Andy Baker in the MagPI newspaper (numbers 19 and 20) On reading the article, a quadcopter appeared to me very simple to build. And then, according to my research, I realized nevertheless that there are a lot of knowledge to know and that it will be quite complicated .. . So I bought the material on ebay: The F450 frame The 4 motors The 4 propellers The 4 ESCs The LIPO 3S battery The MPU6050 (gyroscope / accelerometer sensor) F450 kit The MPU6050 (gyroscope / accelerometer sensor) For the flight controller part, I use a Raspberry Pi 2 that I already have. As passionate computer scientist, the idea is to program the Raspberry to drive the engines according to the MPU6050 sensor which will provide me informations on tilt and acceleration. So, I will not want to use the CC3D flight controller provided in the kit. For the remote control, ...