0
Offline
Full Member
Karma: 0
Posts: 157
|
 |
« Reply #15 on: September 14, 2010, 04:50:24 am » |
It's balancing (at first try)   See it live: http://www.youtube.com/v/pC6yeyDunJg? As soon as I install the battery on top (charger still not received), I will open a new thread with a more relevant title
|
|
|
|
|
Logged
|
|
|
|
|
Toronto, Canada
Offline
Full Member
Karma: 0
Posts: 144
Arduino rocks
|
 |
« Reply #16 on: September 14, 2010, 06:45:32 am » |
This is freaking awesome!!! Congratulations!
I was so busy with my other projects that I neglected my balancing robot (I bought smaller motors and same Pololu wheels, they plug in directly on the motor shaft). I have a 2 axis accelerometer and a one axis gyro, do you think it will suffice or should I get a 5 axis IMU?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 33
Arduino rocks
|
 |
« Reply #17 on: September 14, 2010, 08:59:46 pm » |
That is amazing, why is mine so bad... Sigh... What controller are you using for he wheels?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 1
Arduino rocks
|
 |
« Reply #18 on: September 15, 2010, 12:12:37 am » |
[glow]// Kalman filter module
float Q_angle = 0.001; float Q_gyro = 0.003; float R_angle = 0.03;[/glow]
Hi Kas, awesome work on the project! My mate at uni was showing this to me today looks cool, great progress!
I am also working with an IMU a 6dof one and just wondering for your kalman filter above, how did you find the covariance matrices for measurement error and process error? lke what did you do and stuff? Because im upto that aswell, i have my state space of the kalman filter, just dont understand how to get the covariance matrix. Any help would be appreciated.
Thanks!!
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 157
|
 |
« Reply #19 on: September 15, 2010, 02:17:00 am » |
Hi Ro-Bot-X, nice to see you around  I hope your robot will balance soon Two axis accelerometer & one axis gyro are OK for the job If you use separate breakout boards, make sure that axis are orthogonal, you may end up having the gyro board being perpendicular to the main board. Also sensors units should match, don't fuse radian with deg/sec in your code Finally the backlash we talked about is noticiable, but manageable Please keep me informed of your progress, here or there http://letsmakerobots.com/node/19558
|
|
|
|
« Last Edit: September 15, 2010, 02:19:01 am by kas »
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 157
|
 |
« Reply #20 on: September 15, 2010, 04:50:12 am » |
@Gibby623 >>What controller are you using for he wheels? Not sure I understand your question, please elaborate If you mean motor driver,here it is: http://www.pololu.com/catalog/product/708>>why is mine so bad... Sigh... I understand your frustration,  I have been pursuing this quest nearly for 2 years Please post photos of your bot, together with the code, I will look for possible obvious reasons
|
|
|
|
« Last Edit: September 15, 2010, 04:52:49 am by kas »
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 9
Arduino rocks
|
 |
« Reply #21 on: September 15, 2010, 09:49:57 am » |
i will do this later,if i success[ch65292]i'll show my pictures. i got a question ,why do you put the battery on the top[ch65311] i think that if you put it on the bottom,you can controll the balance better.
|
|
|
|
|
Logged
|
|
|
|
|
Phoenix, Arizona USA
Offline
Faraday Member
Karma: 27
Posts: 5083
Where's the beer?
|
 |
« Reply #22 on: September 15, 2010, 12:38:23 pm » |
i think that if you put it on the bottom,you can controll the balance better. I know nothing about balancing robots, but I would tend to think having the mass at the top would be easier to balance. Try to balance a pencil on your hand, then try it with a weight on top (blob of clay), then a weight near the hand - you'll find its easier with the weight at the top. I imagine the same would be true for a robot (ie, inverted pendulum)... 
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 157
|
 |
« Reply #23 on: September 15, 2010, 01:43:17 pm » |
Quote:
i think that if you put it on the bottom,you can controll the balance better.
I know nothing about balancing robots, but I would tend to think having the mass at the top would be easier to balance. Try to balance a pencil on your hand, then try it with a weight on top (blob of clay), then a weight near the hand - you'll find its easier with the weight at the top. I imagine the same would be true for a robot (ie, inverted pendulum)... Your are right cr0sh the robot acts as an inverted pendulum and works better when the weight is high (it increases intertia and allows more reaction time). Try to balance a broom in the palm of your hand and see which side is easier to balance. However, PID parameters need different tuning
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 157
|
 |
« Reply #24 on: September 15, 2010, 02:07:35 pm » |
// Kalman filter module
float Q_angle = 0.001; float Q_gyro = 0.003; float R_angle = 0.03;
Hi Kas, awesome work on the project! My mate at uni was showing this to me today looks cool, great progress!
I am also working with an IMU a 6dof one and just wondering for your kalman filter above, how did you find the covariance matrices for measurement error and process error? lke what did you do and stuff? Because im upto that aswell, i have my state space of the kalman filter, just dont understand how to get the covariance matrix. Any help would be appreciated.
Thanks!! Kalman filter module works pretty well but is still a Black Box for me I tried hard to understand and finally gave up. :o This code is a modified version from the AeroQuad project from Ted Carancho http://code.google.com/p/aeroquad/I spent some hours playing with Q_angle, Q_gyro and R_angle, and finally reverted to the original parameters Some additional lectures for the brave: http://academic.csuohio.edu/simond/courses/eec644/kalman.pdfhttp://www.cs.unc.edu/~welch/kalman/index.html#Anchor-Rudolph-6296http://forum.sparkfun.com/viewtopic.php?t=6186
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 5
Atmel rocks
|
 |
« Reply #25 on: September 15, 2010, 11:50:47 pm » |
Kas,
I am confused, on the let's make Robots site, you stated that thanks to Dallaby your robot balances. Now, Dallaby uses a complementary filter. You mention you are using a Kalman filter. So, is this the case, if so what is the contribution from Dallaby?
I am asking because I am trying to start similar project and not sure whether to spend more time trying to be able to run the kalman routines or go ahead with the complementary filter. Several sites talks very good about this simpler approach.
Thanks !
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 33
Arduino rocks
|
 |
« Reply #26 on: September 16, 2010, 10:25:28 am » |
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 157
|
 |
« Reply #27 on: September 16, 2010, 10:26:37 am » |
Hi josev, This is a long story I made several unsuccessfull attemps to build an acceptable balancing bot, both with Kalman or complementary filter; I finally gave up 6 months ago. Reading, Dallaby blog gave me new ideas for the project, mainly for hardware (I was using continuous rotation servos). Dallaby uses a single axis accelerometer which is OK small angles, together with a very simple and efficient code. I chose the full blown path, but again, without visiting his site, I wouldn't be writing to you right now. :  The above Kalman code is really convenient and self contained Feed it with Acc angle, Gyro speed and loop time, it will spit back the filtered angle right away Just make sure that data are scaled and your loop time is accurate/constant, mine is running 100 Hz, see above "loop timing control". Good luck, keep us informed
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 157
|
 |
« Reply #28 on: September 16, 2010, 10:37:47 am » |
Easy  - Go to http://imgur.com/ - Upload you photo(s) - copy the "Message board" line - paste it here
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 157
|
 |
« Reply #29 on: September 16, 2010, 11:13:32 am » |
Gibby623, A bit dubious about your PID function Why do you have "PID" and "PID_comp"?? is "a" a tuning factor (as my "K") ?? I would have expected PID to be positive or negative according to the bot being tilted forward or backward Also if your loop is fixed time, you can omit the dt factor anycase, here is my PID code: float K = 1.4; int Kp = 3; int Ki = 1; int Kd = 6; int last_error = 0; int integrated_error = 0; int pTerm = 0, iTerm = 0, dTerm = 0;
int updatePid(int targetPosition, int currentPosition) { int error = targetPosition - currentPosition; pTerm = Kp * error; integrated_error += error; iTerm = Ki * constrain(integrated_error, -GUARD_GAIN, GUARD_GAIN); dTerm = Kd * (error - last_error); last_error = error; return -constrain(K*(pTerm + iTerm + dTerm), -255, 255); }
This function accepts 2 parameters - target position (normally = 0) - current position = the angle obtained from Kalman or complementary filter the function returns an integer value, between -255 and +255 Please let me know which Acc and Gyro models are buit on your specific Sparkfun board
|
|
|
|
« Last Edit: September 16, 2010, 11:32:12 am by kas »
|
Logged
|
|
|
|
|
|