Go Down

### Topic: Using fuzzy logic (Balancing robot for dummies) (Read 6169 times)previous topic - next topic

#### Patrik

##### Feb 02, 2011, 01:28 pm
I would like to go one step further with the Balancing robots for dummies project and implement fuzzy logic on it.

And I have now successfully created a fuzzy logic controller using Processing.

My test case was getting an object avoiding obstacles when given order to move to specific target..

You can try it here

The input variables was simple angle and distance.

Fuzzy sets for inputs:

Angel to obstacle:
smallAngle
mediumAngle
largeAngle

Distance to obstacle:
smallDist
mediumDist
largeDist

Instead of using linguistic rules I used something called FAMM(Fuzzy associative memory matrix) and that only work in a 2 input, 1 output scenario.

smallAngle   mediumAngle   largeAngle
smallDist   90°   55°   35°
mediumDist   55°   35°   25°
largeDist   35°   25°   5°

Then defuzzification is done true weighting the relationships in the FAMM..

I will improve some parameters of the controller and optimize it a little before I try It on my balancing robot..

Are there any one how have experience of Fuzzy logic and are some other ones interested in this topic?

The balancing robot for dummies guide
http://www.x-firm.com/?page_id=145

#### Patrik

#1
##### Feb 04, 2011, 08:37 pm
I have added a view of the fuzzy controller input variables and output as it could look if you had a GUI to a future fuzzy controller in arduino..

You can see the updated one here
The balancing robot for dummies guide
http://www.x-firm.com/?page_id=145

#### prof_jazz

#2
##### Feb 20, 2011, 08:07 pm
Hi Patrick,

I really enjoyed the work that You and Kas did on the balancing robot.

My "balancing robot" is working quit well with the Kas PID (using encoders).

the only problem I can see is that the initial position (when the sensors are zeroed) does affect a lot the behaviour of the robot.

Is there any way to fix it ?

Kas said that the initial position is not so important because of the feedback of the encoders, but my expirience is different.

Any idea?

Are You working on a "fuzzy PID" ?

Is there any post where to continue Kas discussion?

Bye,

Prof

#### richiereynolds

#3
##### Feb 22, 2011, 10:21 pm

the only problem I can see is that the initial position (when the sensors are zeroed) does affect a lot the behaviour of the robot.

Is there any way to fix it ?

Kas said that the initial position is not so important because of the feedback of the encoders, but my expirience is different.

Yes, I have the same question, I don't see how the encoder based solution can help with self calibration as it doesn't adjust the setpoint.

#### Patrik

#4
##### Apr 06, 2011, 09:44 pm
I'm sorry for my late response but I have been away working so my bot has been standing a while but now I will take it up again. I will rewrite the hole PID part for my bot and also give it two separate PID controls for each motor that will try to keep a exact speed coming from a fuzzy logic control. Check my blog or here for updates..
The balancing robot for dummies guide
http://www.x-firm.com/?page_id=145

Go Up