First, let me introduce you to FROBO (Fuzzy Robot). He’s small and he’s got an Arduino for a brain. He uses three parallax ping sensors to sense the world around him. FROBO uses two DC motors with a gearbox to achieve differential drive and wears a speed-flag for safety from other robots (you wouldn’t want a big robot to step on him would you?).
Perhaps the most interesting thing about FROBO is that he only took about eight hours to complete from start to finish including programming. In fact, creating FROBO’s run-time program took less time than locating the short that was making the drive motors act strangely.
Arduino FIST (Fuzzy Inference System Translation) allowed for rapid prototyping of FROBO’s behaviors. In short, Arduino FIST takes a .FIS (fuzzy inference system) file created by MATLAB, or by hand, and turns it into C code that is useable on the Arduino, or just about any other micro-controller system as long as it has some support for floating point math. It’s probably time to give you a quick refresh on fuzzy systems.
Fuzzy systems allow you to take natural language concepts like “too close” and use them in a rule-set for controlling systems. For example: If Left-Wall is Too Close Then Left Wheel is Fast and Right Wheel is Slow. That rule is used by a fuzzy system to keep the robot from hitting an object to it’s left. Fuzzy systems use geometric representations of concepts like “Too Close” that are pretty intuitive once you’ve had a chance to play with them. The important thing to know about FIST is that it takes care of all the hard “mathy” parts of implementing your fuzzy system and allows you to focus on rule creation.
THIS GUY explains the whole fuzzy thing with a great accent.
FROBO relates the information it gathers from its three sensors to outputs on its motors through a set of rules. Very minimal Arduino code has to be written. In fact, to get FROBO to run, the pins had to be defined, a call to the Fuzzy system had to be created, and the output to the motors using AnalogWrite (PWM) had to be written – and that’s it! The entire behavior of the robot was defined through geometric doodles and simple rules in MATLAB.
For those of you that don’t have MATLAB, it is possible to write the .FIS format by hand, and we’ll provide a page defining how to do that.
If there’s enough interest ($5,000 or more in donations) we will also write a visual interface program that produces .FIS files in a way similar to that of MATLAB.
You can access Arduino FIST on our website here: http://www.makeproto.com/projects/fuzzy/matlab_arduino_FIST/index.php
To use it:
1. Design a cool robot (or control system).
2. Write a fuzzy system using MATLAB or by hand defining the behaviors of said robot.
3. Dump the .FIS file onto our website at the link provided above.
4. Two output files will be produced, a .h file and a C file. Copy the contents of the C file and dump it into your Arduino IDE. Put the .h file in the same folder as your Arduino sketch.
5. To access the system, create an array of inputs and an array of outputs.
6. Call the system function with a pointer to the inputs and a pointer to the outputs. (the function will have the same name as your .FIS file).
6. Use the outputs of the FIS to control whatever it is you need to control.
NOTE: Arduino FIST is not guaranteed for any purpose whatsoever. Please do not design your new life support system using Arduino FIST.
That’s all there is to it folks! Have fun.