![]() |
Forum Index : Microcontroller and PC projects : A busy day for an aircraft controller
Author | Message | ||||
William Leue Guru ![]() Joined: 03/07/2020 Location: United StatesPosts: 405 |
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 StatesPosts: 405 |
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: GermanyPosts: 1593 |
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 StatesPosts: 405 |
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: GermanyPosts: 1593 |
Thanks! ![]() causality ≠ correlation ≠ coincidence |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
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 StatesPosts: 405 |
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 StatesPosts: 405 |
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 KingdomPosts: 10310 |
Do you have a waveshare CMM2? If so you need to install the optional oscillator |
||||
William Leue Guru ![]() Joined: 03/07/2020 Location: United StatesPosts: 405 |
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 KingdomPosts: 10310 |
Do they all give the problem? Do they use the oscillator or a crystal? |
||||
vegipete![]() Guru ![]() Joined: 29/01/2013 Location: CanadaPosts: 1132 |
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 StatesPosts: 405 |
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 |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |