105a106,116 > Kobulnicky, Sullins & First use of this code to control telescope by means > Weger Nov. 22, 2008 of new Vertex RSI Antenna Control System model 133. > Weger Feb. 20, 2009 Install save_offsets() and reapply_offsets() in order > to preserve offsets between fundamental mode changes. > Weger Aug. 26, 2009 Install do_solar_tracking(). Call it, do_fixed_ > tracking() and do_non_solar_tracking from do_vrsi(). > Test planet tracking at WIRO. > Weger Feb. 3, 2010 Activate gpib, hifi & focus procedures and the focus > portion of do_paddle(). Test focus control at WIRO. > Weger Apr. 2010 Install rates modifications for solar and non-solar > tracking. 231c242,247 < double old_haoffsum, old_decoffsum; /* Initialize these for arbitration */ --- > double vrsi_harate, vrsi_decrate; > double vrsi_ha_due_rate, vrsi_dec_due_rate; > double old_ha_due_rate, old_dec_due_rate; > double d_haoff_due_rate, d_decoff_due_rate; > double haoffsum, decoffsum; > double old_haoffsum, old_decoffsum; /* For front-end/ACU arbitration. */ 1454a1471,1476 > vrsi_ha_due_rate = 0.0; > vrsi_dec_due_rate = 0.0; > old_ha_due_rate = 0.0; > old_dec_due_rate = 0.0; > d_haoff_due_rate = 0.0; > d_decoff_due_rate = 0.0; 1491c1513 < sprintf(command, "STAR 1,%.4f,%.4f,J,%.1f,1,S,\"%s\"", \ --- > sprintf(command, "STAR 1,%lf,%lf,J,%f,1,S,\"%s\"", \ 1497c1519 < sprintf(command, "PD %.4f,%.4f", vrsi_DES_HA,vrsi_DES_DEC); --- > sprintf(command, "PD %lf,%lf", vrsi_DES_HA,vrsi_DES_DEC); 1515c1537 < sprintf(command, "OFFSET %.5f,%.5f", old_haoffsum, old_decoffsum); --- > sprintf(command, "OFFSET %lf,%lf", old_haoffsum, old_decoffsum); 1691a1714 > 1738,1739c1761 < vrsi_haoff, vrsi_decoff, < haoffsum, decoffsum, --- > vrsi_haoff=0.0, vrsi_decoff=0.0, 1743a1766 > /* double delta_t; /\* Time since last iteration. (SECONDS) *\/ */ 1764c1787 < /* Obtain current offsets from the ACU: */ --- > /* Obtain current, manual offsets from the ACU: */ 1767c1790,1832 < sscanf(reply, "%.4f,%.4f", &vrsi_haoff, &vrsi_decoff); --- > sscanf(reply, "%lf,%lf", &vrsi_haoff, &vrsi_decoff); > > /* If tracking a non_solar object, */ > /* then place any offsets-due-rates into the OFFSET registers: */ > > if (tinfo->motion_type == NON_SOLAR) { > > /* First, obtain total, current offsets-due-rates from the ACU: */ > > vrsi_tcpip("RMON", reply, 80, 1, "10.212.212.121", 5001); > sscanf(reply, "%lf,%lf,%lf,%lf", &vrsi_ha_due_rate,\ > &vrsi_dec_due_rate, &vrsi_harate, &vrsi_decrate); > > printf("RMON reply:\n"); > printf(" vrsi_offsets_due_rates: %lf, %lf\n",\ > vrsi_ha_due_rate, vrsi_dec_due_rate); > printf(" vrsi_rates: %lf, %lf\n",\ > vrsi_harate, vrsi_decrate); > > /* Get increment in offsets_due_rates since last trackloop: */ > > d_haoff_due_rate = (vrsi_ha_due_rate - old_ha_due_rate); > d_decoff_due_rate = (vrsi_dec_due_rate - old_dec_due_rate); > old_ha_due_rate = vrsi_ha_due_rate; > old_dec_due_rate = vrsi_dec_due_rate; > > /* Increment tracking screen OFFSETs with any offsets_due_rates: */ > > printf("Old offsets due rates:\n"); > printf(" HA: %lf\n", old_ha_due_rate); > printf(" Dec: %lf\n", old_dec_due_rate); > > printf("Delta offsets due rates:\n"); > printf(" HA: %lf\n", d_haoff_due_rate); > printf(" Dec: %lf\n", d_decoff_due_rate); > > OFFSET_HA += (d_haoff_due_rate * cos_dec); > OFFSET_DEC += d_decoff_due_rate; > } > > /* Obtain the sum of desired offsets from shared memory; but, */ > /* remove any offset-due-rate increment just added */ > /* for the case of NON_SOLAR motion: */ 1769c1834,1835 < /* Obtain the sum of desired offsets from front-end computer: */ --- > /* haoffsum = -DIAL_HA + tinfo->dial_ha + (COL_ZERO_HA + COL_HA + OFFSET_HA + OFFSET_2_HA)/cos_dec; */ > /* decoffsum = -DIAL_DEC + COL_ZERO_DEC + COL_DEC + OFFSET_DEC + OFFSET_2_DEC; */ 1771,1772d1836 < /* haoffsum = -DIAL_HA + tinfo->dial_ha + (COL_ZERO_HA + COL_HA + OFFSET_HA + OFFSET_2_HA)/cos_dec; */ < /* decoffsum = -DIAL_DEC + COL_ZERO_DEC + COL_DEC + OFFSET_DEC + OFFSET_2_DEC; */ 1773a1838,1839 > haoffsum = tinfo->dial_ha + (COL_HA + (OFFSET_HA - (vrsi_ha_due_rate * cos_dec)))/cos_dec; > decoffsum = COL_DEC + (OFFSET_DEC - vrsi_dec_due_rate); 1775,1776c1841,1842 < haoffsum = tinfo->dial_ha + (COL_HA + OFFSET_HA)/cos_dec; < decoffsum = COL_DEC + OFFSET_DEC; --- > /* haoffsum = tinfo->dial_ha + (COL_HA + OFFSET_HA)/cos_dec; */ > /* decoffsum = COL_DEC + OFFSET_DEC; */ 1786c1852,1854 < /* If current and actual offsets differ, */ --- > /* Now look for any difference between ACU's Manual Offset and */ > /* the sum of Shared Memory Offsets less any offset_due_rate */ > /* which is added to the SMem Offsets for NON_SOLAR motion: */ 1790c1858 < /* and if difference originated from the front-end, */ --- > /* If a difference originated from the Shared Memory, */ 1798c1866 < sprintf(command, "JOG %.5f,%.5f", d_haoffsum, d_decoffsum); --- > sprintf(command, "JOG %lf,%lf", d_haoffsum, d_decoffsum); 1804,1805c1872,1874 < /* But if difference originated from the hand paddle, < then update the front-end's memory of the offsets: */ --- > /* But if difference originated from a PDU hand paddle, */ > /* which has not yet been implemented, */ > /* then update the front-end's memory of the offsets: */ 1821,1822c1890,1891 < if ((vrsi_HA - haoffsum) <= 180.0) < HA = vrsi_HA - haoffsum; --- > if ((vrsi_HA - vrsi_ha_due_rate - haoffsum) <= 180.0) > HA = vrsi_HA - vrsi_ha_due_rate - haoffsum; 1824,1825c1893,1894 < HA = vrsi_HA - haoffsum - 360.0; < DEC = vrsi_DEC - decoffsum; --- > HA = vrsi_HA - vrsi_ha_due_rate - haoffsum - 360.0; > DEC = vrsi_DEC - vrsi_dec_due_rate - decoffsum; 2154c2223 < sprintf(command, "STAR 1,%.5f,%.5f,J,%.3f,1,S,\"%s\"", \ --- > sprintf(command, "STAR 1,%lf,%lf,J,%f,1,S,\"%s\"", \ 2181c2250 < mode change. Clear rates explicitly. */ --- > mode change. Clear rates and offsets-due-rates explicitly. */ 2183a2253,2256 > > OFFSET_HA -= (vrsi_ha_due_rate * cos_dec); > OFFSET_DEC -= vrsi_dec_due_rate; > 2185a2259,2283 > > > /* haoffsum = tinfo->dial_ha + (COL_HA + (OFFSET_HA - (vrsi_ha_due_rate * cos_dec)))/cos_dec; */ > /* decoffsum = COL_DEC + (OFFSET_DEC - vrsi_dec_due_rate); */ > > haoffsum = tinfo->dial_ha + (COL_HA + OFFSET_HA)/cos_dec; > decoffsum = COL_DEC + OFFSET_DEC; > > /* Add in the nod motions if needed */ > if (NODDED) { > decoffsum += (NOD_DEC); > haoffsum += (NOD_HA ) / cos_dec; > } > > sprintf(command, "OFFSET %lf,%lf", haoffsum, decoffsum); > vrsi_tcpip(command, reply, 80, 1, "10.212.212.121", 5001); > old_haoffsum = haoffsum; > old_decoffsum = decoffsum; > old_ha_due_rate = 0.0; > old_dec_due_rate = 0.0; > vrsi_ha_due_rate = 0.0; > vrsi_dec_due_rate = 0.0; > d_haoff_due_rate = 0.0; > d_decoff_due_rate = 0.0; > 2189d2286 < printf("L1890\n"); 2192d2288 < printf("L1893\n"); 2199a2296,2305 > > } > > /* If rates have changed, then load them into the ACU. */ > > if ((V_RA != vrsi_V_RA) || (V_DEC != vrsi_V_DEC)) { > vrsi_V_RA = V_RA; > vrsi_V_DEC = V_DEC; > sprintf(command, "ROFFS %f,%f", vrsi_V_RA*12960000.0*15.0,vrsi_V_DEC*12960000.0); > vrsi_tcpip(command, reply, 80, 1, "10.212.212.121", 5001); 2208d2313 < printf("L1903\n"); 2211d2315 < printf("L1906\n"); 2215d2318 < printf("L1910\n"); 2218d2320 < printf("L1913\n"); 2219a2322,2327 > if ((V_RA != 0.0) || (V_DEC != 0.0)) { > vrsi_V_RA = V_RA; > vrsi_V_DEC = V_DEC; > sprintf(command, "ROFFS %f,%f", vrsi_V_RA*12960000.0*15.0,vrsi_V_DEC*12960000.0); > vrsi_tcpip(command, reply, 80, 1, "10.212.212.121", 5001); > } 2249d2356 < printf("A1\n"); 2264d2370 < printf("A2\n"); 2273,2275c2379 < usleep((time_t) 1000000); < < sprintf(command, "STAR 1,%.5f,%.5f,J,%.3f,1,S,\"%s\"", \ --- > sprintf(command, "STAR 1,%lf,%lf,J,%f,1,S,\"%s\"", \ 2279d2382 < usleep((time_t) 1000000); 2292c2395 < sprintf(command, "ROFFS %.2f,%.2f", vrsi_V_RA*3600.0*-15.0,vrsi_V_DEC*3600.0); --- > sprintf(command, "ROFFS %f,%f", vrsi_V_RA*3600.0*-15.0,vrsi_V_DEC*3600.0); 2294d2396 < printf("A3\n"); 2305,2306d2406 < printf("A4\n"); < usleep((time_t) 5000000); 2307a2408 > 2319d2419 < printf("L1890\n"); 2322d2421 < printf("L1893\n"); 2324d2422 < printf("B5\n"); 2337c2435 < sprintf(command, "STAR 1,%.5f,%.5f,J,%.3f,1,S,\"%s\"", \ --- > sprintf(command, "STAR 1,%lf,%lf,J,%f,1,S,\"%s\"", \ 2341c2439 < sprintf(command, "ROFFS %.2f,%.2f", vrsi_V_RA*3600.0*-15.0,vrsi_V_DEC*3600.0); --- > sprintf(command, "ROFFS %f,%f", vrsi_V_RA*3600.0*-15.0,vrsi_V_DEC*3600.0); 2343d2440 < printf("B6\n"); 2344a2442 > 2346d2443 < printf("B7\n"); 2353d2449 < printf("B8\n"); 2355c2451,2459 < usleep((time_t) 5000000); --- > } > > /* If rates have changed, then load them into the ACU. */ > > if ((V_RA != vrsi_V_RA) || (V_DEC != vrsi_V_DEC)) { > vrsi_V_RA = V_RA; > vrsi_V_DEC = V_DEC; > sprintf(command, "ROFFS %f,%f", vrsi_V_RA*3600.0*-15.0,vrsi_V_DEC*3600.0); > vrsi_tcpip(command, reply, 80, 1, "10.212.212.121", 5001); 2363d2466 < printf("C9\n"); 2365d2467 < printf("L1903\n"); 2368d2469 < printf("L1906\n"); 2387c2488 < sprintf(command, "STAR 1,%.5f,%.5f,J,%.3f,1,S,\"%s\"", \ --- > sprintf(command, "STAR 1,%lf,%lf,J,%f,1,S,\"%s\"", \ 2391,2393d2491 < usleep((time_t) 15000000); < < printf("L1910\n"); 2395,2397d2492 < < /* usleep((time_t) 3000000); */ < 2399d2493 < printf("L1913\n"); 2401d2494 < printf("C10\n"); 2403c2496 < sprintf(command, "ROFFS %.2f,%.2f", vrsi_V_RA*3600.0*-15.0,vrsi_V_DEC*3600.0); --- > sprintf(command, "ROFFS %f,%f", vrsi_V_RA*3600.0*-15.0,vrsi_V_DEC*3600.0); 2411d2503 < printf("C11\n"); 2418,2419d2509 < printf("C12\n"); < usleep((time_t) 5000000); 2474c2564 < sprintf(command, "PD %.4f,%.4f", vrsi_DES_HA,vrsi_DES_DEC); --- > sprintf(command, "PD %lf,%lf", vrsi_DES_HA,vrsi_DES_DEC); 2520c2610 < sprintf(command, "PD %.4f,%.4f", vrsi_DES_HA,vrsi_DES_DEC); --- > sprintf(command, "PD %lf,%lf", vrsi_DES_HA,vrsi_DES_DEC); 2556,2561d2645 < /* savedHAoffset = OFFSET_HA; /\* not projected to equator *\/ */ < /* savedDECoffset = OFFSET_DEC; */ < < /* OFFSET_HA = 0.0; */ < /* OFFSET_DEC = 0.0; */ < 2569d2652 < /* usleep((time_t) 3000000); /\* This may not be necessary. *\/ */ 2582,2588c2665,2667 < /* OFFSET_HA = savedHAoffset; /\* not projected to equator *\/ */ < /* OFFSET_DEC = savedDECoffset; */ < < /* sprintf(command, "OFFSET %.5f,%.5f", savedHAoffset/cos_dec, savedDECoffset); */ < /* vrsi_tcpip(command, reply, 80, 1, "10.212.212.121", 5001); */ < < /* Reapply shared memory offsets onto ACU : */ --- > /* Reapply shared memory offsets onto ACU's Manual Offsets. */ > /* ACU's Rate Offsets will be zeroed in the mode change; so */ > /* preserve these for non-solar tracking */ 2590c2669 < usleep((time_t) 50000); /* Allow time for mode transition. */ --- > usleep((time_t) 60000); /* Allow time for mode transition. */ 2591a2671 > /* 0.06 s is on the reliability threshold for ACU/PDU. */ 2593c2673,2676 < sprintf(command, "OFFSET %.5f,%.5f", (OFFSET_HA+COL_HA)/cos_dec, (OFFSET_DEC+COL_DEC)); --- > /* sprintf(command, "OFFSET %lf,%lf", (OFFSET_HA+COL_HA)/cos_dec, (OFFSET_DEC+COL_DEC)); */ > haoffsum += vrsi_ha_due_rate; > decoffsum += vrsi_dec_due_rate; > sprintf(command, "OFFSET %lf,%lf", haoffsum, decoffsum); 2594a2678,2689 > old_haoffsum = haoffsum; > old_decoffsum = decoffsum; > /* V_RA = 0.0; */ > /* V_DEC = 0.0; */ > /* vrsi_harate = 0.0; */ > /* vrsi_decrate = 0.0; */ > old_ha_due_rate = 0.0; > old_dec_due_rate = 0.0; > vrsi_ha_due_rate = 0.0; > vrsi_dec_due_rate = 0.0; > d_haoff_due_rate = 0.0; > d_decoff_due_rate = 0.0;