Thread: Tcas

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    932

    Tcas

    I was wondering how a 'Traffic collision avoidance system' software could have been coded.

    How could the two communicating software decide which one of them will be the "master" to give the order about climbing or descending of the planes?
    Using Windows 10 with Code Blocks and MingW.

  2. #2
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,694
    Since my father was an avionics technician and now an EASA instructor, I think I can confidently say to you, that this software is not something simple and small. Moreover, people of this forum can guess, except if someone has really coded dsmething related.

    Since I am a member of the forum, I can guess.

    Assume we have a Jumbo at FL 320 and two air towers. The sky is divided in regions. I guess every air tower is a master of his own region. So, depending on which region the aircraft lies in, the master air tower is specified automatically.

    One could ask why I do not ask me father. He is on a business trip in Qatar right now..
    Last edited by std10093; 09-05-2013 at 10:06 AM.
    Code - functions and small libraries I use


    It’s 2014 and I still use printf() for debugging.


    "Programs must be written for people to read, and only incidentally for machines to execute. " —Harold Abelson

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    932
    Thanks for your answer, very interesting.

    Actually I think towers are controlling the planes as long as they are in reach of them and there is no problem. But when two airplanes are on a collision course because of some kind of error the two TCAS should decide without the tower and even more so when the planes are out of reach of the towers. I think that since the Bashkirian Airlines Flight 2937 - DHL Flight 611 accident TCAS takes precedence over the tower.

    The same problem could be found probably elsewhere also, not only in aviation, that is why its an interesting question for programmers.
    Last edited by Ducky; 09-05-2013 at 10:52 AM.
    Using Windows 10 with Code Blocks and MingW.

  4. #4
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    TCAS is not tower based. It's onboard the planes and the systems communicate directly with each other.


    Suppose you and I had a piece of software communicating over the internet, analogously to TCAS between two planes. We need to ensure that if the word "CLIMB" appears on my screen, the word "DESCEND" appears on yours. Consider how you would do that.


    One simple idea: Since each plane has a unique identifier, the protocol could simply choose the system with the higher value to decide who does what, preferably either randomly (to be fair) or taking some other factors into account. Presumably the "climber" is expending more fuel than the "descender". I don't know if that's an issue or not.
    The cost of software maintenance increases with the square of the programmer's creativity. - Robert D. Bliss

  5. #5
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,694
    As a matter of fact, Canada guy is correct. Father just called.

    Every aircraft has its own TCAS and it makes some very intense calculations. Wonderful software my father notes.
    Every aircraft has an id (you see it near the tail).
    There is an international "thing" that registers all the id's (in octal and hexadecimal). I can't remember the name. So every plane is registered there, just like people register when they are born.
    The older one is the master.
    Code - functions and small libraries I use


    It’s 2014 and I still use printf() for debugging.


    "Programs must be written for people to read, and only incidentally for machines to execute. " —Harold Abelson

  6. #6
    Registered User
    Join Date
    Dec 2007
    Posts
    932
    Yep, IDs, that sounds pretty simple. You don't even need master in that case.

    In the case of two computers it could take the MAC number.

    Thanks for your Dad btw!
    Last edited by Ducky; 09-05-2013 at 11:53 AM.
    Using Windows 10 with Code Blocks and MingW.

  7. #7
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,817
    All aircraft rated above a certain maximum take-off weight or passenger capacity are required by ICAO (International Civial Aviation Organization) to have a TCAS system installed. Each aircraft with a transponder will continuously interrogate all other nearby aircraft by sending out a signal at 1030 MHz. Each interrogated aircraft equipped with a properly configured transponder will receive/decode and respond with its own signal at 1090 MHz.

    Based on round-trip time from sending of signal to reception of signal, range can be determined between aircraft; an aircraft responds with its own altitude in the transponder signal; bearing can be determined based on the signal as received by the antenna. From all this the interrogator aircraft can determine if a threat of collision exists between it and the interrogated aircraft based on when certain thresholds are crossed and what steps to take to avoid such a collision. Alerts are reported to the aircrew via cockpit displays and voice messages.

    Have you read the wikipedia page on this?
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  8. #8
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    I just read the wikipedia page but it does not answer the original question as to how it's determined who climbs and who descends.
    The cost of software maintenance increases with the square of the programmer's creativity. - Robert D. Bliss

  9. #9
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    @hk_mp5kpwd: Either you're an aviation protocol expert, or this xkcd comic is extremely true.

  10. #10
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,694
    Quote Originally Posted by Ducky View Post
    Yep, IDs, that sounds pretty simple. You don't even need master in that case.
    I do not know. But if there wasn't a need for a master, then why would they have define one?
    Quote Originally Posted by Ducky View Post
    Thanks for your Dad btw!
    He is always happy˛ in answering technical questions on aircraft. He loves his job.

    Quote Originally Posted by hk_mp5kpdw View Post
    ICAO (International Civial Aviation Organization)
    That's exactly the "thing" I was referring to above.

    Quote Originally Posted by hk_mp5kpdw View Post
    Based..messages.
    I am pretty sure˛ that this not the actual case. I mean it may be the main idea, but TCAS system makes so perfect calculations, you won't even imagine! I am pretty sure˛ that you can not find this in the internet. For sure not in wikipedia.
    Code - functions and small libraries I use


    It’s 2014 and I still use printf() for debugging.


    "Programs must be written for people to read, and only incidentally for machines to execute. " —Harold Abelson

  11. #11
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,817
    ICAO document Airborne Collision Avoidance System (ACAS) Manual describes technical and operational issues relating to ACAS (Airborne Collision Avoidance System) of which TCAS is one form. It's a 203 page document. Page 52 (section 3-32) is the beginning of the "COLLISION AVOIDANCE ALGORITHMS" which may or may not describe how such matters are handled.

    There is something called Annex 10 Volume IV "Surveillance and Collision Avoidance Systems" that explains some of the same as the above and you might be able to find it on the ICAO website. I was going to add it as an attachment but it is too big (280 some pages).

    Quote Originally Posted by Matticus
    @hk_mp5kpwd: Either you're an aviation protocol expert, or this xkcd comic is extremely true.
    I work at a certain agency responsible for airplanes and have access to resources (people and technical documentation). I am not an expert in these systems (just a programmer/Oracle database guy) but do support an office responsible for dealing with the engineering/technical/operational aspects of such systems.

    A guru in our office on this topic sits two seats behind me and I briefly asked him about TCAS. He started talking about RTCA (Radio Technical Commission for Aeronautics) "document number so and so" and "annex this" and "volume that" and my eyes started to glaze over. The public has to pay for some of the RTCA documents but I think the ICAO site allows the public to just download most stuff if you know where to look. Our office supposedly has its own copies of any relevant documentation but I've never looked through any of it.

    He also explained that the system does work in a master/slave relationship although those might not be the technical terms. At some point the maneuvers being undertaken between the craft must be coordinated and one of the aircraft must therefore take over as lead.
    Last edited by hk_mp5kpdw; 09-05-2013 at 01:58 PM.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  12. #12
    Registered User
    Join Date
    Dec 2007
    Posts
    932
    Quote Originally Posted by std10093 View Post
    I do not know. But if there wasn't a need for a master, then why would they have define one?
    Dunno, just trying to find some logic.

    The biggest ID number could be the master and decide based on the weight of the planes who climbes and who descends. The heavier plane would always descend because the lighter plane could climb faster or some similar system.
    Last edited by Ducky; 09-05-2013 at 02:01 PM.
    Using Windows 10 with Code Blocks and MingW.

  13. #13
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    TCAS is not a cooperative system. It uses an adversarial search strategy, and makes the assumption that the other aircraft are actively attempting to collide with it. It therefore makes avoidance choices which are optimal even under worst-case conditions.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  14. #14
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,694
    @hw5, I did not that that they had the man for public!

    @Ducky, the master is determined by which aircraft is older and that's all. (as you know, we should respect the older people :P )
    Code - functions and small libraries I use


    It’s 2014 and I still use printf() for debugging.


    "Programs must be written for people to read, and only incidentally for machines to execute. " —Harold Abelson

  15. #15
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    Quote Originally Posted by brewbuck View Post
    TCAS is not a cooperative system. It uses an adversarial search strategy, and makes the assumption that the other aircraft are actively attempting to collide with it. It therefore makes avoidance choices which are optimal even under worst-case conditions.
    Do you have a source for that? Although it's not always the case that both aircraft are equipped with the system, when they are both equipped they apparently cooperate:

    3.10.1.3: Pairwise coordination with each equipped threat is necessary to establish which aircraft is to pass above the other and thus guarantee avoidance manoeuvres that are compatible.

    And it looks like I had the right (though not exact) idea with respect to the id codes:

    3.10.10.4.2 When an ACAS-equipped threat aircraft detects [your] aircraft as a threat, the threat aircraft goes through a comparable process. If for any reason the two aircraft select the same (incompatible) separation sense, the aircraft with the higher 24-bit aircraft address reverses its sense.

    (quotes are from hk_mp5kpdw's link in post #11. I replaced the word "own" with "your" because "own" sounds weird, but they use it to refer to your aircraft. And the word "sense" basically refers to climbing or descending.)

    So they independently decide what to do and send their decision to each other. If they are in conflict, the "younger" (to use std10093's terminology) aircraft reverses its decision.
    Last edited by oogabooga; 09-05-2013 at 04:31 PM.
    The cost of software maintenance increases with the square of the programmer's creativity. - Robert D. Bliss

Popular pages Recent additions subscribe to a feed