Friday, December 28, 2007
HummBot: basic object avoidance
I have ordered ultrasonic sensors (at Sparkfun.com) for longer range object detection. These will be mounted on the servos to scan a wide area (1-2 meters) in front of the HummBot.
Another thing that needs attention is speed control. First I want to buy/build an encoder to measure the travelled distance. This is highly needed since the ESC is very inaccurate, resulting in unpredictable distances.I am still thinking about the correct mounting place for an encoder. Suggestions are welcome!
Next to that I am considering to replace the motor with a high torque motor which will make it easier to drive at slow speeds. Currently this is very difficult since there is a subtle balance between driving slow and stalling the motor.
Sunday, December 23, 2007
HummBot Platform
Being assembled it looks like this:
The servo controlled IR sensor are just at the right height such that they can 'look out of the window' of the HummBot. This is what it looks like with the body:
I'm currently finished the code that will control the servos and sensors such that HummBot can start avoiding obstacles!
Friday, December 21, 2007
HummBot changes direction
Because the previous HummBot video was very dark, I've made another video in day light. Also the HummBot can change direction now since the Arduino controls the steering servo of the HummBot!
As you can see in the video, the HummBot clearly needs some sensors to prevent it from hitting obstacles :-)
Don't hesitate to give me some feedback. I'm very interested in hearing your opinion and improvement ideas!
This is the microcontroller code that I used for this video:
1: int ledPin = 13;
2:
3: int servoPin = 4;
4: int rightPulse = 1900;
5: int neutralPulse = 1500;
6: int leftPulse = 1100;
7: int servoPulse = neutralPulse;
8:
9: int escPin = 2; // Control pin for the ESC
10: int forwardPulse = 1565;
11: int previousDirection = neutralPulse;
12: int backwardPulse = 1420;
13: int escPulse = neutralPulse;
14:
15: long lastPulse = 0; // the time in milliseconds of the last pulse
16: int refreshTime = 20; // the time needed in between pulses
17:
18: int waitTime = 2000;
19: long lastChange = 0;
20:
21: void setup() {
22: pinMode(escPin, OUTPUT);
23: pinMode(servoPin, OUTPUT);
24: servoPulse = neutralPulse;
25: escPulse = neutralPulse;
26: pinMode(ledPin, OUTPUT);
27: Serial.begin(9600);
28: }
29:
30: void loop() {
31:
32: if (millis() - lastChange >= waitTime) {
33: // Important: to callibrate the ESC, start with a neutralPulse of 2 sec.
34: // Drive backwards, forwards, backwards, forwards, ...
35: if (escPulse == neutralPulse) {
36: if (previousDirection == forwardPulse) {
37: escPulse = backwardPulse;
38: } else {
39: escPulse = forwardPulse;
40: }
41: if (servoPulse == neutralPulse || servoPulse == rightPulse) {
42: servoPulse = leftPulse;
43: } else {
44: servoPulse = rightPulse;
45: }
46: waitTime = 2000;
47: } else if (escPulse == backwardPulse) {
48: escPulse = neutralPulse;
49: previousDirection = backwardPulse;
50: waitTime = 1000;
51: } else if (escPulse == forwardPulse) {
52: escPulse = neutralPulse;
53: previousDirection = forwardPulse;
54: waitTime = 1000;
55: }
56: // Debugging:
57: if (Serial.available() > 0) {
58: Serial.print(escPulse, DEC);
59: Serial.print(" ");
60: }
61: lastChange = millis();
62: }
63:
64: // send pulses at 50Hz:
65: if (millis() - lastPulse >= refreshTime) {
66: digitalWrite(escPin, HIGH);
67: delayMicroseconds(escPulse);
68: digitalWrite(escPin, LOW);
69: digitalWrite(servoPin, HIGH);
70: delayMicroseconds(servoPulse);
71: digitalWrite(servoPin, LOW);
72: lastPulse = millis(); // save the time of the last pulse
73: }
74: }
Thursday, December 20, 2007
Wednesday, December 19, 2007
HummBot drives!
I used the following components:
- Arduino controller,
- a Graupner electronics speed controller (ESC),
- a breadboard,
- a 7.2V battery pack.
In this first setup the HummBot drives forward for 2 seconds, then backwards for 2 seconds, then forwards again, and so on...
Here is a first picture, I will make a video shortly.
The next step will be to create a proper platform in the HummBot chassis to attach the Arduino and breadboard to. After that I will of course combine the servo, IR sensor and motor control to let the HummBot drive around some more!
Saturday, December 15, 2007
My first HummBot circuit
- Arduino controller
- one Hitec Servo
- two Sharp IR sensors
- a breadboard
- a 7.2V battery pack
The IR sensors are connected to the 5V, Gnd and one of the analog pins.
The Servo is connected to the Vin (7.2V), Gnd and one of the digital pins.
I created a program that checks both sensor values, and if the right sensor detects something the servo is turned right and if the left sensor detects something the servo is turned left.
Very basic, but nice to start with!
Wednesday, December 12, 2007
Arduino has arrived!
The microcontroller is the Arduino Diecimila and the IR sensors are Sharp GP2D15 sensors. I plan to use the Arduino and IR sensors for my new HummBot project. The Sharp IR sensors will be used as proximity detectors. Their default range is 24 cm, but they can be configured to a range between 10 and 80 cm.
The Arduino has a nice small size, so it will perfectly fit in my HummBot car. I plan to power it by a 7.2V accu pack that also powers the DC motor of the HummBot. This weekend I will start the first prototyping. To be continued!
Sunday, December 9, 2007
Society of Robots
Today I ran into one of the best robotics forums I have seen so far: Society of Robots.
The forum is visited by a large group of active robot enthousiasts from all around the world. The site also provides a large list of very interesting robotics tutorials. Check it out for yourself!
H1ghlander, the 'real' hummer robot!
In 2005 Carnegie Mellon University reached third place in the DARPA challenge with their h1ghlander robot. The h1ghlander is based on a 1999 Hummer H1, and thus provides a perfect example for my HummBot project!
Saturday, December 8, 2007
HummBot, start your engine!
The HummBot, as I will call the hummer robot, will be controlled by an Arduino board and I will start with a few IR sensors to sense the distance to surrounding obstacles. After that I plan to add more sensors like Ultrasonic sensors, compass module, accelerometer, camera, ... I think I should start saving some money!
Here two pictures of what the HummBot looks like today. This is still the bare tamiya kit. I will first give it some better painting and after that I will start integrating the first electronics. Will be continued!
The Arduino board
- Official Arduino site
- Arduino tutorial
- Electronics tutorial using the Arduino
- The Make blog Arduino overview
The Arduino can be programmed in a C-like programming language. Since the Arduino is open source, all development software is for free! The complete Arduino development environment can be downloaded from the Arduino home page. This environment will give you a great start with 160 MB of tools, tutorials and example code.
Last week I ordered dthe Arduino Diecimila USB board via Robotshop.ca. The price? Only $38,95 which is a little more than 26 euro!
If you're not enthousiastic yet, please have a look at this fun video that introduces the Arduino board:
Friday, December 7, 2007
More Volkwagen robots!
The winning Stanley:
The second prize winning Junior: