altos: Perform time comparisons using 16-bit arithmetic to handle wrap
[fw/altos] / doc / altosui.inc
1 == AltosUI
2
3         .AltosUI Main Window
4         image::altosui.png[width="4.6in"]
5
6         The AltosUI program provides a graphical user interface for
7         interacting with the Altus Metrum product family. AltosUI can
8         monitor telemetry data, configure devices and many other
9         tasks. The primary interface window provides a selection of
10         buttons, one for each major activity in the system.  This
11         chapter is split into sections, each of which documents one of
12         the tasks provided from the top-level toolbar.
13
14         ifdef::radio[]
15         === Monitor Flight
16         ////
17               <subtitle>Receive, Record and Display Telemetry Data</subtitle>
18         ////
19
20                 Selecting this item brings up a dialog box listing all
21                 of the connected TeleDongle devices. When you choose
22                 one of these, AltosUI will create a window to display
23                 telemetry data as received by the selected TeleDongle
24                 device.
25
26                 .Device Selection Dialog
27                 image::device-selection.png[width="3.1in"]
28
29                 All telemetry data received are automatically recorded
30                 in suitable log files. The name of the files includes
31                 the current date and rocket serial and flight numbers.
32
33                 The radio frequency being monitored by the TeleDongle
34                 device is displayed at the top of the window. You can
35                 configure the frequency by clicking on the frequency
36                 box and selecting the desired frequency. AltosUI
37                 remembers the last frequency selected for each
38                 TeleDongle and selects that automatically the next
39                 time you use that device.
40
41                 Below the TeleDongle frequency selector, the window
42                 contains a few significant pieces of information about
43                 the altimeter providing the telemetry data stream:
44
45                  * The configured call-sign
46
47                  * The device serial number
48
49                  * The flight number. Each altimeter remembers how
50                    many times it has flown.
51
52                  * The rocket flight state. Each flight passes through
53                    several states including Pad, Boost, Fast, Coast,
54                    Drogue, Main and Landed.
55
56                  * The Received Signal Strength Indicator value. This
57                    lets you know how strong a signal TeleDongle is
58                    receiving. At the default data rate, 38400 bps, in
59                    bench testing, the radio inside TeleDongle v0.2
60                    operates down to about -106dBm, while the v3 radio
61                    works down to about -111dBm.  Weaker signals, or an
62                    environment with radio noise may cause the data to
63                    not be received. The packet link uses error
64                    detection and correction techniques which prevent
65                    incorrect data from being reported.
66
67                  * The age of the displayed data, in seconds since the
68                    last successfully received telemetry packet.  In
69                    normal operation this will stay in the low single
70                    digits.  If the number starts counting up, then you
71                    are no longer receiving data over the radio link
72                    from the flight computer.
73
74                 Finally, the largest portion of the window contains a
75                 set of tabs, each of which contain some information
76                 about the rocket.  They're arranged in 'flight order'
77                 so that as the flight progresses, the selected tab
78                 automatically switches to display data relevant to the
79                 current state of the flight. You can select other tabs
80                 at any time. The final 'table' tab displays all of the
81                 raw telemetry values in one place in a
82                 spreadsheet-like format.
83
84                 ==== Launch Pad
85
86                         .Monitor Flight Launch Pad View
87                         image::launch-pad.png[width="5.5in"]
88
89                         The 'Launch Pad' tab shows information used to decide when the
90                         rocket is ready for flight. The first elements include red/green
91                         indicators, if any of these is red, you'll want to evaluate
92                         whether the rocket is ready to launch:
93
94                         Battery Voltage::
95                         This indicates whether the Li-Po battery powering the
96                         flight computer has sufficient charge to last for
97                         the duration of the flight. A value of more than
98                         3.8V is required for a 'GO' status.
99
100                         Apogee Igniter Voltage::
101                         This indicates whether the apogee
102                         igniter has continuity. If the igniter has a low
103                         resistance, then the voltage measured here will be close
104                         to the Li-Po battery voltage. A value greater than 3.2V is
105                         required for a 'GO' status.
106
107                         Main Igniter Voltage::
108                         This indicates whether the main
109                         igniter has continuity. If the igniter has a low
110                         resistance, then the voltage measured here will be close
111                         to the Li-Po battery voltage. A value greater than 3.2V is
112                         required for a 'GO' status.
113
114                         On-board Data Logging::
115                         This indicates whether there is space remaining
116                         on-board to store flight data for the upcoming
117                         flight. If you've downloaded data, but failed to erase
118                         flights, there may not be any space left. Most of our
119                         flight computers can store multiple flights, depending
120                         on the configured maximum flight log size. TeleMini
121                         v1.0 stores only a single flight, so it will need to
122                         be downloaded and erased after each flight to capture
123                         data. This only affects on-board flight logging; the
124                         altimeter will still transmit telemetry and fire
125                         ejection charges at the proper times even if the
126                         flight data storage is full.
127
128                         GPS Locked::
129                         For a TeleMetrum or TeleMega device, this indicates
130                         whether the GPS receiver is currently able to compute
131                         position information. GPS requires at least 4
132                         satellites to compute an accurate position.
133
134                         GPS Ready::
135
136                         For a TeleMetrum or TeleMega device, this indicates
137                         whether GPS has reported at least 10 consecutive
138                         positions without losing lock. This ensures that the
139                         GPS receiver has reliable reception from the
140                         satellites.
141
142                         The Launchpad tab also shows the computed launch pad
143                         position and altitude, averaging many reported
144                         positions to improve the accuracy of the fix.
145
146                 ==== Ascent
147
148                         .Monitor Flight Ascent View
149                         image::ascent.png[width="5.5in"]
150
151                         This tab is shown during Boost, Fast and Coast
152                         phases. The information displayed here helps monitor the
153                         rocket as it heads towards apogee.
154
155                         The height, speed, acceleration and tilt are shown along
156                         with the maximum values for each of them. This allows you to
157                         quickly answer the most commonly asked questions you'll hear
158                         during flight.
159
160                         The current latitude and longitude reported by the GPS are
161                         also shown. Note that under high acceleration, these values
162                         may not get updated as the GPS receiver loses position
163                         fix. Once the rocket starts coasting, the receiver should
164                         start reporting position again.
165
166                         Finally, the current igniter voltages are reported as in the
167                         Launch Pad tab. This can help diagnose deployment failures
168                         caused by wiring which comes loose under high acceleration.
169
170                 ==== Descent
171
172                         .Monitor Flight Descent View
173                         image::descent.png[width="5.5in"]
174
175                         Once the rocket has reached apogee and (we hope)
176                         activated the apogee charge, attention switches to
177                         tracking the rocket on the way back to the ground, and
178                         for dual-deploy flights, waiting for the main charge
179                         to fire.
180
181                         To monitor whether the apogee charge operated
182                         correctly, the current descent rate is reported along
183                         with the current height. Good descent rates vary based
184                         on the choice of recovery components, but generally
185                         range from 15-30m/s on drogue and should be below
186                         10m/s when under the main parachute in a dual-deploy
187                         flight.
188
189                         With GPS-equipped flight computers, you can locate the
190                         rocket in the sky using the elevation and bearing
191                         information to figure out where to look. Elevation is
192                         in degrees above the horizon. Bearing is reported in
193                         degrees relative to true north. Range can help figure
194                         out how big the rocket will appear. Ground Distance
195                         shows how far it is to a point directly under the
196                         rocket and can help figure out where the rocket is
197                         likely to land. Note that all of these values are
198                         relative to the pad location. If the elevation is near
199                         90°, the rocket is over the pad, not over you.
200
201                         Finally, the igniter voltages are reported in this tab
202                         as well, both to monitor the main charge as well as to
203                         see what the status of the apogee charge is.  Note
204                         that some commercial e-matches are designed to retain
205                         continuity even after being fired, and will continue
206                         to show as green or return from red to green after
207                         firing.
208
209                 ==== Landed
210
211                         .Monitor Flight Landed View
212                         image::landed.png[width="5.5in"]
213
214                         Once the rocket is on the ground, attention switches
215                         to recovery. While the radio signal is often lost once
216                         the rocket is on the ground, the last reported GPS
217                         position is generally within a short distance of the
218                         actual landing location.
219
220                         The last reported GPS position is reported both by
221                         latitude and longitude as well as a bearing and
222                         distance from the launch pad. The distance should give
223                         you a good idea of whether to walk or hitch a ride.
224                         Take the reported latitude and longitude and enter
225                         them into your hand-held GPS unit and have that
226                         compute a track to the landing location.
227
228                         Our flight computers will continue to transmit RDF
229                         tones after landing, allowing you to locate the rocket
230                         by following the radio signal if necessary. You may
231                         need to get away from the clutter of the flight line,
232                         or even get up on a hill (or your neighbor's RV roof)
233                         to receive the RDF signal.
234
235                         The maximum height, speed and acceleration reported
236                         during the flight are displayed for your admiring
237                         observers.  The accuracy of these immediate values
238                         depends on the quality of your radio link and how many
239                         packets were received.  Recovering the on-board data
240                         after flight may yield more precise results.
241
242                         To get more detailed information about the flight, you
243                         can click on the 'Graph Flight' button which will
244                         bring up a graph window for the current flight.
245
246                 ==== Table
247
248                         .Monitor Flight Table View
249                         image::table.png[width="5.5in"]
250
251                         The table view shows all of the data available from the
252                         flight computer. Probably the most useful data on
253                         this tab is the detailed GPS information, which includes
254                         horizontal dilution of precision information, and
255                         information about the signal being received from the satellites.
256
257                 ==== Site Map
258
259                         .Monitor Flight Site Map View
260                         image::site-map.png[width="5.5in"]
261
262                         When the TeleMetrum has a GPS fix, the Site Map tab
263                         will map the rocket's position to make it easier for
264                         you to locate the rocket, both while it is in the air,
265                         and when it has landed. The rocket's state is
266                         indicated by color: white for pad, red for boost, pink
267                         for fast, yellow for coast, light blue for drogue,
268                         dark blue for main, and black for landed.
269
270                         The map's default scale is approximately 3m (10ft) per
271                         pixel. The map can be dragged using the left mouse
272                         button. The map will attempt to keep the rocket
273                         roughly centered while data is being received.
274
275                         You can adjust the style of map and the zoom level
276                         with buttons on the right side of the map window. You
277                         can draw a line on the map by moving the mouse over
278                         the map with a button other than the left one pressed,
279                         or by pressing the left button while also holding down
280                         the shift key. The length of the line in real-world
281                         units will be shown at the start of the line.
282
283                         Images are fetched automatically via the Google Maps
284                         Static API, and cached on disk for reuse. If map
285                         images cannot be downloaded, the rocket's path will be
286                         traced on a dark gray background instead.
287
288                         You can pre-load images for your favorite launch sites
289                         before you leave home; check out <<_load_maps>>.
290
291                 ==== Igniter
292
293                         .Monitor Flight Additional Igniter View
294                         image::ignitor.png[width="5.5in"]
295
296                         TeleMega includes four additional programmable pyro
297                         channels. The Ignitor tab shows whether each of them has
298                         continuity. If an ignitor has a low resistance, then the
299                         voltage measured here will be close to the pyro battery
300                         voltage. A value greater than 3.2V is required for a 'GO'
301                         status.
302         endif::radio[]
303
304
305         === Save Flight Data
306
307                 The altimeter records flight data to its internal
308                 flash memory.
309                 ifdef::radio[]
310                 Data logged on board is recorded at a much
311                 higher rate than the telemetry system can handle, and
312                 is not subject to radio drop-outs. As such, it
313                 provides a more complete and precise record of the
314                 flight.
315                 endif::radio[]
316                 The 'Save Flight Data' button allows you to
317                 read the flash memory and write it to disk.
318
319                 Clicking on the 'Save Flight Data' button brings up a
320                 list of connected flight computers and TeleDongle
321                 devices. If you select a flight computer, the flight
322                 data will be downloaded from that device directly.
323                 ifdef::radio[]
324                 If you select a TeleDongle device, flight data will be
325                 downloaded from a flight computer over radio link via
326                 the specified TeleDongle. See
327                 <<_controlling_an_altimeter_over_the_radio_link>> for
328                 more information.
329                 endif::radio[]
330
331                 After the device has been selected, a dialog showing
332                 the flight data saved in the device will be shown
333                 allowing you to select which flights to download and
334                 which to delete. With version 0.9 or newer firmware,
335                 you must erase flights in order for the space they
336                 consume to be reused by another flight. This prevents
337                 accidentally losing flight data if you neglect to
338                 download data before flying again. Note that if there
339                 is no more space available in the device, then no data
340                 will be recorded during the next flight.
341
342                 The file name for each flight log is computed
343                 automatically from the recorded flight date, altimeter
344                 serial number and flight number information.
345
346         === Replay Flight
347
348                 Select this button and you are prompted to select a flight
349                 record file, either a .telem file recording telemetry data or a
350                 .eeprom file containing flight data saved from the altimeter
351                 flash memory.
352
353                 Once a flight record is selected, the flight monitor interface
354                 is displayed and the flight is re-enacted in real
355                 time.
356                 ifdef::radio[]
357                 Check
358                 <<_monitor_flight>> to learn how this window operates.
359                 endif::radio[]
360
361         === Graph Data
362
363                 Select this button and you are prompted to select a flight
364                 record file, either a .telem file recording telemetry data or a
365                 .eeprom file containing flight data saved from
366                 flash memory.
367
368                 Note that telemetry files will generally produce poor graphs
369                 due to the lower sampling rate and missed telemetry packets.
370                 Use saved flight data in .eeprom files for graphing where possible.
371
372                 Once a flight record is selected, a window with multiple tabs is
373                 opened.
374
375                 ==== Flight Graph
376
377                         .Flight Data Graph
378                         image::graph.png[width="5.5in"]
379
380                         By default, the graph contains acceleration (blue),
381                         velocity (green) and altitude (red).
382
383                         The graph can be zoomed into a particular area by
384                         clicking and dragging down and to the right. Once
385                         zoomed, the graph can be reset by clicking and
386                         dragging up and to the left. Holding down control and
387                         clicking and dragging allows the graph to be panned.
388                         The right mouse button causes a pop-up menu to be
389                         displayed, giving you the option save or print the
390                         plot.
391
392                 ==== Configure Graph
393
394                         .Flight Graph Configuration
395                         image::graph-configure.png[width="5.5in"]
396
397                         This selects which graph elements to show, and, at the
398                         very bottom, lets you switch between metric and
399                         imperial units
400
401                 ==== Flight Statistics
402
403                         .Flight Statistics
404                         image::graph-stats.png[width="5.5in"]
405
406                         Shows overall data computed from the flight.
407
408                 ifdef::gps[]
409                 ==== Map
410
411                         .Flight Map
412                         image::graph-map.png[width="5.5in"]
413
414                         Shows a satellite image of the flight area overlaid
415                         with the path of the flight. The red concentric
416                         circles mark the launch pad, the black concentric
417                         circles mark the landing location.
418                 endif::gps[]
419
420         === Export Data
421
422                 This tool takes the raw data files and makes them
423                 available for external analysis. When you select this
424                 button, you are prompted to select a flight data file,
425                 which can be either a .eeprom or .telem.  The .eeprom
426                 files contain higher resolution and more continuous
427                 data, while .telem files contain receiver signal
428                 strength information.  Next, a second dialog appears
429                 which is used to select where to write the resulting
430                 file.
431                 ifdef::gps[]
432                         It has a selector to choose between CSV and KML
433                         file formats.
434                 endif::gps[]
435
436                 ==== Comma Separated Value Format
437
438                         This is a text file containing the data in a form
439                         suitable for import into a spreadsheet or other
440                         external data analysis tool. The first few lines of
441                         the file contain the version and configuration
442                         information from the altimeter, then there is a single
443                         header line which labels all of the fields. All of
444                         these lines start with a '#' character which many
445                         tools can be configured to skip over.
446
447                         The remaining lines of the file contain the data, with
448                         each field separated by a comma and at least one
449                         space. All of the sensor values are converted to
450                         standard units, with the barometric data reported in
451                         both pressure, altitude and height above pad units.
452
453                 ifdef::gps[]
454                         ==== Keyhole Markup Language (for Google Earth)
455
456                                 This is the format used by Google Earth to provide an
457                                 overlay within that application. With this, you can
458                                 use Google Earth to see the whole flight path
459                                 in 3D.
460                 endif::gps[]
461
462         === Configure Altimeter
463
464                 .Altimeter Configuration
465                 image::configure-altimeter.png[width="3.6in"]
466
467                 ifdef::radio[]
468                 Select this button and then select either an altimeter or
469                 TeleDongle Device from the list provided. Selecting a TeleDongle
470                 device will use the radio link to configure a remote
471                 altimeter.
472                 endif::radio[]
473                 ifndef::radio[]
474                 Select this button and then select an altimeter.
475                 endif::radio[]
476
477                 The first few lines of the dialog provide information about the
478                 connected device, including the product name,
479                 software version and hardware serial number. Below that are the
480                 individual configuration entries.
481
482                 At the bottom of the dialog, there are four buttons:
483
484                 Save::
485                 This writes any changes to the configuration parameter
486                 block in flash memory. If you don't press this button,
487                 any changes you make will be lost.
488
489                 Reset::
490                 This resets the dialog to the most recently saved
491                 values, erasing any changes you have made.
492
493                 Reboot::
494
495                 This reboots the device. Use this to switch from idle
496                 to pad mode by rebooting once the rocket is oriented
497                 for flight, or to confirm changes you think you saved
498                 are really saved.
499
500                 Close::
501
502                 This closes the dialog. Any unsaved changes will be
503                 lost.
504
505                 The rest of the dialog contains the parameters to be configured.
506
507                 include::config-device.raw[]
508
509
510         === Configure AltosUI
511
512                 .Configure AltosUI Dialog
513                 image::configure-altosui.png[width="2.4in"]
514
515                 This button presents a dialog so that you can
516                 configure the AltosUI global settings.
517
518                 include::config-ui.raw[]
519
520         ifdef::radio[]
521         === Configure Groundstation
522
523                 .Configure Groundstation Dialog
524                 image::configure-groundstation.png[width="3.1in"]
525
526                 Select this button and then select a TeleDongle or
527                 TeleBT Device from the list provided.
528
529                 The first few lines of the dialog provide information
530                 about the connected device, including the product
531                 name, software version and hardware serial
532                 number. Below that are the individual configuration
533                 entries.
534
535                 Note that TeleDongle and TeleBT don't save any
536                 configuration data, the settings here are recorded on
537                 the local machine in the Java preferences
538                 database. Moving the device to another machine, or
539                 using a different user account on the same machine
540                 will cause settings made here to have no effect.
541
542                 At the bottom of the dialog, there are three
543                 buttons:
544
545                 Save::
546                 This writes any changes to the local Java
547                 preferences file. If you don't press this
548                 button, any changes you make will be lost.
549
550                 Reset::
551                 This resets the dialog to the most recently
552                 saved values, erasing any changes you have
553                 made.
554
555                 Close::
556                 This closes the dialog. Any unsaved changes
557                 will be lost.
558
559                 The rest of the dialog contains the parameters
560                 to be configured.
561
562                 ==== Frequency
563
564                         This configures the frequency to use for both
565                         telemetry and packet command mode. Set this
566                         before starting any operation involving packet
567                         command mode so that it will use the right
568                         frequency. Telemetry monitoring mode also
569                         provides a menu to change the frequency, and
570                         that menu also sets the same Java preference
571                         value used here.
572
573                 ==== RF Calibration
574
575                         The radios in every Altus Metrum device are
576                         calibrated at the factory to ensure that they
577                         transmit and receive on the specified
578                         frequency.  To change a TeleDongle or TeleBT's
579                         calibration, you must reprogram the unit
580                         completely, so this entry simply shows the
581                         current value and doesn't allow any changes.
582
583                 ==== Telemetry Rate
584
585                         This lets you match the telemetry and packet
586                         link rate from the transmitter. If they don't
587                         match, the device won't receive any data.
588         endif::radio[]
589
590         === Flash Image
591
592                 This reprograms Altus Metrum devices with new
593                 firmware.
594                 ifdef::telemetrum,telemini[]
595                         TeleMetrum v1.x, TeleDongle v0.2, TeleMini v1.0
596                         and TeleBT v1.0 are all reprogrammed by using another
597                         similar unit as a programming dongle (pair
598                         programming).
599                 endif::telemetrum,telemini[]
600                 ifdef::telemega,easymega,telemetrum[]
601                         TeleMega, EasyMega, TeleMetrum v2,
602                         EasyMini and TeleDongle v3 are all
603                 endif::telemega,easymega,telemetrum[]
604                 ifndef::telemega,easymega,telemetrum[]
605                         EasyMini is
606                 endif::telemega,easymega,telemetrum[]
607                 programmed directly
608                 over USB (self programming). Please read
609                 the directions for flashing devices in
610                 <<_updating_device_firmware>>.
611
612         === Fire Igniter
613
614                 .Fire Igniter Window
615                 image::fire-igniter.png[width="1.2in"]
616
617                 This activates the igniter circuits in the flight
618                 computer to help test recovery systems
619                 deployment.
620                 ifdef::radio[]
621                 Because this command can operate over the
622                 Packet Command Link, you can prepare the rocket as for
623                 flight and then test the recovery system without
624                 needing to snake wires inside the air-frame.
625                 endif::radio[]
626
627                 Selecting the 'Fire Igniter' button brings up the
628                 usual device selection dialog. Pick the desired
629                 device. This brings up another window which shows the
630                 current continuity test status for all of the pyro
631                 channels.
632
633                 Next, select the desired igniter to fire. This will
634                 enable the 'Arm' button.
635
636                 Select the 'Arm' button. This enables the 'Fire'
637                 button. The word 'Arm' is replaced by a countdown
638                 timer indicating that you have 10 seconds to press the
639                 'Fire' button or the system will deactivate, at which
640                 point you start over again at selecting the desired
641                 igniter.
642
643         ifdef::radio[]
644         === Scan Channels
645
646                 .Scan Channels Window
647                 image::scan-channels.png[width="3.2in"]
648
649                 This listens for telemetry packets on all of the
650                 configured frequencies, displaying information about
651                 each device it receives a packet from. You can select
652                 which of the baud rates and telemetry formats should
653                 be tried; by default, it only listens at 38400 baud
654                 with the standard telemetry format used in v1.0 and
655                 later firmware.
656         endif::radio[]
657
658         ifdef::gps[]
659         include::load-maps.raw[]
660         endif::gps[]
661
662         ifdef::radio[]
663         === Monitor Idle
664
665                 .Monitor Idle Window
666                 image::monitor-idle.png[width="5.2in"]
667
668                 This brings up a dialog similar to the Monitor Flight
669                 UI, except it works with the altimeter in “idle” mode
670                 by sending query commands to discover the current
671                 state rather than listening for telemetry
672                 packets. Because this uses command mode, it needs to
673                 have the TeleDongle and flight computer callsigns
674                 match exactly. If you can receive telemetry, but
675                 cannot manage to run Monitor Idle, then it's very
676                 likely that your callsigns are different in some way.
677
678                 You can change the frequency and callsign used to
679                 communicate with the flight computer; they must both
680                 match the configuration in the flight computer
681                 exactly.
682         endif::radio[]