Poll
Question: I will need help with my project ?
With the programing part - 47 (58%)
With the DC motors - 34 (42%)
Total Voters: 26

Pages: 1 ... 10 11 [12] 13 14 ... 16   Go Down
Author Topic: Balancing robot for dummies  (Read 142616 times)
0 Members and 2 Guests are viewing this topic.
Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 362
Posts: 17307
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I still need to test a lumpy dull surface. Ill try it on my brothers wife

This is either a great insiders joke or a completely WTF comment.  ;D

Lefty
Logged

0
Offline Offline
Sr. Member
****
Karma: 18
Posts: 402
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Kas, Jon-D, theres a good few links there i need to look up, thanks. as for fuzzy i have not tried it but there is a pic app note i will try to post the link for.
RE ADNS-7550 laser optical mouse encoder as a velocity encoder:
so far i have placed the encoder over a flat belt which is connected to a motor which has a heds slotted disk encoder fitted  therefore i get quadrature encoder data to compare with the optical .
1. at constant velocity the two encoders give an average velocity which is comparable within roughly 10%.
2. the optical encoder gives an erratic reading , over and under the heds encoder.
3. for zero velocity both read zero
4. for very low velocity, 1mm/sec the optical reads zero !
5. for absolute position , ie step changes, the optical very quickily has a large error. this can be tested with a pc mouse, just try to move it repeatedly back to a fixed position and see where the arrow ends up!

I emailed AVAGO with these findings and asked if the sensor has a high pass filter, they said they dont spec low speed, also the absolute accuracy is only 20-30% ! shock. also (area of image is < 2mmsq)
despite this im not giving up hope.
it is possible to read the pixel image data, if a pattern is used where the absolute dimensions are known then surely a more accurate calculation can be done. and don't call me shirley.
I asked if the ADNS-9500 super gaming sensor was any better but no mention was made in their reply, and you cant get one for love or money, same family anyway but it does need a firmware download so theres hope for a special version ?
It may be that my 7550  just didnt have the right surface but one register reports surface quality , i never got better than 75%, i tried
black htd M3 belt- raw - 0%
lightly sprayed with gold xmas metallic - 75%
any colored card 50%
aluminium foil - rubbish
embossed plastic metallized sheet - 30 %
white card with very fine black fibers - 30 %  
I still need to test a lumpy dull surface. Ill try it on my brothers wife .

RE motor drivers, check that acceleration control is turned off, current limit, all the saftey features!, im just building with a new one, vn??
merry xmas everyone,  
Hi beautifulsmall, I am impressed  :o
I suspect you may end up working for AVAGO  smiley


I am preparing "Balancing robot for dummies part seven" (wireless Xbee control +  KasBot V 3.0) and expect to be ready within a week
« Last Edit: December 28, 2010, 07:28:07 am by kas » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everybody,

This is my first post at Arduino forum and I'd like to say thank you for creating such a great topic.

Just like you, I am interested in two wheel balancing robots. I have built my own one. My robot's construction is similar to this one:

but mine is bigger. I am sorry I cannot provide you with a photo of it right now. I will do so as soon as I can.

When trying to balance the robot, I have a couple of questions as follow:

1. Since the two motors are not perfectly identical, there should be two more PID control loops (apart from the main balance PID loop), one for each motor, to guarantee that the real motor's velocity will strictly follow the set one. In my case, this is actually a problem because when I apply an equal voltage to the two motors, they rotate with different speeds. Especially when one wheel hits an obstacle, say a crack on the ground, and cannot cross it, the robot will rotate around the wheel (in stead of stopping or moving forward). But I didn't see such a problem mentioned before at this thread.

2. Currently I am using the cascaded PID control approach to balance the robot. This approach has been used successfully by Brian Kuschak with his bk-bot:
http://www.bkinnovation.com/bkbot/
My robot can barely balance, in the sense that it doesn't fall, but it oscillates around the equilibrium point with a frequency of 1 to 2 Hz and the oscillation's amplitude is pretty large (the wheel moves back and forth with a travel distance of ~3 inches). I have spent days tuning the PID parameters to reduce this oscillation but so far I have had no improvements. When being pushed, the robot can keep its balance, but it oscillates even more wildly. Please look at this picture to see how my robot responds to a push:


How do you guys think about this? Is this resulted from an improper set of control parameters? If you know a correct procedure for tuning the PID parameters, please show me the way ^^!

3. The third question is about the wheel size. From my observation, it seems that with bigger wheels it is easier to balance, am I correct? Currently my wheels are made from plastic. They are hard and small (their diameter is about 3 inches, which is quite small because my robot is 1.2 metres in height). Will rubber wheels with bigger diameter be better?

Thank you for reading my questions. Any answer would be very appreciated.

I wish you a happy new year ^^

Villa
« Last Edit: December 29, 2010, 09:37:32 am by Villa » Logged

0
Offline Offline
Sr. Member
****
Karma: 18
Posts: 402
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Villa, welcome aboard

Please post a photo of the beast as soon as you can

Quote
1. Since the two motors are not perfectly identical, there should be two more PID control loops (apart from the main balance PID loop), one for each motor, to guarantee that the real motor's velocity will strictly follow the set one. In my case, this is actually a problem because when I apply an equal voltage to the two motors, they rotate with different speeds. Especially when one wheel hits an obstacle, say a crack on the ground, and cannot cross it, the robot will rotate around the wheel (in stead of stopping or moving forward). But I didn't see such a problem mentioned before at this thread.
Each motor has a different PWM/speed response. I trim left PWM motor within the code and make adjustments while driving the bot using the RC controller' joystick.
You are right, we need more sophistiated control, a single PID loop doesn't cope with the job.
Also those DC motors don't run well at low speed, below PWM < 20 (no torque)
see DC motor with PID

I am impressed by this control scheme shown on the above link

I will contact Brian and ask him to stop by

Quote
2. Currently I am using the cascaded PID control approach to balance the robot. This approach has been used successfully by Brian Kuschak with his bk-bot:
http://www.bkinnovation.com/bkbot/
My robot can barely balance, in the sense that it doesn't fall, but it oscillates around the equilibrium point with a frequency of 1 to 2 Hz and the oscillation's amplitude is pretty large (the wheel moves back and forth with a travel distance of ~3 inches). I have spent days tuning the PID parameters to reduce this oscillation but so far I have had no improvements. When being pushed, the robot can keep its balance, but it oscillates even more wildly. Please look at this picture to see how my robot responds to a push:
How do you guys think about this? Is this resulted from an improper set of control parameters? If you know a correct procedure for tuning the PID parameters, please show me the way ^^!
Looking at the above diagram, my first idea would be to increase abs(Kd). You need more damping (see post #32). Others will jump with additional ideas.
Also try changing the sign of Kd (mine is negative)

Quote
3. The third question is about the wheel size. From my observation, it seems that with bigger wheels it is easier to balance, am I correct? Currently my wheels are made from plastic. They are hard and small (their diameter is about 3 inches, which is quite small because my robot is 1.2 metres in height). Will rubber wheels with bigger diameter be better?
I went from 80mm to 90mm wheels, I definitly noticed an improvement due to higher speed and larger contact surface with the ground.
Motors should be strong enough to cope with the additional torque.

Logged

0
Offline Offline
Sr. Member
****
Karma: 18
Posts: 402
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
From post #148
Quote
How about you. It seems you are interested about control as well. Any other interesting projects or something?

...
I started a new exciting project also based on control/balance.
I wont talk about it now to avoid polluting this thread
Here is the new project  smiley


@Ro-Bot-X you know this one don't you ??  smiley-wink

The objective is to free henpecked husbands from boring domestic duties  ;D ;D ;D
I fact I may also develop a balancing vacuum cleaner  :smiley


             **  Happy New Year to everybody  **[/size]


« Last Edit: January 01, 2011, 02:07:56 am by kas » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, kas. Happy New Year to you!
I am doing my own balancing robot. However, there is something wrong with the fusing.
My filtered angle seems to lag the real angle for about several seconds. My accelerometer is ADXL202, and the gyro is ENC03, the Kalman filtering code which I use is from this thread .Here is the imagine on my filtering.
ftp://http://user.qzone.qq.com/513837087?ADUIN=513837087&ADSESSION=1293883100&ADTAG=CLIENT.QQ.3067_MyTip.0&ptlang=2052
Could you give some suggestions on it? Thank you!
Code:
void PIDAnglePosition(INT32S* const pGivenSpeed1, INT32S* const pGivenSpeed2, INT32S CarSpeed)
{
      INT32S ADData = 0,Acc = 0,i;
      FP32 MeaAngle,MeaAngleDot;                  FP32 AngleError,temp;
      

      Acc = MeasureAcc() + ACC_OFFSET;
      MeaAngle = asin((FP32)Acc/GRAVITY_G);                  //Measure angle by the accelerometer
      temp = MeaAngle*1000;            //translate the float into integer by multiplying 1000,then send it to PC by serialport
      SendData[4] = (INT32S)temp%1000;
      SendData[3] = (INT32S)(temp/1000);
            
      ADData = ReadTLC4541();                  //measure the anglespeed by the gyro  5000.0*(ADData-RefAD)/65536.0/0.67/K;
      MeaAngleDot = 0.001995*(RefAD-ADData) / K;
      temp = MeaAngleDot*1000;
      SendData[6] = (INT32S)temp%1000;
      SendData[5] = (INT32S)(temp/1000);
      
      kalmanCalculate(MeaAngle,MeaAngleDot);

      temp = x_angle*1000;
      SendData[8] = (INT32S)temp%1000;
      SendData[7] = (INT32S)(temp/1000);
      
      AngleError = - x_angle;
      Position += CarSpeed;                  
       *pGivenSpeed2 = *pGivenSpeed1 = AngleKp*AngleError + AngleKi*FiltAngleDot
                                                  + PositionKp*Position + PositionKi*CarSpeed;      
}
« Last Edit: January 01, 2011, 08:29:43 pm by niebing1987 » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello guys,
At first I want to say a word about bk-bot control algorithm, it will not  work correctly, main error is that balance pid output is torgue not speed, so...
Second do not use kalman filter as main angle output, it is a little laggy and not enough accurate. Use only gyro and incremental encoders.
Ok you will say gyro have not angle reference and integration is inaccurate. Yes it is, but here is a trick, in long term equilibrium angle is always 0deg, so you only need to know short term angle. So in long term angle, program artifically slowly averaging angle to 0deg.

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is my robot:

http://img594.imageshack.us/f/86546394.jpg/
http://img819.imageshack.us/i/56664166.jpg/
http://img221.imageshack.us/img221/280/bbcontrol.png
Logged

Bor
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

SnakeLT: Very impressive robot, can you give us any details on the algorithms you use? Normal PID loop as anyone else here or anything fancier smiley-wink?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using interactive (series) PID.
Logged

Toronto, Canada
Offline Offline
Full Member
***
Karma: 0
Posts: 144
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Happy New Year!

@kas: yes, that is my long term goal, but I fear it's way too hard for me to do, as I lack solid programming skills and have no time to learn and experiment

Lately I've been swamped by work, but I started some other projects that take me away from my poor balancing bot. I did not built a proper frame for my bot, I've been trying to see if a regular low profile robot can do balancing. I've come to the conclusion that large wheels are important, high COG improves balancing, high speed is required for fast corrections. That being said, my poor low height robot with small wheels and not enough speed has trouble balancing even for a split second.

So keep it up guys, I'll do some more work on my bot in a few weeks when I'll be off work.

Cheers!
Logged


0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@kas: Thank you for your answers. I will try your suggestions when I have access to my robot  smiley

@SnakeLT: Could you explain more about this:
Quote
At first I want to say a word about bk-bot control algorithm, it will not  work correctly, main error is that balance pid output is torgue not speed, so...
Why is it that the balance pid output must be torque, not speed?

Thank you,

Villa
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It does not must be torgue, but in this case it is. At output you got torgue and you interpret it like speed. Look at my algorithm, and dont use motor speed pid.
Logged

0
Offline Offline
Sr. Member
****
Karma: 18
Posts: 402
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Hi, kas. Happy New Year to you!
I am doing my own balancing robot. However, there is something wrong with the fusing.
My filtered angle seems to lag the real angle for about several seconds. My accelerometer is ADXL202, and the gyro is ENC03, the Kalman filtering code which I use is from this thread .Here is the imagine on my filtering.
http://user.qzone.qq.com/513837087?ADUIN=513837087&ADSESSION=1293883100&ADTAG=CL...
Could you give some suggestions on it? Thank you!
Hi niebing, nice to see you here
I noticed some asian characters (now gone) in your code, out of curiosity, where are you based ??

I can't access the Web address you indicated, from my PC.
Seems you use only one ACC and asin() vs atan().
Your code is too different from Kasbot, sorry, I can't help  smiley-sad
Please let us have a photo of your bot

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am from China.
Quote
Seems you use only one ACC and asin() vs atan().
I just used one axis to measure the angle by accelerometer. I want to know is it right?
 About my robot, i do not have built up it,  i am only doing the experiment on the fusion.So i do not have the photo of my robot, Sorry smiley-sad.
I changed my link on the photo,could you have a try?
the black line is the angle measured by the accelerometer. the read one is angle speed , the blue one is filtered angle
http://niebing1987.tuzhan.com/photo/f1998db0d3002b80.html
« Last Edit: January 01, 2011, 08:58:48 pm by niebing1987 » Logged

Pages: 1 ... 10 11 [12] 13 14 ... 16   Go Up
Jump to: