David Melendez - Building a drone from scratch with spare parts is a challenging business. To accomplish this journey, a Linux embedded stability control system is developed entirely from 0.This is a journey starting from the hardware choosing (a home WIFI router), to a stable and real flight. Unconventional implementations are one of the main topic, like using WiFi as communication between drone and pilot, HTML5 and COMET to show telemetry from the router web server, and implementing a entirely new protocol based on 802.11 Beacon Frames to prevent deauthentication attacks.
3. Taiksonprojects.blogspot.com
Use your old (or fancy new) router as robotic platform
➔
No initial investion. You already have the router!
➔
Change the firmware-> Embedded Linux OpenWRT
Created Robots using this philosiphy
ROVER Texas Ranger: Linksys
WRT54GL
Drone ATROPOS:
La Fonera 2201
18. Taiksonprojects.blogspot.com
We will work with:
➔
Absolute angle: (rad) filtered value
➔
Angular velocity : (rad/sec) from gyroscopes
➔
Angullar acceleration: (rad/sec/sec) calculated from
angular velocity
24. Taiksonprojects.blogspot.com
Router platform: Motor signal board (PWM)
-PIC Microcontroller receives motor speeds via router serial port
-It converts those values into 4 time-fixed digital signals (PWM)
Fonera
/dev/ttyS0 PIC16f876A
ESC
Motores
25. Taiksonprojects.blogspot.com
Router Platform: IMU (Inertial measurement Unit)
➔
Critical process that has to be executed in a time-fixed ratio
setitimer(ITIMER_REAL,&i_int,NULL);
(void)signal(SIGALRM ,timeout_real);
➔
It compites with the rest of the process for CPU time
➔
Changing priority with nice is not sufficent:
➔
Real Time scheduling → FIFO, Round Robin
#include <sched.h>
schedule.sched_priority=sched_get_priority_max(SCHED_FIFO);schedule.sched_priority=sched_get_priority_max(SCHED_FIFO);
sched_setscheduler(pthread_self(), SCHED_FIFO,&schedule);sched_setscheduler(pthread_self(), SCHED_FIFO,&schedule);
26. Taiksonprojects.blogspot.com
WATCHDOG process notifies to kernel that system is not hanged
●
It consumes SCHED_FIFO process time
●
What happens if router hangs during flight->
➔
ioctl(“/dev/watchdog”, WDIOC_KEEPALIVE, &dummywd);