"I happen to believe that robotics will be bigger than the Internet." Marc Raibert, CEO and founder of Boston Boston Dynamics.
MARB will protect your home, support you during your everyday life and be your fellow. The ambition of this project is to enable robotic computing for every household.
Main structure (of the first prototype) based on popular MakerBeam parts as well as some custom designed 3-D printed, machined and and laser cut parts. Every arm has 4 DOF, the head 2 DOF. Only digital servos with brush-less motors are used. Head consists mainly of a SunFounder 24x8 LED Dot Matrix Module called EMO. The robot base uses 2 angular geared DC motors, supported by 2 caster wheels so that it can turn in any direction and turn in its own length. Controlled by several Arduino micro-controllers, main brain probably a Raspberry Pi. Beside of how to build this robot, the project will address artificial intelligence and provide all the source codes.
More details will follow in the build logs. So far:
In this log I will discuss some algorithm ideas I have in mind for MARB. Some are easy, some require higher math.
1. Weather forecast
MARB will not be connected to the internet. Call me old-fashioned, but it has nothing to do with AI to get for instance the weather forecast from some online services like weather.com. So how can MARB forecast the weather?
In the old time we used analog barometers like the following:
With a digital barometer like the BMP180 and a few if-statements we can predict the current weather. By storing the previous measured atmospheric pressure and compare it with the current one, we can also predict if the weather is improving or deteriorating. To forecast the weather of the next couple of days, we can use so called Markov chains. The probabilities of weather conditions (rainy or sunny), given the weather on the preceding day, are represented by the transition matrix:
The matrix P represents the weather model in which the probability that a sunny day followed by another sunny day is 0.9, and a rainy day followed by another rainy day is 0.5. Markov chains are usually memory-less. That means, the next state depends only on the current state and not on the sequence of events that preceded it. But we can change the initial state if we have other experiences to model the weather or something else. One more note: Columns must sum to 1 because it's a stochastic matrix.
The weather on the current day 0 is either sunny or rainy. This is represented by the following vectors (100% sunny weather and 0% rainy weather or 0% sunny weather and 100% rainy weather):The general rule for day n is now:
This leaves us with the question how to compute these matrices multiplications for our example:Let us assume the weather on day 0 is sunny, then weather on day 1 can be predicted by:
Hence, the probability that the day 1 will be sunny is 0.9.
Applying the general rule again, weather on day 2 can be predicted by:
2. Intelligent obstacle avoidance
Today I spend the half day writing basic code for an obstacle avoidance algorithm, mainly a function to store all the distances of the ultrasonic sensors in an array and functions to represent all possible movements of the robot in the plain, taking PWM (maybe based on temperature, means entropy, or remaining battery power) and other things into account. Now I have to think about how MARB could avoid obstacles in an intelligent way. I have some ideas, let's see, how it goes...
Let every sensor Si of the sensor array representing a bit of a 7-bit binary number S0, S1, S2, S3, S4, S5, S6. Let Si = 1 if the sensor detects an obstacle and else 0.
First code snippet, which converts all obstacle occurrence possibilities into a decimal number between 0 and 127. I am sure, this could be coded much more elegant, but for now I want to focus on the functionality, on the beauty I will work later...
An APDS-9960 RGB and gesture sensor acts as a low level machine vision to recognize gestures, colors of objects and distances. The Samsung Galaxy S5 actually uses the same sensor. A bi-directional logic level converter is needed for 5 V micro-controllers, because the APDS-9960 works only with a VCC of 2.4 - 3.6 V.
Mounting bracket design:
I am using this bi-directional level shifter from Adafruit. Those breakouts have usually no mounting holes, so I added a cavity on the back of the mounting bracket, where the level shifter will be glued in place.
I also tested two APDS-9960 libraries, one from Sparkfun and one from Adafruit. The Sparkfun library is much better regarding the gesture control. It senses every movement correctly at a distance up to 20 cm while the Adafruit fails very often even at much lower distances.
MARB will be equipped with a bunch of sensors to sense time, humidity, temperature, barometric pressure, ambient light, gas concentration, orientation and acceleration. So far I have tested a DHT11 based hygrometer, a TEMT6000 ambient light sensor and a MiCS-5524 based gas sensor.
The gas sensor can easily detect an open bottle of ammonia solution.
After tinkering a while with many different sensors, I decided to use for now following sensors:
The ultrasonic module consists of 7 HC-SR04 distance sensors and a 3-D printed enclosure. The module will be mounted on the front of the robot base, a second one can be mounted on the backside if necessary. So far I finished the 3-D drawing of the enclosure.
7 HC-SR04 mounted:
I also designed an extension shield for the two Arduino MEGA's to have better access to the remaining I/O and analog pins:
Populated extension shields for the two Arduino MEGA's, MARB has on board:
Time to take in some considerations about the power supply of MARB. I am using a 9.6 V, 5000 mAh NiMH racing pack battery. Obsolete, you will think. Why not using a Li-Ion or Li-Po battery? I can tell you. NiMH batteries are much easier to handle than Li-Ion or Li-Po batteries. They forgive mistakes Li-Ion or Li-Po batteries won't. They may have less energy capacity and a memory effect, but they normally don't burn or explode when treated the wrong way.
Battery mounted on the robot:
3-D printed bracket for the ON/OFF switch:
Another 3-D printed part for the power distribution and motor control module:
Main human machine interface will be a DFrobot 2.8" TFT touch shield on an Arduino MEGA (which works fine on Arduino UNO and MEGA by setting the 3 tiny SMD switches on the backside of the PCB and using the SPI, Adafruit GFX and Adafruit ILI9341 libraries) and a custom designed shift registers based keyboard PCB, which I still need to populate and test:3 parts to 3-D print: the TFT and Arduino MEGA bracket, the keyboard bracket and the TFT cover.
Finally I populated the keyboard PCB and tested it:
Keyboard module completed:
Like for my previous robot project Murphy I am using a 2 W, 8 Ω miniature loudspeaker, an EMIC-2text-to-speech module, a TPA2005D1 breakout board and a custom designed carrier board:
Important notes: The EMIC-2 does not work properly with Arduino hardware serial. Use theSoftwareSerial Library instead. The potentiometer is not really necessary as the volume can be adjusted by software.
Speech module design:
Again, Shapeways has done a great job printing this part:
EMIC-2, TPA2005D1 breakout board and loudspeaker assembled and attached to the robot:
I will use these angular geared motors to propel the robot:
I designed according mounting plates to attach the motor to the 15 x 15 mm MakerBeam T-nut profiles and laser cut it from 3 mm stainless steel plates. The DFX file will be provided later in the file section.