dinsdag 31 mei 2011

Threads and communication

In this test both bricks are used. We wanted to gain more insight in the situation where multiple threads are running at the same time and the brick has to communicate. The tasks are divided over the 2 bricks as follows.
* Brick 1:
   - Thread  for cliff detection and avoiding them (for now only the right light sensor)
   - Thread for stopping at a lake (middle light sensor)
   - Communication with brick 2
* Brick 2:
   - Performing an experiment after receiving data from brick 1 that the rover is at a lake.
This way multiple tasks are integrated and tested. Unfortunately we couldn't test the program at the Mars setup, so we had to perform this test at the edge of the table. When the right light sensor measures the edge its a cliff and when the middle light sensor measures the edge its a lake. As can be seen, the program works well.
Later on the sensors and actuators are divided differently over the 2 bricks, but for now we wanted to understand this type of situation.

maandag 30 mei 2011

Lake driving and measuring, Line-following almost completed

Today we did some work on driving to a lake when coordinates are received and positioning in front of it. This code is not fully operational yet, but we are still working on it.

Furthermore, the part of the code that measures the temperature of the lake is completed. When the middle sensor detects a lake, the temperature sensor is lowered into the lake and the temperature is measured and sent to the earth computer. This can be seen in the movie below:


Also, we have almost finished the line-following code. Besides testing in the actual room where the line following is held and making some minor changes to the code when needed, we have completed the code to everyone's satisfaction.

vrijdag 27 mei 2011

Line-tracking progress

Today the line-tracking programm is updated again. The controller is replaced by a PD controller. After callibration, the error in the program gets scaled according to the calibrated values so that the PD controller doesn't have to be tuned again for every new condition.
The program is also made more robust for cracks and deviations in the line. Another addition is that with the same program, it can follow dark lines on light surfaces or vice versa!
Tracking a black line on the table surface:
 

 Tracking a light line (the table) on a dark surface. Note that it starts on a piece of tape and thus sees this tape as the surface and the table as a line:

dinsdag 24 mei 2011

Temperature and Threads

Today we have calibrated the temperature sensor's raw values to actual degrees in Celsius. We have also managed to send the temperature to the Earth computer.

Furthermore we have experimented a bit with the use of threads. Threads are going to be very important in making the MER doing the tasks he has to perform.

We have also worked on the code to make the MER drive to a lake when the coordinates are known.

More on all this later...

maandag 23 mei 2011

Roaming on Mars with Edge and lake avoiding


Today the Rover had his first roaming on Mars with edge detection and lake avoiding turned on. The video below gives a nice impression of the roaming, it even can get out of a lake.


When looking at the image processing and lake detection, the lake detection (due to image processing) is not working as desired. Sometimes the lake detection is very poor and even when the Rover almost stands in front of it, the lake is not detected.
The strategy to use the vision and the received coordinates as real time input for driving to the lake is likely to fail. We now must think about another idea for this task.

Sometimes a lot of lakes are found as shown below :)

vrijdag 20 mei 2011

Robust line tracking

Now the line tracking algorithm is made more robust and complete as can be seen in the video below.
After the calibration, the Rover first searches the tape, when it has found some tape it stops, makes a sound and then start driving. After the tape stops, it again makes a sound and then displays the length of the line (in mm) on the lcd-screen.
The controller still needs some tuning for a smoother tracking, but it is already a little bit robust for line cracks and other variations.
The main goal now is to tune the controller correctly and also let it work for different tapes and surfaces (for example a black surface and white tape).

woensdag 18 mei 2011

Building of the four wheeled Mars Rover

The building of the four-wheeled Mars Rover seems finished for now on; It now can also hold the two RCX bricks and the camera. A picture is displayed below:

After some tweaking the camera is positioned in such a way that it can detect lakes up to close and from a nice distance. Also a picture of the detection of a lake is given below. The lake is coloured purple in the lake detection program.

Contact with the Earth Computer

Today we have established our first contact with the Earth Computer from Mars.
The coordinates of the lakes are transferred and displayed at the screen of the brick.
When the brick asks for coordinates, it displays 'ask'. It displays 'coor' when coordinate are rechieved and then it first prints the 'i' coordinate and then the 'j' coordinate.
This directly gives us a good insight in the use of different tasks and the parallel use of it.

dinsdag 17 mei 2011

Distance measurement while tracking a line

Tracking a line has advanced to the next stage, as the distance travelled can be measured in mm.

A movie of line tracking with distance measuring is given below, where first the light sensor is calibrated to the environment and the line (crack in this case) followed by the MER following the line (with untuned PID-control) for a couple of loop-iterations until it stops and writes the travelled distance to the LCD display of the Lego brick. It has travelled 613 mm in this case.


The MER transmission is adapted to a pleasing cruising speed when following a line, as well as a nice gear ratio for the rotation sensors. The transfer ratio from the wheels to the encoder is 50/3, while the circumference of the wheel is (about) 257.6 mm. This results in a resolution of around the 1 mm/encoder count  (0.966 mm/count to be precise).
In this way, the distance travelled can be given to a millimeter, as is required in the line tracking competition.

In the movie above, we used two motors, one light sensor and one encoder.
At this moment, we are planning to use only one Lego brick for the line tracking competition. In this way, we make everything as simple as possible, but not simpler.
We are programming to use two motors to drive the wheels, two light sensors and one encoder to do the job. One light sensor should take care of the straight line PID tracking, while the other one (in combination with the first) should detect the beginning, ending and possible interuptions of the line without problems. The encoder is used to measure the length of the line to a millimeter.

maandag 16 mei 2011

First Line-tracking 'steps'

Our Rover has tracked his first line, using a PID controller. This controller will be made more robust in the future and the measuring of the distance of the line will be implemented also.


IR Communication between RCX bricks

Today we established the first IR communication between the two RCX bricks (also using threads in the C-code).
In the video below, the left brick sends an integer (and displays it on the screen) and then adds 10 to it, the right brick receives the integer and also displays it on the lcd screen.

woensdag 11 mei 2011

Testing of the four-wheeled MER

Today building the four-wheeled MER advanced even more and we tested it's capabilities.
Using a test-program, the MER drives straight until it discovers an edge and then lowers and raises the temperature sensor. After this, the MER drives backwards and continues in another direction.
In the video this test can be seen.

maandag 9 mei 2011

The building of the four-wheeled MER has started

The building of the four-wheeled MER already has started and the temporal result is visualized below:


Now 2 separate motors are used to drive two wheels on each side to make steering easy and fast. The tires are removed from the other (passive) wheels to keep friction to a minimum. Note that after a better inspection, the Mars surface is more even as thought, so a three-wheel design with a caster wheel also seems to be a very good choice. However, this four-wheel design will be used for the moment and when the achieved results in the future are not what we expected, it is easy to change the design without changing the c-code much.
The 'big' wheels are chosen, so a high speed can be achieved. When a lower speed and higher accuracy is demanded, it is possible to reduce the gearbox ratio or even to reduce the wheeldiameter.
The final design will also have a center of gravitiy very close to the two active wheels and not at the passive wheels to keep the friction while steering relatively low.

Component Diagram

Our first concept Component Diagram that can be used with the four wheeled robot is depicted below.
In the diagram different functions that are nedeed are visible and furthermore clearly the division of the sensors and actuators over the blocks are shown. The main idea behind this division is the idea of 'Measurements and driving can be handled separately from eachother'.
Thus the most important sensors (light sensors left + right to detect a cliff) and the most important actuators (motors left + right to move and steer) are used on one RCX block to prevent damage and stay controllable. The other (less important) measurement 'equipment' are used on a different RCX block.

Building-plan MER

This building-plan gives a quick overview of the possible solutions to build the Mars Exploration
Rover (MER). The solution that seems most suited to complete the line-tracking and mars mission is made clear.

Possible issues for the MER are:
Center of gravity for grip and stability: as low as possible
Speed: small, light robot but it is easier to miss goals
Wheels: big wheels will result in more speed, but less power
Wheelbase: wide as possible to have stable robot and good straight line tracking/driving
Turning-circle: small to easily turn on the limited space available

Chassis design
A number of chassis designs are possible, each with its advantages and disadvantages. A
couple of properties are given below:

Three wheels
two-wheeled robot with caster wheel
each wheel driven by separate motor
advantages: small turning-circle, turning easy to program, easy to build
disadvantages: have to look at center of gravity with building, can be a bit unstable (especially at uneven surfaces)

Four wheels
four-wheeled robot, two wheels driven by separate motor, two wheels passive (can
also be four, with four motors)
advantages: small turning-circle, turning easy to program, stable without problems
center of gravity
disadvantages: skidding of passive wheels: lot of resistance. Possible solution: no tires on skidding wheels for less resistance

Six wheels
six-wheeled robot, two wheels driven by separate motor (center), two wheels steering,
two wheels passive (current design)
advantages: stable, good for hill-climbing and rough surfaces
disadvantages: large turning-circle, turning difficult to program, difficult to build, resistance with steering, straight line driving difficult

Tracked robot
rubber tracks, four (or six) wheels
advantages: stable, low center of gravity, good on uneven surfaces and obstacles, can be capable of driving over a lake
disadvantages: hard time traveling straight line, hop on smooth surface, rubber tension can be difficult (possible solution is to use a wheel in the middle for extra tension), a lot of friction

Steering
There are two possible ways of steering the MER

• Differential steering: compare with a wheelchair, so using two separate driven wheels
with different speeds/powers to steer; fast steering with small turning-circle

• Dual-wheel pivot steering drive system (current design): difficult steering mechanism,
need to calculate angles (with its deviations), furthermore you have to steer and steer
straight again; slow steering with large turning-circle.

Line tracking/Mars mission
For the line tracking we want a good straight-line tracking robot, with good steering properties
and reaction time. Furthermore we need to predict the length of the line as accurate as possible
(this means to zig-zag as less as possible). It is possible to use one light sensor (control on
the ’grey’ area between the line and environment colour), two light sensors (need to know the
width of the line) or three light sensors (same as two light sensors). I assume that the width
of the line is not known on beforehand, so we need to use one light sensor for the line tracking (and maybe one other to detect if the line starts/ends)

The best choice(s) for line-tracking in our opinion is (are):
• Best chassis: Robot with tree wheels (two wheels, separately driven, with a caster wheel).
A four wheel robot can also be a good choice but as the surface will be even a three-wheeled
robot will can be controlled most accurate
• Best steering: differential steering (wheelchair)
• Positioning light sensor: for following straight line, it is best to place it close to the pivot
point (less zig-zag behaviour). For following arcs it is best to place it far ahead of the
pivot point (current design).
• Check distance traveled: measure circumference of tire + rotation sensor(s)

For the mars mission the current design (six wheels) is not the optimal one. As the surface is
relatively even and pretty compact, a small turning-circle is wanted.
The three-wheeled robot can give stability issues, as the mars surface is not
entirely even. The best choice seems to be the four-wheeled robot. As the mars surface
is pretty rough, we need to check if the resistance with steering is not too big. Differential
steering seems to be the best choice in the small space that is available.

Design choice
As we don’t want to change the chassis for the line-tracking and mars mission, the best choice seems to be the four wheeled robot (two wheels driven by separate motor, two wheels passive). We are going to start building a light,stiff robot with a smart and low center of gravity, using smart and stiff suspensions with little friction and hysteresis to be able to drive straight lines when wanted. Design principle knowledge will be used here.
The light sensors can/will be positioned differently for the line-tracking competition and the mars mission, so they should be easy to (un)mount. We can change the transmission (gear ratio) when more speed (less accuracy!) is wanted.

If the four-wheeled design appears to have too many drawbacks/disadvantages in a later stadium, we can always change the design to a three-wheeled robot or even a tracked robot fairly easy.

Requirements, use case diagram and activity diagram

The requirements, use case diagram and activity diagram for now are given below.

REQUIREMENTS

Most general requirements
·         Detect craters/cliffs                                      M
·         Detect lakes                                                  M
·         Don’t fall into a crater/from a cliff               M
·         Drive to a lake                                               M
·    Position in front of lake                                 M
·         Measure temperature                                   M
·         Don’t fall into a lake                                     S
·         Find all lakes                                                 S

User interaction
·         Display the temperature/Send it to PC         M
·         Victory sound                                                W

Statistics
·         Store the outcomes of the experiment          S
·         Don’t measure a lake twice                          C

Flexibility
·         No area specified (# craters, their positions,..)                         S
·         Fast driving                                                                                W
·         Fast detection of lakes                                                              W
·         Don’t lose a lake from sight                                                       S

USE CASE DIAGRAM
This is the first concept Use Case Diagram

ACTIVITY DIAGRAM
This is the first concept Activity Diagram



dinsdag 3 mei 2011

Safe driving

Since we were able to read out the light sensors and actuate the motors, we let te mars rover drive on the table and stop when one of the light sensors detects an edge.
On start the display shows: "OK!" and when it detects an edge, it displays "break".

Straight approach:

Alternate approach:


Sensor reading

Today the light sensors and encoders are read out with some simple programs.

In the following video the light sensor is used to 'find' the edge of the table.


maandag 2 mei 2011

First test with the RCX module

On the first day we already tested the RCX module.
With some simple testing code we tried out all the motors on the mars rover.
Results are shown in the following videos.

Mission on Mars

Today we started the mission on Mars.
The engineers working on this mission are:

Arjo Bos
Jordan Bos
Ferry Schoenmakers
Laszlo Ruijter