Browse Source

updated post regulation status display

switch from current to current and power limits.
upper limit for current at 0.95 mA, which limits current for lower voltages U < 25 kV
upper limit for power at 28 W, which limits the current for high voltages to I < 0.8 mA
Thomas Thümmler 6 months ago
parent
commit
3c2393cd08
1 changed files with 25 additions and 13 deletions
  1. 25 13
      SDS_status_main.php

+ 25 - 13
SDS_status_main.php

@@ -764,26 +764,29 @@ if (($MSmode == 5) or ($MSmode == 4))
 	// Post Regulation Current Monitor
 
 	$U_ist = abs($adeiValue[10][0]);
-	$PR_hw_current = abs($adeiValue[10][31]);
-	$I_PR = $PR_hw_current;//$I_ist - $I_noPR;
 	$APR_on = abs($adeiValue[10][29]);
-	$P_PR = $U_ist * $I_PR/1000;	// 28W limit, 33 kV mit 0,7 mA ist Maximum für stabilen Betrieb
+	$PID_setpoint = abs($adeiValue[10][30]);
+	$I_PR = abs($adeiValue[10][31]);
+	$P_PR = $U_ist * $I_PR/1000;
+	
+	// low voltage U < 25 kV, high voltage up to 33 kV, not higher.
+	// set limits to make sure not to exceed 28W limit or 0.95 mA for low voltages
+	// at high voltages limit to 24W or 0,7 mA for stable operation
 	
 	$pic = "postreg";
-	if ($I_PR > 0.1)
+	if ($I_PR >= 0.1)
 	  {
 	    if ($I_PR < 0.46) {$pic = $pic."Warn";}
-	    else if (($I_PR >= 0.46) && ($I_PR <= 0.82)) {$pic = $pic."On";}
-	    else if ($I_PR > 0.8) {$pic = $pic."Alarm";}
+	    else if (($I_PR >= 0.46) && ($I_PR <= 0.95) && ($P_PR < 28)) {$pic = $pic."On";}
+	    else if (($I_PR > 0.95) | ($P_PR >= 28)) {$pic = $pic."Alarm";}
 	  }
-  	else $pic = $pic."Off";
-
+	else $pic = $pic."Off";
 	
 	$pos_y = 501;
 	$pos_x = 455;
 	
 	$color = "#000000";
-	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");
+	placePic($pos_y,$pos_x, $pic.".png", 30, "Status of HV post regulation &#010green  = normal operation &#010gray    = off &#010red      = current or power too high &#010orange = current too low");
 
 	if ($I_PR < 0.1)
 	  {
@@ -791,12 +794,21 @@ if (($MSmode == 5) or ($MSmode == 4))
 	  }
 	else
 	  {
-	    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]);
+	    placeTextWithLink($pos_y+31,$pos_x-15, sprintf('%.2F mA', $I_PR), 60, 2, $color,
+			      "Current through post regulation triode shunt. 0.46-0.95 mA as long as power < 28 W 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 to prevent damage to triode.",
+			      $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 ($APR_on) placeTextWithLink($pos_y+57,$pos_x-4, "APR ON", 40, 0, "#40AA40",
+					   "Advanced Post Regulation (APR) status. &#010Correction at ".sprintf('%.2F &#037;', 10*$PID_setpoint).".",
+					   $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 ($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]);
 	  }    
         
   }  // end of PCS7 mode switch