PIP by W.P.Koorts wpk@saao.ac.za http://www.saao.ac.za/~wpk/ ~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Introduction ~~~~~~~~~~~~ This program, together with some hardware, was developed with the timing/logging needs of the satellite and occultation observer in mind. It will turn your PC into a stopwatch with an effective 1000-lap-memory which can be logged to disk. The absolute time of this stopwatch - your computer's RTC (real time clock) - can be set to milliseconds using the hourly "six pips" broadcast by some radio stations. The RTC errors, corrections and drift rates are logged to a file for adjusting the stopwatch data afterwards if such accuracy is needed. To refine your data even more, you can also measure your reaction time using this program. A sounder can be switched on to help count seconds when observing. Other spin-offs are calculation of Sidereal Time and Julian Day and conversions to and from these to Mean Time and Calendar Date. The "Equation of Time" is also determined. Using the Program ~~~~~~~~~~~~~~~~~ After unzipping, the following files should be present: PIP EXE - The program to run PIP TXT - This file PIP DAT - Data file used by program SETUP DAT - Data file used by program PLACES DAT - List of geographical data of your observing stations JUNK LOG - Typical stopwatch log file RADIO PIP - Typical radio pip vs. computer clock log file When running up PIP.EXE, a check is first made to see what printer ports are available and if more than one is found, the user is asked to specify which one has the handset connected (see Hardware below). Just give it a number between 1 and 3. After pressing a key, the main menu appears : U Setup ( Place/Long/Lat/Time-Zone, Display format ) ( and Push button de-bounce factor. ) D set DOS real time clock. P Pips sounder currently ON/OFF C convert Calender date to Julian date. J convert Julian date to calender date T calculate sidereal Time for a specific instant. V View contents of radio log file. R Radio setting of clock currently ENABLED/DISABLED S put system in Stopwatch mode. L List stopwatch Log files. F view a stopwatch log File. M Measure your reaction time. Q Quit ( to DOS ) and to the right of this, four little windows, from top to bottom: 1) Time Window - giving Date, Julian Day, Mean time and Sidereal time. 2) Place Window - giving Place name, geographical data and Time zone. 3) Equation of Time window - giving the Equation of Time. 4) Last Radio Fix data - Date and time, Error and Drift. The first thing you would need to set up is your site's geographical information (needed for calculation sidereal time). This is done using the 'U' (Setup) function. Any questions/values you want to skip and leave unchanged are ignored by pressing Enter. Once the values are changed to your liking, they can be saved as future defaults. There are also two variables that might need some adjustment for proper functioning of the handset functions. The first is the key debounce factor which is set in 1/100 sec units. Change this value if key-bounce is noticed in the stopwatch mode. The second variable can be changed to get realistic waiting times when measuring reaction time. This factor takes care of different compter speeds and is roughly the number of times your PC is faster than an XT. Most of the other menu options are self explanatory. The option 'R' (Radio setting of clock currently ENABLED/DISABLED) might require a little more explenation. When this is ENABLED, and the 'six pip detector' (see Hardware below) gives its output via pin 10 of the printer port, the computer's RTC will be set to the nearest hour and the difference and error logged (appended) to file RADIO.PIP. NB: When this file is not present in the same directory as PIP.EXE a run-time-error will occur. For the functions 'S' (put system in Stopwatch mode) and 'M' (Measure your reaction time) to work, the handset must be connected to a printer port of the computer. When the system is put into Stopwatch Mode, the user is first asked for a filename if logging to a file is required and if audio feedback of handset keypresses are to be switched on. Thereafter, every time the LHS button on the handset is pressed, the time and duration between successive keypresses are remembered, first just in memory and then when either the RHS button is pressed or when you exit, is it written to disk. For measuring one's reaction time, a screen with three diagonal windows appears. The top-left window has some instructions and the bottom-right a running total of the last, best, worst and average reaction times so far. In the centre window, a cross appears some random time after the handset's RHS button was pressed. Your reaction time is measured from the instant the cross appeared to when the LHS button was pressed - and don't try and cheat by pressing the buttom beforehand, you will be caught out! NB: This option does not work properly when the option of generating your own 1/100th sec timing was chosen in the Setup menu. NB: With computers getting faster and faster, delay functions loose their meaning. If you find that the delay between the RHS button pressed and the cross appearing is too fast, increase the PC_Speed varaible in the Setup menu - this value is roughly the number of times your PC is faster than an XT. Hardware ~~~~~~~~ A simple handset is required in stopwatch mode and checking your reaction time. It consists of two pushbutton switches and two resistors, mounted in a plastic box and connected to the computer's printer port using a 25-way delta-pin connector as follows : WIRING DIAGRAM FOR PIP PROGRAM HANDSET ====================================== 25-way delta-pin 1 O----------o-----o------ | | | > > > < < < > > > 3 x 4k7 < < < resistors > > > Handset box < < < ............................... > > > . . | | | . RHS button . | | | . \ . Yel | | | . no \ . 12 O----------o----------------------------------------^ o-------- . | | . | . | | . LHS button | . | | . \ | . Grn | | . no \ | . 13 O----------------o----------------------------------^ o-------o . | . | . | . | . | . | . Red | . | . 14 O----------------------------------------------------------------- . | . . | ............................... | | 10 O----------------------o------------------------------------------- Co-ax cable from 6-pip detector Cable Screens 25 O------------------------------------------------------------------ | | Legend: Connection = -----o----- | | | | No Connection = ----------- | | \ Normally open no \ Pushbutton switch = -----^ o----- A third resistor and a length of co-axial cable connects the six-pip detector through to pin 10 of the printer port as indicated above. The circuit of the six-pip detector is too complex to give here, but the principle is as follows: In South Africa are two radio stations that send out a time signal on the hour in the form of six 100ms bursts of 1kHz with the start of the sixth one exactly on the hour. The six-pip detector listens to the radio station all the time, trying to recognise the six-pip signature amoungst all the 1kHz occurances. To prevent false triggers, the circuit rejects it as a valid pip sequence when any 1kHz appears between pips and times out if a pip does not re-appear within 1 second from the last one. When the full pip sequence is detected, the circuit gives out a pulse exactly on the hour, connecting it into the PC's printer port, pin 10. When the program detects this pulse, it sets the PC's clock to the nearest hour exactly, logging the difference between the time when the pulse arrived and the PC's RTC values at that instant, to a file. The circuit compensates for the radio signal travel time between the source transmitter and your receiver but this time is difficult to determine accurately without a reference time signal. We found this to be about 350ms between Johannesburg and Cape Town (1500km), the main contribution being the (communication) satellite uplink (70 000km) which means that this should be much the same for all stations received via satellite.