20 likes | 126 Views
RA Step (direction, steps). PMT(). DEC Step (direction, steps). Keypad(). spiralSearch (). clockDrive (). MovToObject ( obj ). VARIABLES. LCDwrite (). PMTcontrol (). CheckObject (). Save(). Setup(). Measure(). clock (). RTCread (). RTCwrite (). Observation().
E N D
RA Step (direction, steps) PMT() DEC Step (direction, steps) Keypad() spiralSearch() clockDrive() MovToObject(obj) VARIABLES LCDwrite() PMTcontrol() CheckObject () Save() Setup() Measure() clock () RTCread() RTCwrite() Observation() iRA holds the number of steps to step in RA iDEC holds the number of steps to step in DEC aOBJECTS((4,3) array that holds relative RA/DFEC and name for the 4 objects (VAR, COMP, CHK, SKY) aRESULTS(~,4) holds the results for each measurement for each object iCLOUD is a counter that is set to a figure and decrements when loud is discovered, when it reaches zero a spiral search is initiated to look for the star Sends the correct o/p to the GPIO to step the stepper motor in specified direction Adds the relevant number of steps to the RA and DEC variables function Sub-routine Turns on and off the PMT, clears the values etc. interrupt Calls all the subroutines to move scope between objects and make the measurements Returns value of photo multiplier tube Compares measured with sky to see if cloudy and if so sets a variable with a value that decrements Uses an interrupt to increment the RA VAR by the number of steps that need to be stepped in RA Saves the data to disk Runs sequence to set-up observing session Sits in background and calls program to execute regularly Uses an interrupt to read buttons presses on a direction keypad Reads the real time clock and returns time and other data stored Writes the real time clock and returns time and other data stored Sends the correct o/p to the GPIO to step the stepper motor in specified direction Runs sequence for set period of time Write data to LCD Searches for signal using a spiral pattern The main program is executed by clock() interrupt (this is probably less processor hungry than mindlessly looping). The main sub routine (measure()) checks if there is a positive or negative value in RA or DEC variables and if so steps the RA and DEC motors appropriately, incrementing or decrementing these variables accordingly with each step. Another interrupt increments the RA variable periodically to provide an RA drive feed. To move to an object the main sub calls moveToObject this adds the relative number of steps to the RA and DEC variable and so triggers movement to the object, all the time the clockDrive interrupt is continuing to increment the RA variable at a rate to drive at sidereal rate. Once moved to a star location the checkObject sub routine checks the star is there and if not triggers the spiral search, if this fails the checkObject sub will set a timer that counts down to zero – this pauses all but the RA clock drive. Once on a star the PMT control start the measurement, and this is read into the aRESULTS array and then saved to non-volatile memory.
Other considerations • I have no idea of how fast the APT can slew, but we could think about having an observing list that the telescope could work through