Friday 17 June 2011

Course is finished

Today we had a final lecture and, thus, finalised the course. As a final video we would like to post a video of real-time mission on Mars with temperature measurement and duck dropping on real lake.
After 8 weeks of intensive work we obtained following skills and knowledge:

-design and implementation of embedded motion systems;
-experience of working with actuators, sensors, encoders and processors in BrickOS environment;
-skills in C programming such as multitasking, synchronization and communication;
-working in team;
-time-management and planning;
-application of theoretical knowledge on practice;
-problem solving in real-time environment;
-independent learning with limited supervision;
-various examples from specialists who have experience of industrial embedded software design.

Last but not least. It was funny 8 weeks. We really enjoyed working in team when everyone tried to contribute as much as possible depending on his skills. Despite the fact that we didn't win the competition we acquired very important experience which will be definitely used during our future career. I think it is the most important of University education.

Thursday 16 June 2011

Mars mission: final presentation

Today we had a final presentation on the course. 8 weeks of hard work were summarized in 5 minutes for each group.

Overall, there was no team which could find all three lakes. We found and measured one lake. Other team measured temperature twice but on the same lake. The winner team measured temperature on two lakes.

Next step is peer evaluation. Tomorrow we are going to have a lecture by guest lecturer from Mathworks.

Wednesday 15 June 2011

Mars mission: day before presentation

Here it is. The Day X is coming. Everyone is in rush and tries to polish their programme so that it will succeed.

Therefore lab was very crowded for last two days. It was very difficult to find a place to put laptop and rover itself. The Mars Landscape, camera and Earth computer were also intensively used by all groups. We used them also. Namely we made final preparations such as follows.

1) Found best light conditions when rover finds lakes using camera.
2) Determined best initial position for Mars mission
3) Solved problem of stucking at the space between edge and lake. We changed angle of steering and added reverse movement so that rover will not get lost between edge and lake
4) Finalised threshold values for light sensors in order to distinguish lake and edge.
5) Adjusted length of thread for temperature motor

All these preparations were done yesterday in the evening and today in the early morning when we reserved time slots. Also we had a meeting with Jos where he gave us final advice and wished good luck.

Looking forward to final presentation of other groups as well.

Tuesday 14 June 2011

Temperature measurement and duck dropping

After experiments and adjustments which were partially explained in previous posts we made temperature measurement together with duck dropping. Here is the video.

Temperature sensor calibration.

For measuring temperature we need to familiarize ourselves with principles of sensor's work. We used approach of trial and error mixed with least-squares method.

We measured the temperature of various media such as environment air, cold water, hot water, human body and so on. We created a script that puts the measured values on the LCD of the brick.

We found out that values are measured and displayed in hexadecimal format. Therefore we had to use conversion of datatypes.

Next, we needed to calibrate sensor. The value obtained by sensor and values measured by thermometer was compared and put on to x-y graph. Then we made an assumption that function is linear. So the function should look like alpha+beta*sensor_value. So the task is to find alpha and beta. After some trial and errors we found out that formula is 113.78-0.002457*SENSOR_3

Mars mission: integration

For Mars mission we basically have three modules. They are lake finding using camera, cliff avoiding using light sensors, temperature measurement using probe. All these three modules were developed and need to be integrated.

Here we faced several problems such as:

-Using of brick's sensor slots. Now we splitted sensors based on light/encoder principle. It means that all three light sensors are now connected to the first brick whereas all encoders and temperature sensor was connected to the second one. It forced us to change our separate programme modules during integration.

-Temperature sensor sometimes is put by mistake onto cliff. Once rover goes back this sensor stucks and causes problem to movement. We needed to change probe putting mechanism and make measurement software to avoid measuring temperature at wrong places.

-Edge detection sometimes conflicts with lake finding modules. It causes problems with performance and rover stucks on one place or tries to reach the lake ignoring obstacle on this way. We solved this problem by changing priorities of threads.

Next, we need to test integration part in the lab using real environment instead of simulation lakes, edges and using fictitious coordinates from camera.

Mars mission: relevant hardware changes

After facing communication problems and some problems with integration we decided to change hardware configuration slightly.

First of all, we mentioned about communication problem in our last post. Solution of this problem is to direct both bricks to the ceiling or to to the tower on the top of setup. Here it is depicted on the foto

Next we mounted a frame for camera so that it will not make rover unstable and will not interfere rotational part of front wheel.

Also there was a problem with temperature probe. It was not long and deep enough. So we changed the probe putting arm. Now on cruise regime it is short and does not touch floor. On the measurement regime it goes downwards on required depth and allows to measure temperature of deep lake.
As it is seen, we also added battery for additional weight and Duck dropping mechanism.

Sunday 12 June 2011

Mars mission: first problems with communication

After completing line-tracking assignment we are now more focused on Mars mission. Technically speaking, we started this mission earlier and worked in parallel. Experience and code which we obtained during line-tracking was partially recycled during Mars mission. For example, tape detection routine is used now as cliff avoiding routine.

However, here we got some problems with Mars mission. They are linked to communication between bricks and Earth computer.

We found that communication is very unreliable and we searched for the reasons first we found that the orientation of the RCX is a key factor. The best orientation is when the RCX is pointing to the ceiling and therefore sends the signals directly to the receiver or reflects the signals over the ceiling to the receiver.The other key factor, is the communication error that happens at the earth computer when the 2 RCXs send at the same time. As a result we changed the configuration of the 2 RCXs so that only the master RCX can send continuously a request to the earth computer for the coordinates and the slave RCX only sends the temperature whenever the master requests. We still can see another problem that when the slave RCX sends the temperature, the earth computer doesn't receive again from the master RCX and we lose communication again. We are now trying to check some points to solve this problem otherwise, as an ultimate solution, we could put the temperature sensor on the master brick and sacrifice the center light sensor.

All these problems and others are solvable. We need to make more tests and adjust both hardware and software so that they will lead to successful mission.

Friday 10 June 2011

Line tracking: presentation and results

Today we  had a presentation of line-tracking. The presentation itself can be found by following link:
Presentation.pdf

As for questions, jury asked mostly about hardware and team management. For example:
-How did you divide your responsibilities among colleagues?
-Why didn't you choose tank-based chassis?
-Why did you use wires when connected encoders to the chassis?
-How did you calibrate your encoder?

The second part was unsuccessful. On the one hand, rover didn't stuck and make a beep sound. On the other hand it suddenly stopped at the middle of the tape and consequently measured only part of the tape length. Thus, crate of beer went to group five.

Later, we repeated experiment and it worked perfectly. This lesson showed as that we cannot 100% be sure that we solved all possible problems and could predict all of them.

Thursday 9 June 2011

Line tracking: last minute preparation

Here it is. The day of line-tracking is coming. Being in hurry trying to improve as much as possible we did some last-minute preparation.

The main problems were as follows:
-Absence of robustness: if tape has breaks or scratches line-tracking failed
-Measurement error: it was about 3%
-Problem with sound: it sometimes didn't work at all
-Continuing movement after tape finishes.
-Presentation was not self-explanatory enough

Experiments until late night; blood and sweat at the lab... Finally, we fixed problems and created very nice presentation. Video of two various cases is shown below.

Monday 6 June 2011

Line-tracking: length measurement and sound making

After successful implementation steering and light sensor processing part we started other two parts of this assignment. We tested length measurement and created programme for making sound.

We used information on rotation encoder in order to measure length. We measured length of actual tape and received number of revolutions of encoder. Then using these data we made calibration f sensors and added necessary calculations to the software. Measured length will be displayed on LCD of brick. As a result we achieved measurement with relative error of about 3%.

Also we added sound signal. Now when rover detects the start of the tape it will beep.

Plan adjusting

We updated initial plan. Now when line-tracking is almost finished our main priority is final contest. Taking into account that there are only a few slots in camera using schedule our plan depends on this schedule. Main changes are as follows:

-available camera hours will be used with maximum efficiency;
-since TU/e is closed on week-ends we are going to have additional outside session at Serhat's house
-main attention will be given to integration of three subtasks: edge detection, lake detection and temperature measurement;
-presentations on both assignments will be discussed by us and Jos


Camera tests: results and problems

Today we made our initial experiments using camera in DCT lab. The result is as follows.

-We found optimal view angle and height of mount frame;
-We chose optimal light conditions so that lakes are identified without noise;
-We defined that communication with camera is not reliable so we need to slightly change software part in order to make it more robust to communication loss

Sunday 5 June 2011

Line-tracking preparation and edge avoidance for Lake-finding

After some tests Line-tracking code was furthermore improved. Now its movement is smoother and more precise


Also we started edge avoiding routine. This routine will work in parallel with lake detection and will help rover to avoid falling down from Mars surface. It is based on detection of different value of light reflection on the edge. If left light sensor detects edge then rover stops and front wheel rotates to the right direction on 90 degrees angle. For right light sensor detection it is vice versa. Separately we will add routine for avoiding plateau using central sensor. The programme is not ideal and on the sharp edges when both sensor detect edge it still needs to be improved.

New library - SSSRLibrary.h

After some additional experiments we decided to create new library. In this library we added all created by us and verified functions which will be useful during Line-tracking and Lake finding assignments. We called it SSSRLibrary  =)

It consists of following functions:


void move(float speedfrac){}
void stopDriving(){}
void stopSteering(){}
void steer(int angle){}
int isObstacle(int sensor, int reference){}