Browse Source

Updated APR status

Thomas Thümmler 9 months ago
parent
commit
eccc5d9262
1 changed files with 10 additions and 50 deletions
  1. 10 50
      SDS_status_main.php

+ 10 - 50
SDS_status_main.php

@@ -762,62 +762,24 @@ if (($MSmode == 5) or ($MSmode == 4))
 	// Post Regulation Current Monitor
 
 	$U_ist = abs($adeiValue[10][0]);
-	$I_ist = abs($adeiValue[10][28]);
-	$PID_setpoint = abs($adeiValue[10][30]);
 	$PR_hw_current = abs($adeiValue[10][31]);
-	$hv_switch1102_k65 = $adeiValue[35][1];
-	$hv_switch1103_k35 = $adeiValue[35][2];
-	$R_K65 = 54.5e6;
-	$R_K35 = 58.65e6;
-	if ($hv_switch1103_k35+$hv_switch1102_k65 == 2) $R_ges = 33.057e6;  // manual entry of R_ges with K65 and K35 connected 
-	else $R_ges = (1-$hv_switch1103_k35)*$R_K35+(1-$hv_switch1102_k65)*$R_K65;  // choose just one divider
-
-	
-	$I_noPR = $U_ist / $R_ges * 1000.0;
-	$I_PR = $I_ist - $I_noPR;
+	$I_PR = $PR_hw_current;//$I_ist - $I_noPR;
 	$APR_on = abs($adeiValue[10][29]);
-
-	$verbose = false;  // switch for status outputs, dev mode
+	$P_PR = $U_ist * $I_PR/1000;	// 28W limit, 33 kV mit 0,7 mA ist Maximum für stabilen Betrieb
 	
-	// 28W limit, 33 kV mit 0,7 mA ist Maximum für stabilen Betrieb
-	$P_PR = 0.0;
-	If ($I_PR > 0.01) {  $P_PR = $U_ist * $I_PR/1000; }
-	else $I_PR = 0.0;
-
 	$pic = "postreg";
-	
-	if ($verbose) echo '<br><br><br>';
-	if ($I_PR < 0.1) {  if ($verbose) echo 'PR off<br>';  $pic = $pic."Off";}
-	else {  if ($I_PR < 0.46) {   if ($verbose) echo 'PR_current low';    $pic = $pic."Warn";}
-	  else if (($I_PR >= 0.46) && ($I_PR <= 0.8)) {   if ($verbose) echo 'PR_current OK'; $pic = $pic."On";}
-	  else if ($I_PR > 0.8) {  if ($verbose) echo 'PR_current overload';   $pic = $pic."Alarm";}
-
-	  if ($verbose) {
-	    echo '<br>';			    
-	    if ($P_PR < 23) echo "    PR_wattage in range";
-	    else if ($P_PR < 28) echo "    PR_wattage high";
-	    else if ($P_PR > 28) echo "    PR_wattage CRITICAL";
-	    echo '<br>';
+	if ($I_PR > 0.1)
+	  {
+	    if ($I_PR < 0.46) {$pic = $pic."Warn";}
+	    else if (($I_PR >= 0.46) && ($I_PR <= 0.8)) {$pic = $pic."On";}
+	    else if ($I_PR > 0.8) {$pic = $pic."Alarm";}
 	  }
-	}
-
-	if ($verbose) {
-	  echo '<br>';			    
-	  
-	  echo 'R_fixed = '.$R_ges.' MOhm, ';
-	  echo 'R_Divider = '.$U_ist/($I_ist*1000).' MOhm, ';
-	  echo 'I_ist = '.$I_ist.' mA,  ';
-	  echo 'I_noPR = '.$I_noPR.' mA, ';	
-	  echo 'I_PR = '.$I_PR.' mA, ';
-	  echo 'P_PR = '.$P_PR.' W<br>';
-	}
 	
-
 	$pos_y = 501;
 	$pos_x = 455;
 	
 	$color = "#000000";
-	placePic($pos_y,$pos_x, $pic.".png", 30, "Estimated status of HV post regulation &#010green  = normal operation &#010gray    = off &#010red      = current too high &#010orange = current too low");
+	placePic($pos_y,$pos_x, $pic.".png", 30, "Status of HV post regulation &#010green  = normal operation &#010gray    = off &#010red      = current too high &#010orange = current too low");
 
 	if ($I_PR < 0.1)
 	  {
@@ -825,14 +787,12 @@ if (($MSmode == 5) or ($MSmode == 4))
 	  }
 	else
 	  {
-	    placeTextWithLink($pos_y+31,$pos_x-15, sprintf('%.2F mA', $I_PR), 60, 2, $color, "Estimated current through post regulation triode shunt. 0.46-0.8 mA for optimal performance.", $adeiChannel[10][28]);
-	    placeTextWithLink($pos_y+45,$pos_x-14, sprintf('%2.0F W', $P_PR), 60, 2, $color, "Estimated power consumption of post regulation triode shunt. Must be < 28 W.", $adeiChannel[10][28]);
+	    placeTextWithLink($pos_y+31,$pos_x-15, sprintf('%.2F mA', $I_PR), 60, 2, $color, "Current through post regulation triode shunt. 0.46-0.8 mA for optimal performance.", $adeiChannel[10][28]);
+	    placeTextWithLink($pos_y+45,$pos_x-14, sprintf('%2.0F W', $P_PR), 60, 2, $color, "Power consumption of post regulation triode shunt. Must be < 28 W.", $adeiChannel[10][28]);
 
 	    if ($APR_on) placeTextWithLink($pos_y+57,$pos_x-4, "APR ON", 40, 0, "#40AA40", "Advanced Post Regulation (APR) status.", $adeiChannel[10][29]);
 	  
 	    if ($PID_setpoint > 9.0) placeTextWithLink($pos_y+66,$pos_x-54, "APR setpoint limit", 140, 0, "#FF0000", "APR setpoint at 90% of limit.", $adeiChannel[10][30]);
-
-	    if (abs($I_PR - $PR_hw_current) > 0.1) placeTextWithLink($pos_y+75,$pos_x-54, "PR current mismatch", 140, 0, "#FF0000", "Estimated and actual current of post regulation don't match.", $adeiChannel[10][31]);
 	  }    
         
   }  // end of PCS7 mode switch