succd: Configure hysteresis for rough and high thresholds
Add CLI flags for rough and high hysteresis and configure default values based on experiments.
This commit is contained in:
		
							parent
							
								
									0757ec58a8
								
							
						
					
					
						commit
						367e4c43a6
					
				
					 1 changed files with 10 additions and 4 deletions
				
			
		| 
						 | 
					@ -14,14 +14,18 @@ var (
 | 
				
			||||||
	flagFake                             bool
 | 
						flagFake                             bool
 | 
				
			||||||
	flagListenHTTP                       string
 | 
						flagListenHTTP                       string
 | 
				
			||||||
	flagPressureThresholdRough           = ScientificNotationValue(1e-1)
 | 
						flagPressureThresholdRough           = ScientificNotationValue(1e-1)
 | 
				
			||||||
 | 
						flagPressureThresholdRoughHysteresis = ScientificNotationValue(5e-2)
 | 
				
			||||||
	flagPressureThresholdHigh            = ScientificNotationValue(1e-4)
 | 
						flagPressureThresholdHigh            = ScientificNotationValue(1e-4)
 | 
				
			||||||
 | 
						flagPressureThresholdHighHysteresis  = ScientificNotationValue(5e-5)
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func main() {
 | 
					func main() {
 | 
				
			||||||
	flag.BoolVar(&flagFake, "fake", false, "Enable fake mode which allows to run succd for tests outside the succbone")
 | 
						flag.BoolVar(&flagFake, "fake", false, "Enable fake mode which allows to run succd for tests outside the succbone")
 | 
				
			||||||
	flag.StringVar(&flagListenHTTP, "listen_http", ":8080", "Address at which to listen for HTTP requests")
 | 
						flag.StringVar(&flagListenHTTP, "listen_http", ":8080", "Address at which to listen for HTTP requests")
 | 
				
			||||||
	flag.TextVar(&flagPressureThresholdRough, "pressure_threshold_rough", &flagPressureThresholdRough, "Threshold for opening up diffusion pump (mbar)")
 | 
						flag.TextVar(&flagPressureThresholdRough, "pressure_threshold_rough", &flagPressureThresholdRough, "Threshold for opening up diffusion pump (mbar)")
 | 
				
			||||||
 | 
						flag.TextVar(&flagPressureThresholdRoughHysteresis, "pressure_threshold_rough_hysteresis", &flagPressureThresholdRoughHysteresis, "+-Hysteresis for rough threshold (mbar)")
 | 
				
			||||||
	flag.TextVar(&flagPressureThresholdHigh, "pressure_threshold_high", &flagPressureThresholdHigh, "Threshold for enabling high voltage circuits (mbar)")
 | 
						flag.TextVar(&flagPressureThresholdHigh, "pressure_threshold_high", &flagPressureThresholdHigh, "Threshold for enabling high voltage circuits (mbar)")
 | 
				
			||||||
 | 
						flag.TextVar(&flagPressureThresholdHighHysteresis, "pressure_threshold_high_hysteresis", &flagPressureThresholdHighHysteresis, "+-Hysteresis for high threshold (mbar)")
 | 
				
			||||||
	flag.Parse()
 | 
						flag.Parse()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ctx, _ := signal.NotifyContext(context.Background(), os.Interrupt)
 | 
						ctx, _ := signal.NotifyContext(context.Background(), os.Interrupt)
 | 
				
			||||||
| 
						 | 
					@ -32,7 +36,9 @@ func main() {
 | 
				
			||||||
	d.daemonState.piraniVolts100.limit = 100
 | 
						d.daemonState.piraniVolts100.limit = 100
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	d.aboveRough.threshold = float64(flagPressureThresholdRough)
 | 
						d.aboveRough.threshold = float64(flagPressureThresholdRough)
 | 
				
			||||||
 | 
						d.aboveRough.hysteresis = float64(flagPressureThresholdRoughHysteresis)
 | 
				
			||||||
	d.aboveHigh.threshold = float64(flagPressureThresholdHigh)
 | 
						d.aboveHigh.threshold = float64(flagPressureThresholdHigh)
 | 
				
			||||||
 | 
						d.aboveHigh.hysteresis = float64(flagPressureThresholdHighHysteresis)
 | 
				
			||||||
	if flagFake {
 | 
						if flagFake {
 | 
				
			||||||
		klog.Infof("Starting with fake peripherals")
 | 
							klog.Infof("Starting with fake peripherals")
 | 
				
			||||||
		d.adcPirani = &fakeADC{}
 | 
							d.adcPirani = &fakeADC{}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue