Comment on 3/2014: trail sensor state machine

Feedback, Anregungen, Kritik, Themenwünsche zur ft:pedia
Feedback, Proposals, Reviews, Themewishes according ft:pedia

Moderator: ft:pedia-Herausgeber

Antworten
vleeuwen
Beiträge: 1560
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Comment on 3/2014: trail sensor state machine

Beitrag von vleeuwen » 29 Sep 2014, 11:33

Hi All,
With great interest I read in 3-2014 the article about the "TrailSensor" state machine.
This also because I publish several years ago a state machine description for the trail sensor.
This for the fischertechnik trail sensor (2 binary sensors) but also including the active/deactive state.

See also: http://web.inter.nl.net/users/Ussel-Int ... Sensor.htm

What I am missing in the article is a detail description of the transitions between the states and what conclusions are related with these transitions.
What to do when a certain state transition arise.
The required action does not depends on the state but on the transition.

In my opinion the names for your states are wrong:
Z0= both sensor on the line,
Z1= left off line, right on line,
Z2= left on line, right off line,
Z3= both off line ( and not "Suche" because Z1 and Z2 also mean "Suche")
For example:
a) when the line has been lost by the transitions Z0 to Z1 and Z1 to Z3: you know that the line is at the right side.
b) when the line has been lost by the transition Z0 to Z3: you know only that the line has been lost.
In case a)
the algorithm for finding back the line is much easier than in case b).
In fact in case b)
you don't have any information about where to look for a line. You can use a search strategy but when you find a line, you never be sure that is the right line.

It is also valuable to take action in case of transition Z0 to Z1 or Z0 to Z2, and try to return directly on the line.
In fact you the state transitions are very useful for event driven programming.

But maybe I am overlook something because of my lack in knowledge of the German language.

Benutzeravatar
Dirk Fox
ft:pedia-Herausgeber
Beiträge: 1833
Registriert: 01 Nov 2010, 00:49
Wohnort: Karlsruhe
Kontaktdaten:

Re: Comment on 3/2014: trail sensor state machine

Beitrag von Dirk Fox » 29 Sep 2014, 20:54

Hi Carel,

thanks for your annotations.
vleeuwen hat geschrieben:What I am missing in the article is a detail description of the transitions between the states and what conclusions are related with these transitions. The required action does not depends on the state but on the transition.
No, the required action depends always on state and transition.
vleeuwen hat geschrieben:a) when the line has been lost by the transitions Z0 to Z1 and Z1 to Z3: you know that the line is at the right side.
This is not true for the general case of a line following challenge: if the line is discontinuous, the transition from Z1 to Z3 can just as well indicate "end of line" or "disruption". In these cases, the line is not located to the right of the robot - because there is no line at all. "Searching" the line means looking around, stepping forward and looking around again - until the robot retrieves the line.

In the (somewhat simpler) case of a continuous line, you can show that Z3 is not necessary - you can simplify your state machine to a three-state diagram and omit Z3.

Regards, Dirk

vleeuwen
Beiträge: 1560
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: Comment on 3/2014: trail sensor state machine

Beitrag von vleeuwen » 30 Sep 2014, 00:48

Hi Dirk,

I disagree with you.
The perspective is a trail follow system. ( A trail discovery system is something difference and much more complex.)
This with the add of a simple 2 binary sensor based trail sensor.

I describe the state machine and the transition belonging to the trail sensor itself.
A transition has a direction and is between two defined states. So the source and destination state are implicit part of the transition description.
The states play a roll when the trail follow system starts/stops, the transitions play an important role when the system is running;
these transitions can be see as a kind of event triggers on which the system needs to react. The objective of the system is to maintain the state "both sensors on the trail".

The next step is to describe the meaning of the 12 transition (or 20 when the state "disable" is also part of the state-machine).
For this we need to have a definition of what a trail is.
A "trail" is a black line with a certain width.
The dimensions of this line are related to the distance between the two binary sensors which are part of the trail sensor.
A trail sensor system has as objective to follow a trail and to stay on that trail. In other words to maintain the state "both sensors on the line".
So transitions with a direction towards the state "both sensors off the trail" needs have as effect that the system starts with actions to arrive in transitions towards the state "both sensors on the trail".

What could we say about the trail:
The line is continuous. Even if the line ends; an end line is it in fact a very sharp turn, a turn of 360 degrees.
The reason for this is that the line has a certain width; it is not a mathematical line which has no width.
Normally speaking, when one sensors falls of the line a the trail sensor system algorithm is trying to bring it back on the line. So the system follows the sharp turn or when it is not able to take a sharp turn, it falls off the line.
Could a simple trail sensor with only 2 binary sensor be able to detect an "end point"? No, this system has not the ability to detect shapes, it has a lack of additional information needed to draw this conclusion.


Besides the states of the "trail sensor" there is also a states of the "trail follow system" itself, the part that implements the algorithms and decide which algorithm needs to be executed:
1) on trail,
2) correcting to get on the trail again,
3) searching because of the complete lost of trail. In fact a trail discovery algorithm. (For this you will need additional information, for example position information of the different trails)
4) not able to find back the trail (this because of lack of information, limitations of the sensor system, etc.).
5) system is in disabled.
There exist a big difference in an algorithm for completely returning on the trail knowing that the trail is at the right or left site and searching for a trail without knowledge were the trail has been situated.

A more interesting point is:
How to change the motor speed in relation with the position of the trail sensor, the position of the wheels and the moment that the trail was (partial) lost.
A nice plane geometry exercise. Certain when you take in account that the trail could be curved.

For detecting a "end off trail" there is a need for additional detecting algorithm, a trail sensor with 4 binary sensors in a square could be very helpful here.
The transition "both on trail" to "both off trail" could also arrive when the speed of changes of the trail sensor is higher than the sample rate; this has to do with the situation that the sensor is almost square to the trail; this can be proved with plane geometry. This could happen in for example a sharp curve when the system turns in the wrong direction.

Antworten