Thursday, 11 September 2008

Embedded systems week 2

Date: 11-9-2008

Duration of activity: 3 hours

Group members participating: Peter, Thomas, Rasmus

The Goal of the session...: Playing with sensors. In particular the UltraSonic Sensor.

Experiments...:

SensorTest:
We uploaded the SonicSensorTest program and moved the car around a bit.

Result:
The sensor seemed to measure pretty accurately, but when the distance exceded 2m, the sensor just read 255... It seems that with the simple program, the sensor operates best within a range from 10cm to 180cm. The fact that the readings become unstable around 2m would indicate that if the microphone does not hear the ping within 5ms it just reads 255. ((340,29 m/s )/ 1000 ms/s) = 0,34 m/ms; 5 ms *0,34 m/ms = 1,8m (approx)). This might be because the sound loses speed from being reflected. One might investigate this manually, by setting the sensor in ping mode, and printing the time betwen the ping and the echo (We tried doing this, but it seems that the hardware can't keep up). The measurements in the graph below were made on the floor, which seems to have had a detrimental effect on the range (echoes of the floor most probably).







TrackerBeam:
Playing around with the Tracker program.

Behaviour:
The car drives forward, until it senses an obstacle, at which point it will reverse, until it senses that the obstacle is no longer in the way. Sometimes it got stuck going back and forth at the edge of the allowed distance and it banged into a wall because the angle was too steep, so it didn't sense the obstacle. We fiddled with the constants a bit, but we mostly made the car unstable and choppy in the stops.

This type of controller is called a closed-loop-controller (Wikipedia: "A closed-loop controller uses feedback to control states or outputs of a dynamical system. Its name comes from the information path in the system: process inputs (e.g. voltage applied to an electric motor) have an effect on the process outputs (e.g. velocity or torque of the motor), which is measured with sensors and processed by the controller; the result (the control signal) is used as input to the process, closing the loop.").

WallFollower:
Sadly we didn't have time to try out the wallfollower. We looked over the code and tried to find out what it was doing, but we didn't have the time to translate it into java...

No comments: