Software > Software

Any one of u got idea about fuzzy logic?

<< < (2/5) > >>

hmm.. well, it is hard for us to get the certain rate isn't it? speaking of that, actually what kind of method approach u applied into ur bot? quite interesting..

I wouldn't say it's hard at all to get any rate you want...all proccessors run at a given clock speed.
there is such a thing as hard time constraints and soft time constraints but for our level generaly
soft time constraints work fine. especialy if the resolution of your time constrainat is fairly small.
Mine was purley reflexive robot with a small layer of subsumption so it wouldn't get caught in a corner.
I left out the fact that I had a sensor looking forward for brevity but it determined if it was in a corner or not.
So what the bassic code looked like was this:

take adc measurement of left right and front
convert measurments

left motor= (left reading/2) + (front reading/2)
right motor= (right reading/2) + (front reading/2)

if left reading and right reading are smaller than some value x and if front reading is over x but under y
turn away from the smaller value between left reading and right reading untill over x


like I said pretty simple but it got the job done. that may not seem like a lot but in pic assembly it
ended up being about 4k.

jesse your code looks like your robot uses 3 IR, and you took averages between a given side sensor and the front sensor, no?

bonomonod be careful of using averages, because the average between no wall, and a wall next to your robot, is still half way through the wall . . .

but what i think jesse did was use the average to find the wall location, and not distance, between the sensors, correct?

Not exactly.  I averaged out the converted readings which were effectively motor comands.
So we just added the front sensor to both right and left sides....meaning if the way was clear both wheels went forward.
But if there was a wall on the right, then the left sensor always slowed down the left wheel forcing a turn.

I said reading but what I meant was "modified value for the motor"

oic, so u did actually fuzzy using the value of IR to determine the rotational direction of ur motor? Is that possible for us to use random motion to apply in robot? which simply means we use the random function and create the random number, with some condition, it will behave randomly and fuzzy.?


[0] Message Index

[#] Next page

[*] Previous page

Go to full version