- various improvements

This commit is contained in:
zolliker
2008-03-03 14:51:36 +00:00
parent 41b4230d76
commit 131f1144d8
6 changed files with 50 additions and 26 deletions

View File

@@ -1399,8 +1399,8 @@ void CalcMaxPower(void) {
maxCurrent = 1; /* must be 1 for Power2Percent */
h=Power2Percent(maxPowerFlt)/100;
p=h*h*resist; /* power before amplifier */
plim=2500/resist;
/* power limited by 50 V output. U*U/R=2500/R */
plim=3025/resist;
/* power limited by 55 V output. U*U/R=55*55/R */
if (p>plim) p=plim;
pa=resist*4; /* max. maxPower R*I*I (I=2 A) */
low.p = 0;
@@ -1625,7 +1625,7 @@ int ConfigAlarms(float genLimit) {
ERR_P(LscCmd(ser, "ALARM [buf1]:1,1,[r1],0,1,1"));
alarmList[k]=s->ch;
k++;
} else {
} else if (i != 4) { /* do not switch off A0 alarm */
ERR_P(LscCmd(ser, "ALARM [buf1]:0")); /* switch off unused alarms */
}
}
@@ -2630,12 +2630,18 @@ int DeviceHdl(int mode, void *base, int fd) {
}
int PidHdl(int mode, void *base, int fd) {
char oldpid[128];
if (mode==COC_WR) {
return COC_DWR;
} else if (mode==COC_DWR) {
ERR_P(LscCmd(ser,"PID [loop]:[prop],[integ],[deriv]"));
assert(sizeof oldpid == sizeof pid);
strcpy(oldpid, pid);
PidSumHdl(COC_RD, base, fd);
logfileOut(LOG_MAIN, "pid: %s\n", pid);
if (strcmp(oldpid, pid) != 0) {
ERR_P(LscCmd(ser,"PID [loop]:[prop],[integ],[deriv]"));
logfileOut(LOG_MAIN, "pid: %s\n", pid);
}
}
return 0;
OnError: return -1;

View File

@@ -1,2 +1,2 @@
#define TECS_LOG 1
#include "../logger.c"
#include "../../logger.c"

View File

@@ -13,7 +13,7 @@
#include "sys_select.h"
#define ESC_TMO 1000
#define REF_TMO 100
#define REF_TMO 50
#define HISTORY_LINES 256
#define L_ARROW 0200