12meter pointing program..

jul23

Some current base locations:

links:

more info on p12m control program:

more info on the p12m telescope

Warning:



Intro

     The 12meter telescope is driven by smart motor controllers that control the azimuth and elevation. They compute via modBus to the outside world over a single Ethernet link. The p12mProg is the ao software that controllers the motor controllers at the 12m. It does the following:

The user interface to the p12mProg is done through tcl functions/routines written at AO.


The pointing program p12mProg

source Code
threads (started by p12mMain.c
Purpose
p12mMain.c

  • starts everything
  • listens on a socket for connection requests (tcp)
  • when a request is made it starts a copy of p12mIoThr
    • Currently a max of 5 users can be controlling the 12m at once.
  • When a connection drops cleanup any resources used
  • compiles to p12mProg

p12mIoThr.c
  • communicates between the pointing program and the outside world via ASCII  commands
  • Gets started by p12mMain.c when a connection request is made

p12mXfThr.c
Controls the 12meter.
  • converts ra,dec to az,el every second and sends it to the 12meter
  • This is the only program that talks to the 12meter (via a socket)

p12mLogThr.c
Outputs the logging info
  • once a second it broadcasts the 12meter state.
  • It also writes this data to a disc file once a second.


Lib Dependencies:

Name
Type
Purpose
libp12m.a library  routines to decode p12m status words. Used by p12mprog and other monitor programs
Loc:aosBase/libs64/

source
source code for libp12m.a
makefile: Makefile in same directory
Loc:p12mBase/libsrc/p12mlib/
libp12md.a
library
query, set values in 12meter hardware controller. These are the routines that communicate with the 12m controller.
Loc:aosBase/libs64/

source
source code for libp12md.a
makefile: Makefile in same directory
Loc:p12mBase/libsrc/p12mdev/
libp12mprog.a
library
a few utility routines need by p12mProg that were extracted from phillib.a
Loc:aosBase/libs64/

source
source code for p12mprog.a
makefile: Makefile in same directory
Loc:p12mBase/libsrc/p12mprog/
libaomb.a
library
modbus routines to communicate with the 12m hardware controller modbus interface over Ethernet
Loc:aosBase/libs64/

source
source code for libaomb.a
makefile: Makefile
Loc:aosBase/libsrc/aomb/
libpntxform.a
library
pointing transformation routines.
Loc:aosBase/libs64/

source
source code for pntxform lib
makefile: Makefile in current dir
Loc:aosBase/libsrc/pntXform/
libphil.a
library
lots of utility routines to do things like
  • convert units
  • control queues
  • control threads
  • socket code
  • timers
  • etc...
Loc:aosBase/libs64/

source
source code for libphil. Split into various subdirectories
Loc: aosBase/libsrc/phil/
  • makefile: Makefile  in libsrc/phil will make everything
subdir:
  • conv: conversion routines
  • datatk: datatking routines
  • util: utility routines
system libs

-lrt for realtime clock
-lm   for math routines.

Include files

Loc:aosBase/include   unless other wise noted.


p12mProg.h
include file for p12mProg. (only used by p12mProg)
defines:
  • structs,prototypes, constants used by p12mProg
  • Loc: p12mBase/Prog/
p12m.h
includes and prototypes for p12mlib
p12mMisc.h
defines structures for p12mProg, also used by external programs
pntMisc.h common structs, constants for 305m and 12m pointing.
pntXformLib.h
include file for pntXform lib
pntProgState.h
holds structure that is broadcast once a second and written to disc.
p12mDevLib .h
for p12md library. has prototypes
p12mCtrlReg.h
addresses, symbolic names, controller names to configure the hardware controller
mbtcp.h
include for for modbus tcp  library aomb.a
p12merrno.h
error numbers for p12mprog
philLib.h
include file for -lphil
includes: convLib.h, datkLib.h, utilLib.h

mshmLib.h
defines broadcast packets for p12m state. includes multicast ipaddress, port
Also has code for the older sharedmemory broadcasts of the 305meter.


Misc files/requirements.


lock file
Used to guarantee  only one copy of pntmProg is running at a time
  • lock file location defined in p12mProg.h
    • #define LOCKFILE_NAME  "/share/phildat/p12m/p12mProg.lok"
p12mBase/etc/model12m
This is the pointing model parameters.
  • p12mProg.c loads it with the call
  • if (p12mModelInp(P12MMODELFILE,-1,&pprgI->modelI)!=OK)
    • p12mModelInp is in p12mlib
    • the define P12MMODELFILE is defined in p12mProg.h
/share/obs4/dt/dfiles/epvChebs
chebychev polynomials from de403 ephemeris for earth position in solar system barycenter.
one polynomial for each day.
Data valid: 01jan2004 t 01jan2024 
created by mike nolan using fortran program.
If observing goes beyond 2023 , will need to update.
Used to compute the radial velocity for spectral line observing.
routines: epvInput(), epvCompute in pntXformLib are used to access the file.
/home/online/vw/etc/Pnt/utcToUt1.dat
Program to go from utc to ut1. generates dut1.
  • uses directory: /home/online/vw/etc/Pnt/
    • defined in p12mProg.h
    • #define P12MUTCIFILE   "/home/online/vw/etc/Pnt/utcToUt1.dat"
  • down load current data from (bulletin A)
  • edit the file removing non data lines
  • edit utcToUt1.pro and add file just download
  • in idl run utcToUt1
  • add offset, rate to utcToUt1.dat
    • year dayno offsetMilliSecs rate millisecs/day
  • cp input data file to /home/phil/public_html/pnt 
  • the library routine
    • utcInfoInp.c will be called by p12mProg to read in the data.
    • p12mProg then uses the offset at date and rate (millisec/day) to compute dut1 each sec.
  • More info
sntp time server
the controller needs an sntp time server (turns out an ntp server also works).
to configure the ip address for this:
  •  using a web browser login to the controller ip address
  • go to protocols->scheduled events->modify configuration
    • then enter the new ip address for the sntp server.
  • for more info see page 17 of
  •  Integrated Antenna Controller for the Cornell University 12m Antenna at
    the Arecibo Observatory
ip info:
  • ip address for the 12meter motor controller
    • set in p12mProg.h  with #define P12M_IP_ADR
    • listen port for the p12mProg .. to listen for connection requests:
      • 1425.. probably should be added to the /etc/services file
  • sntp server ip address
    • needs to be loaded in the motor controller using the motor controller web interface (see sntp time server above)
  • multicast address,port for 1 second multi cast packets of 12m status
    • set in mshmLib.h
status Logging
The p12mProg status is written once a second (in binary) the to daily log
  • the p12mLog.c thread does the logging
  • the log file directory defined in p12mProg.h
    •  #define LOGDIR         "/share/phildat/p12m/"
Error logging
p12mProg uses syslog to log messages, errors

starting p12mProg at boot
p12mProg is run on galfas2 computer
  • the file /etc/rc.local starts p12mProg
    • su -c /share/megs/phil/svn/aosoft/p12m/Prog/p12mProg phil &
    • user phil was used to make sure some file accesses were allowable. probably not needed (but then you'll need to make sure some of the logfiles have the correct permissions for the program to write them.

tcl code for user
p12mBase/tcl has the tcl code that is the user interface
  • the script startp12m starts things up.
phil's web pages
/home/phil/public_html/  holds phil's web pages.
  • the 12meter manuals are included here



Computers used

The computers that are currently used:


Compiling

To recompile the libraries and 12meter code: