PDA

View Full Version : [Project] Self Balancing Two-Wheel Using GYRO



bonmot
04-08-2010, 07:54 PM
Started this project a couple of weeks ago. The original thought was to test the GYRO chip and play with PID Control.
It turned out to be a very very tool to learn GYRO chip and PID control logic.
I built the electronics by myself, and stole a R/C car from my son :-D.
Will release more pictures and drawings soon.
Here is a youtube video to start.


http://www.youtube.com/watch?v=8c59oqOyjUc

bonmot
04-08-2010, 08:16 PM
Some Parts

bonmot
04-08-2010, 09:10 PM
The PID control and some other adustable parameters are very tricky to get the two-wheel stand up, and even trickier to get the best performance.
Next step is to put some logic in the software to let it do self learning to get the best performance.
The first thing is to define what is "good performance".

elios
04-08-2010, 09:28 PM
wow awesome project. I reckon what would be cool is to get a wrecked segway and turn the base into a two wheeled robotics platform.

bonmot
04-08-2010, 09:39 PM
I am thinking about turnning a dolly into a segway!

elios
04-09-2010, 12:34 AM
:D Keep us updated :)

it must be a much cheaper option, im sure :) :) :)

Again, well done and keep up the great work. :cool:

JonHylands
04-09-2010, 07:06 AM
Very interesting. Some questions:

- what microcontroller are you using?
- what board are you using? (self designed or kit?)
- which gyro sensor?
- how are you filtering the gyro sensor readings to reduce drift?

- Jon

bonmot
04-09-2010, 09:33 AM
Hi Jon, nice to see you again.

Here is my answer:

- what microcontroller are you using?
ATMEGA644P-20AU, at 18.432MHZ for highest UART in the future.
- what board are you using? (self designed or kit?)
Self designed.
- which gyro sensor?
LPY510AL
- how are you filtering the gyro sensor readings to reduce drift?
No filtering for the gyro sensor, all done in the software.
hardware filtering only takes away details, then actually increases the drift.

bonmot
04-09-2010, 09:38 AM
:D Keep us updated :)

it must be a much cheaper option, im sure :) :) :)

Again, well done and keep up the great work. :cool:

Thanks, I am not sure if I am getting deeper in this two-wheel thing.

This project was originally started/planned for testing sensors and PID response time and speed of microprocessor for my BiPed project coming.

But if there are more people insterested in this project, I will spend more time to do more test and feedback.

JonHylands
04-09-2010, 12:12 PM
Hi,

Thanks for the answers. I assumed the gyro filtering was done in software - I'm just curious as to what kind of software filtering you used?

- Jon

bonmot
04-09-2010, 06:51 PM
Hi,

Thanks for the answers. I assumed the gyro filtering was done in software - I'm just curious as to what kind of software filtering you used?

- Jon

there is no fancy filtering involved. what I did is simple averaging.

chuong_bk
10-13-2010, 12:27 AM
Hi,Bonmot
I'm working for a two-wheel balancing robot using a PID control,but now I'm having a trouble with PID.It balances for like 3 seconds before oscillating back and forth and eventually falling.
This is my code:

Kp=0.5;
Kd=0.01;
Ki =1
e_current=0;
e_last=0;
e_sum=0;
tilt_balance=0;

e_current=tilt_balance-tilt_est;
P=Kp*e_current;
de=e_current-e_last;
D=Kd*de;
e_sum=e_sum+e_current;
I=Ki*e_sum;
Drive=P+D+I;

e_last=e_current;

So,can you give me some advise?