Commit 930d7af8 authored by Jörg Weingrill's avatar Jörg Weingrill
Browse files

added calculated values when ra nd de is set

parent 5ef30476
This diff is collapsed.
......@@ -4,7 +4,9 @@
<Declaration><![CDATA[PROGRAM TelescopeControl
VAR
telescope_mode : E_TelescopeMode;
jd, altitude, azimut, lst: LREAL;
jd, altitude, azimut, lst,
// values calulated when ra and dec are set by TCS
altitude_calc, azimut_calc: LREAL;
(* Declination section *)
fbDeclinationAxis : FB_Axis;
......@@ -37,6 +39,7 @@ VAR
fbHourAxisJog : FB_AxisJog;
Hourangle_real,
Hourangle_current,
Hourangle_calc,
Hourangle_lag: LREAL;
Hourangle_lagerror: BOOL;
Hourangle_set: LREAL := -720.0;
......@@ -86,13 +89,13 @@ see https://gitlab.aip.de/bmk10k/telescope_firmware/snippets/5
// boolean, true: go into park position, ready to stow telescope, unset track/goto
park: BOOL;
// apparent right ascension, degrees, double
ra: LREAL;
ra: LREAL := -1.0;
// apparent declination, degrees, double
de: LREAL;
de: LREAL := 0.0;
// boolean, TRUE: MOVE telescope TO last ra/de AND start tracking. Set 'goto' TO FALSE, IF TRUE. FALSE: Stop tracking as soon as possible
track: BOOL;
// apparent hour anlge, degrees, double, south=zero, west>0)
tau: LREAL;
tau: LREAL := 0.0;
// boolean, TRUE: MOVE telescope TO tau/de AND stop there. Set track TO FALSE, IF TRUE. FALSE: no effect.)
goto: BOOL;
// boolean, TRUE: Stop motion OF telescope immediately, set goto AND track TO FALSE. FALSE: Allow motion OF telescope again via track/goto).
......@@ -158,10 +161,12 @@ VAR CONSTANT
latitude: LREAL := 52.404977;
*)
(* Chile site : *)
// telescope site longitude, source: Google
// telescope site longitude, source: Google
longitude: LREAL := -70.201280;
// telescope site latitude, source: Google
latitude: LREAL := -24.598464;
// telescope site height above sea level: source Wikipedia Cerro Armazones Observatory
height: LREAL := 2810.0;
siderial_velocity: LREAL := 360.0 / 86164.099;
// TODO: change to final value
position_velocity: LREAL := 1.0;
......@@ -232,6 +237,16 @@ hadec2altaz(ha := hourangle_real,
alt => altitude,
az => azimut);
eq2hor(ra := ra,
Dec := de,
JD := jd,
LAT := latitude,
LON := longitude,
ALTITUDE := height,
alt => altitude_calc,
az => azimut_calc,
ha => Hourangle_calc);
poweron_delay(IN := TRUE, PT := T#1S, Q =>);
homing_pulse(IN := poweron_delay.Q, PT := T#1S, Q =>);
HomeTrigger(CLK := (calibrate OR homing_pulse.Q OR power OR gohome OR park) AND (GVL_Telescope.Option1 OR GVL_Telescope.Option2), Q =>);
......@@ -349,9 +364,14 @@ IF telescope_mode = E_TelescopeMode.automatic THEN
END_IF
IF goto THEN // move telescope to tau/de and stop there. Set track to false, if true. False: no effect.
track := FALSE;
// TODO: check altitude
Declination_set := de;
//Hourangle_set := lst - ra;
IF tau >= 0.0 AND tau < 360.0 THEN
Hourangle_set := tau;
ELSIF ra >= 0.0 AND ra < 360.0 THEN
Hourangle_set := Hourangle_calc;
END_IF
Declination_velocity := position_velocity;
Hourangle_velocity := position_velocity;
IF DeclinationDone THEN
......@@ -546,7 +566,11 @@ GVL_MainControl.ControlLamp := DeclinationError OR HourangleError OR
<LineId Id="346" Count="1" />
<LineId Id="68" Count="1" />
<LineId Id="278" Count="0" />
<LineId Id="70" Count="5" />
<LineId Id="70" Count="4" />
<LineId Id="1281" Count="0" />
<LineId Id="75" Count="0" />
<LineId Id="1283" Count="7" />
<LineId Id="1282" Count="0" />
<LineId Id="79" Count="0" />
<LineId Id="1112" Count="0" />
<LineId Id="80" Count="0" />
......@@ -612,7 +636,12 @@ GVL_MainControl.ControlLamp := DeclinationError OR HourangleError OR
<LineId Id="557" Count="0" />
<LineId Id="560" Count="0" />
<LineId Id="558" Count="0" />
<LineId Id="748" Count="2" />
<LineId Id="748" Count="0" />
<LineId Id="1296" Count="1" />
<LineId Id="1299" Count="1" />
<LineId Id="1298" Count="0" />
<LineId Id="1301" Count="0" />
<LineId Id="750" Count="0" />
<LineId Id="744" Count="0" />
<LineId Id="1223" Count="2" />
<LineId Id="559" Count="0" />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment