This is the control code of the segway
- access mpu6050 to get gyro and acceleration information
- compute y-axis error with complimentary filter
- update dc motor speed with PID control
https://www.youtube.com/watch?v=QyjIQknHPFw
- Raspberry Pi
- MPU6050
- L293D
- wiringPi
$ gcc -o mySegway ./mySegway.c ./motors.c -lwiringPi -lpthread -lm
$ sudo ./mySegway
http://blog.bitify.co.uk/2013/11/interfacing-raspberry-pi-and-mpu-6050.html
http://blog.bitify.co.uk/2013/11/reading-data-from-mpu-6050-on-raspberry.html
https://projects.drogon.net/raspberry-pi/wiringpi/software-pwm-library/
http://robotrabbit.blogspot.tw/2012/07/pid.html
http://www.bajdi.com/building-a-self-balancing-bot/
https://docs.google.com/presentation/d/1sfy-g9Abkmnrfon5V3urBC8NwrbvRSWGLPa-99JfPEs/edit?usp=sharing