Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:57 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : A busy day for an aircraft controller

Author Message
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
Posted: 07:59pm 15 Jan 2021
Copy link to clipboard 
Print this post

I have been in a goofy mood and came up with this little program. It sort-of simulates an old analog radar display along with a table of ranges and bearings for each target. All the target info is randomly generated and will keep going forever, or until you get bored. A README file has more details.




Enjoy!
-Bill


Radar.zip
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
Posted: 08:03pm 15 Jan 2021
Copy link to clipboard 
Print this post

I should mention that this program brings out some bad CMM2 behavior. I use page blitting from 1 to 0 (with sync) to avoid flicker. But I think that the blit is taking too much time, so the screen jitters at times and sometimes just blanks out for a second or two.

-Bill
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1593
Posted: 09:34pm 15 Jan 2021
Copy link to clipboard 
Print this post

  William Leue said  ... All the target info is randomly generated and will keep going forever, or until you get bored.
...

Hmmm, your picture looks interesting.

An idea:
Maybe you (or someone?) can add a cheap servo and ultrasonic module to get real data for a 120* "SODAR"?



Regards
Michael

* = degrees (the boardsoft prohibits the degree symbol)  
causality ≠ correlation ≠ coincidence
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
Posted: 09:46pm 15 Jan 2021
Copy link to clipboard 
Print this post

Feel free to grab the code and use it for anything you want. I think I am done with it for now.

-Bill
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1593
Posted: 09:58pm 15 Jan 2021
Copy link to clipboard 
Print this post

Thanks!
causality ≠ correlation ≠ coincidence
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 12:39am 16 Jan 2021
Copy link to clipboard 
Print this post

I have had it running for about 30 minutes here and haven't seen any signs of display breakup.
You could try a PAUSE 20 after the PAGE COPY command.
That will make sure that the PAGE COPY finishes before you do any writing for the next screen.
I have found that a PAUSE helps in some situations.

As far as the program goes, I do have a source of genuine data here so I might add that to the code and see it for real.

I live in a quite area and there are only 4 aircraft within 100nm at the moment.
Even with a small number of aircraft, there is a lot of data to process.
This is one second:
MSG,3,111,11111,7C6C9B,111111,2021/01/16,11:30:52.011,2021/01/16,11:30:51.978,,36950,,,-39.87427,148.04425,,,,,,0
MSG,3,111,11111,7C1AE8,111111,2021/01/16,11:30:52.206,2021/01/16,11:30:52.175,,5200,,,-40.25735,146.00662,,,,,,0
MSG,6,111,11111,7C6C9B,111111,2021/01/16,11:30:52.307,2021/01/16,11:30:52.302,,,,,,,,1461,0,0,0,0
MSG,6,111,11111,7C6C9B,111111,2021/01/16,11:30:52.308,2021/01/16,11:30:52.302,,,,,,,,1461,0,0,0,0
MSG,5,111,11111,7C14B8,111111,2021/01/16,11:30:52.377,2021/01/16,11:30:52.368,,8300,,,,,,,0,,0,0
MSG,4,111,11111,7C1AE8,111111,2021/01/16,11:30:52.457,2021/01/16,11:30:52.435,,,138,158,,,0,,,,,0
MSG,3,111,11111,7C6C9B,111111,2021/01/16,11:30:52.592,2021/01/16,11:30:52.567,,36950,,,-39.87282,148.04471,,,,,,0
MSG,8,111,11111,7C6C9B,111111,2021/01/16,11:30:52.761,2021/01/16,11:30:52.760,,,,,,,,,,,,0
MSG,4,111,11111,7C6C9B,111111,2021/01/16,11:30:52.982,2021/01/16,11:30:52.960,,,505,12,,,0,,,,,0


Jim
VK7JH
MMedit
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
Posted: 01:53am 16 Jan 2021
Copy link to clipboard 
Print this post

Interesting, Jim! And thanks for the suggestion about adding a delay; I am gonna try that right away and will post an update if it helps.

I thought about trying to make this a sort of game, where you have to actively route airplanes to avoid collisions, etc. but I am working on several other projects so putting this one aside except for maintenance.

-Bill
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
Posted: 06:54pm 16 Jan 2021
Copy link to clipboard 
Print this post

Here is version 1.1 of the ATC radar simulation.

Notes:

1. Added a small delay after each page copy. It helps a little with video glitches on my CMM2.
2. Asks the user for the number of targets that should be shown at game start. More targets means a slower sweep around the screen. Users can add targets during the game by pressing the UP arrow, but not delete them.
3. Adds a few command hints on the screen.

-Bill


Radar.zip
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 07:05pm 16 Jan 2021
Copy link to clipboard 
Print this post

  Quote  It helps a little with video glitches on my CMM2.


Do you have a waveshare CMM2? If so you need to install the optional oscillator
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
Posted: 07:48pm 16 Jan 2021
Copy link to clipboard 
Print this post

Nope, I have 3 CMM2 units: 2 from CircuitGizmos (an "original" and his Retro version), and a CMM2 Deluxe from Piotr. All 3 of them have the ARM processor soldered directly to the MOBO.

-Bill
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 08:04pm 16 Jan 2021
Copy link to clipboard 
Print this post

Do they all give the problem? Do they use the oscillator or a crystal?
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 08:35pm 16 Jan 2021
Copy link to clipboard 
Print this post

Fun.

I've been messing with trying to speed it up, with some minor success.

I'm seeing the slight and occasional sync glitch too - 400 MHz Waveshare. I don't think it is due to page copying. I get the impression something has happened to the 16 bit colour mode, but I can't prove it.
Visit Vegipete's *Mite Library for cool programs.
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
Posted: 09:13pm 16 Jan 2021
Copy link to clipboard 
Print this post

Yes I see the glitches on all the models, to one extent or another.

The speed is slow because of several reasons. To really speed it up would require a major rewrite.

The main reasons are:

1. The page clear of Page 1 at the start. This could be eliminated if a lot of other stuff is changed.

2. Because of the page clear, the need to redraw ALL the elements of the screen on each update, which happens every time the sweep moves by 1 degree.

3. Because of trying to simulate the exponential dimming of phosphor on an analogue screen, each of the targets gets redraw on every update. If you eliminate the dimming, then targets only need to be redrawn when their position changes, which is only once per target on each full revolution of the sweep. Of course, you have to eliminate the page clear first.

4. The table at the right is fully redrawn every update. It would be more economical if only the data that changes gets redrawn; basically the text data.

I just threw this together as a hack so I really didn't pay attention to efficiency. Feel free to rip and tear!

-Bill
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025