1 #ifndef GCP_UTIL_CBASSPOWERSUPPLY_H
2 #define GCP_UTIL_CBASSPOWERSUPPLY_H
20 #include "gcp/util/common/Directives.h"
21 #include "gcp/util/common/FdSet.h"
27 #define PS_MAX_READ_BUF 128
29 #define PS_TIMEOUT_USEC 200000
30 #define PS_READ_ATTEMPTS_TIMEOUT 5
31 #define PS_SETVOLT_TIMEOUT 10
32 #define PS_BUF_LIMIT 'x'
33 #define PS_VOLT_STEPSIZE 0.02
34 #define PS_VOLT_GATE_ALLOW 0.03
35 #define PS_VOLT_CURRENT_ALLOW 0.03
36 #define PS_VOLT_WAIT 250 // ms
42 #define PS_VOLT_M_GATE -0.002941 // volts/DU
43 #define PS_VOLT_B_GATE 0.6169 // volts
44 #define PS_VOLT_M_DRAIN 0.00982 // volts/DU
45 #define PS_VOLT_B_DRAIN 0.01089 // volts
46 #define PS_GAIN_M_CURRENT 0.0491 // mA/DU
47 #define PS_GAIN_B_CURRENT 0.1275 // mA
49 const float drain_stepsize[6] = {3.914,5.180,7.789,3.924,5.185,7.777};
50 const float current_stepsize[6] = {4.33,4.37,7.36,4.35,4.38,7.43};
51 const float max_drainvolt[6] = {3.730,4.930,7.399,3.730,4.930,7.409};
52 const float mindraincurrent_slope[6] = {0,0,0,0,0,0};
53 const float mindraincurrent_intercept[6] = {0,0,0,0,0,0};
54 const float maxdraincurrent_slope[6] = {4.74,4.67,4.61,4.66,4.58,4.64};
55 const float maxdraincurrent_intercept[6] = {0.046,0.14,0.14,0.076,0.084,0.19};
56 const int nonlin_current = 5;
57 const int nonlin_gate = 145;
105 char returnString_[PS_MAX_READ_BUF];
129 int psWrite(
char* command,
int len);
140 void psGetVoltageOld();
145 int psSetVoltage(
int modsel,
int stagesel,
float gatevolt,
float currvolt);
164 void printBits(
unsigned char feature);
CbassPowerSupply()
Definition: CbassPowerSupply.cc:32
void psDisconnect()
Definition: CbassPowerSupply.cc:126
float retVal_
Definition: CbassPowerSupply.h:104
bool connected_
Definition: CbassPowerSupply.h:89
gcp::util::FdSet fdSet_
Definition: CbassPowerSupply.h:82
void psConnect()
Definition: CbassPowerSupply.cc:54
int psWrite(char *command)
Definition: CbassPowerSupply.cc:157
int fd_
Definition: CbassPowerSupply.h:99
int psSetVoltage(int modsel, int stagesel, float gatevolt, float currvolt)
Definition: CbassPowerSupply.cc:661
bool queryBias_
Definition: CbassPowerSupply.h:94
int issueCommand(Command type)
void psSetModule(char *modStage)
Definition: CbassPowerSupply.cc:411
void psGetVoltage()
Definition: CbassPowerSupply.cc:601
int waitForResponse()
Definition: CbassPowerSupply.cc:1024
virtual ~CbassPowerSupply()
Definition: CbassPowerSupply.cc:43
Definition: CbassPowerSupply.h:65
int psGetAllVoltages()
Definition: CbassPowerSupply.cc:940
void psChangeVoltage(char *voltRequest)
Definition: CbassPowerSupply.cc:478