Go Down

Topic: Balancing robot for dummies (Read 145 times) previous topic - next topic

kas

Quote

Sure, processing code I used is from -> http://wiki.processing.org/w/Tom_Igoe_Interview

Hi Gibby623
Thanks for the link
I have purchased a copy of Tom's "Making Things Talk" and do recommend this book.

Quote

Kas I found a problem with my code which was I was updating the gyro angle referenced to the real estimated angle.
Code:
gyroAngle = angle + rollRate*dt

Instead of...
Code:
gyroAngle = prev_gyroAngle + rollRate*dt

unless you modify gyro_alpha in some other places,
 gyro_alpha = prev_gyro_alpha + rollRate*0.011;
is equivalent to
 gyro_alpha = gyro_alpha + rollRate*0.011;
 prev_gyro_alpha = gyro_alpha;
You should't get a different result
In fact
 prev_gyro_alpha = gyro_alpha;
should be deleted:

Code: [Select]
void getGyroAlpha()    {
 rollRate = ((rollADC - rollADC_offset)*Aref/1024)/0.0091;
 gyro_alpha = gyro_alpha + rollRate*0.011;
}

I probably miss something  :-?
Please clarify

Quote

 rollRate = ((rollADC - rollADC_offset)*Aref/1024)/0.0091;
Please explain the 0.0091 coefficient

Gibby623

Kas, you are very right about the prev_gyro_alpha, but this still will not solve my issue... I will let you know if I find the issue.

Quote
Please explain the 0.0091 coefficient


As for the 0.0091, I have the sensor that offers the x4.5 pin which has a sensitivity og 9.1mV/degree/s instead of the 2.?mV/degrees/s


kas

Quote
As for the 0.0091, I have the sensor that offers the x4.5 pin which has a sensitivity og 9.1mV/degree/s instead of the 2.?mV/degrees/s

Gibby623, please let me have a direct link to this sensor


gbm

Take a look. To start a project like this I think you need the KISS approach. I start in this side of robotics with a very simple system, Look at this:
http://www.gioblu.com/tutorials/programmazione/102-che-cose-lalgoritmo-pid
(use google translate)

Here to build it:
http://www.gioblu.com/tutorials/robotica/100-self-balancing-robot-per-noobs-p

here our code for mems:
http://www.gioblu.com/tutorials/programmazione/98-filtro-di-kalman-con-arduino
Community robotica / programmazione Arduino
www.gioblu.com

Go Up