compensation

This commit is contained in:
2025-03-28 15:35:59 +01:00
parent e5cc0f0a83
commit ea92860195
13 changed files with 4277 additions and 4695 deletions
Binary file not shown.
+3 -3
View File
@@ -3,7 +3,7 @@ file ../../db/CHANNEL.template{
#
pattern{ CH , UNIT}
{ 0 , deg}
{ 1 , periods}
{ 2 , periods}
{ 3 , periods}
{ 1 , deg}
{ 2 , deg}
{ 3 , deg}
}
+19
View File
@@ -70,6 +70,15 @@ record(longin, "EIB:CH_$(CH)_heycomp")
field(INP, "@CH_$(CH)_HEYCOMP")
field(PINI, "1")
}
record(longin, "EIB:CH_$(CH)_eibcomp")
{
field(DESC, "channel 0 homed")
field(SCAN, "Event")
field(EVNT, "81")
field(DTYP, "EIB li")
field(INP, "@CH_$(CH)_EIBCOMP")
field(PINI, "1")
}
#............... mbbi ..................
@@ -80,6 +89,16 @@ record(mbbi,"EIB:CH_$(CH)_REFACTIVES")
field(ZRST, "")
field(ONST, "WaitforRef")
}
#............... mbbi ..................
record(mbbi,"EIB:CH_$(CH)_eibcomps")
{
field(DTYP, "Soft Channel")
field(INP, "EIB:CH_$(CH)_eibcomp CPP")
field(ZRST, "Off")
field(ONST, "On")
field(TWST, "unknown")
}
#............... mbbo ..................
record(mbbo,"EIB:CH_$(CH)_HEYCOMPS")
+19
View File
@@ -70,6 +70,15 @@ record(longin, "EIB:CH_$(CH)_heycomp")
field(INP, "@CH_$(CH)_HEYCOMP")
field(PINI, "1")
}
record(longin, "EIB:CH_$(CH)_eibcomp")
{
field(DESC, "channel 0 homed")
field(SCAN, "Event")
field(EVNT, "81")
field(DTYP, "EIB li")
field(INP, "@CH_$(CH)_EIBCOMP")
field(PINI, "1")
}
#............... mbbi ..................
@@ -80,6 +89,16 @@ record(mbbi,"EIB:CH_$(CH)_REFACTIVES")
field(ZRST, "")
field(ONST, "WaitforRef")
}
#............... mbbi ..................
record(mbbi,"EIB:CH_$(CH)_eibcomps")
{
field(DTYP, "Soft Channel")
field(INP, "EIB:CH_$(CH)_eibcomp CPP")
field(ZRST, "Off")
field(ONST, "On")
field(TWST, "unknown")
}
#............... mbbo ..................
record(mbbo,"EIB:CH_$(CH)_HEYCOMPS")
+1640 -2120
View File
File diff suppressed because it is too large Load Diff
+1640 -2120
View File
File diff suppressed because it is too large Load Diff
+899 -427
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
+51 -21
View File
@@ -397,6 +397,27 @@ else if (!contain(s,"CH_","_lines",&num))
}
*val= eib.enc[num].HeyComp;
}
else if (!contain(s,"CH_","_CFGERROR",&num))
{
if ( EIB_ValidEncoder(num) )
{
printf("SPAL: <%s>, num = %li not available\n",s,num);
return(MON_ERROR);
}
*val=eib.enc[num].ConfigurationError;
}
else if (!contain(s,"CH_","_EIBCOMP",&num))
{
if ( EIB_ValidEncoder(num) )
{
printf("SPAL: <%s>, num = %li not available\n",s,num);
return(MON_ERROR);
}
if (eib.enc[num].ConfigurationError)
*val=2; /* die Achse wurde noch nich initialisiert,oder es trat ein Fehler auf */
else
*val=eib.enc[num].Comp;
}
else
{
printf("EIB_GpaL: Unkown parameter <%s>\n",s);
@@ -594,9 +615,11 @@ int i,j;
eib.enc [i].iface = 0;
eib.enc [i].HOMED = 0; /* hat keine Ref */
eib.enc [i].LastRef = 99;
eib.enc [i].RefPos = 0;
eib.enc [i].RefPos = 0;
eib.enc [i].RefActive = 0;
eib.enc [i].Interpolation = 4096;
eib.enc [i].ConfigurationError = -1;
EIB_Clear_RingBuffer(i);
for (j=0;j<NUMHEY;j++) eib.enc [i].Correction[j]=0;
@@ -1356,7 +1379,7 @@ int EIB_Init_Enc(int enc_nr) /* initialize selected encoder */
RefSep, /* nominal increment between two fixed reference marks */
EIB7_HS_None,
EIB7_LS_None,
Comp, /* signal compensation on */
Comp, /* signal compensation on */
EIB7_BW_High, /* signal bandwidth: high */
EIB7_CLK_Default, /* not used for incremental interface */
EIB7_RT_Long, /* not used for incremental interface */
@@ -1380,14 +1403,17 @@ int EIB_Init_Enc(int enc_nr) /* initialize selected encoder */
switch (err)
{
case EIB7_NoError : printf("EIB_Init_Enc (%i): EIB_GetEncoderData all fine.\n",enc_nr);
eib.enc[enc_nr].ConfigurationError = 0;
break;
case EIB7_ConfOptIncons : sprintf(Msg,"EIB_Init_Enc (%i): EIB7_ConfOptIncons.",enc_nr);
eib.enc[enc_nr].ConfigurationError = 1;
MonError(Msg);
break;
default : sprintf(Msg,"EIB_Init_Enc (%i): error %li not handled.",enc_nr,err);
eib.enc[enc_nr].ConfigurationError = -1;
}
@@ -1865,18 +1891,20 @@ int EIB_Read(int enc_nr, double *value)
default : lref = 0; printf("EIB_READ: Invalid RefMarks (%i)\n",eib.enc[enc_nr].RefMarks);
}
// position = data.pos - data.refc;
position = data.pos - lref;
if (eib.enc[enc_nr].HeyComp ==1) /* Heydemann correction */
{
index = (int) (data.interpolate * 1024);
index = (int) (data.interpolate) >> 2 ;
if ((index>0)&& (index<1024)) corr = eib.enc[enc_nr].Correction[index]; else corr = 0;
position += corr ;
if (verbose==1) printf(" Pos(%i) = %lli fraction %i index = %i correction = %i \n",enc_nr, data.pos, data.interpolate,index, corr );
}
// position = data.pos - data.refc;
position = data.pos - lref;
CheckError(EIB7IncrPosToDouble(position,value));
@@ -1922,21 +1950,23 @@ void EIB_ShowEncoder(ENC enc)
//Sleep(1);
printf(" axis-handle = %i\n",*(enc.axishandle));
printf(" Name = %s\n", enc.Name);
printf(" Interface = %li\n", enc.iface );
printf(" Name = %s\n", enc.Name);
printf(" Interface = %li\n", enc.iface);
printf(" HOMED = %i (0 no ref, 1 has ref)\n", enc.HOMED);
printf(" SigV = %i\n", enc.SigV);
printf(" RefMarks = %i\n", enc.RefMarks);
printf(" RefSep = %i\n", enc.RefSep);
printf(" RefActive = %i\n", enc.RefActive);
printf(" LastRef = %li\n", enc.LastRef);
printf(" RefcPos = %5.3f\n", enc.RefPos);
printf(" Comp = %i\n", enc.Comp);
printf(" HeyComp = %i\n", enc.HeyComp);
printf(" HeyFile = <%s>\n", enc.HeyFileName);
printf(" NextHist = %i\n", enc.NextHist);
printf(" AddPoints = %i\n", enc.AddPoints);
printf(" Interpolation= %i\n", enc.Interpolation);
printf(" SigV = %i\n", enc.SigV);
printf(" RefMarks = %i\n", enc.RefMarks);
printf(" RefSep = %i\n", enc.RefSep);
printf(" RefActive = %i\n", enc.RefActive);
printf(" LastRef = %li\n", enc.LastRef);
printf(" RefcPos = %5.3f\n", enc.RefPos);
printf(" Comp = %i\n", enc.Comp);
printf(" HeyComp = %i\n", enc.HeyComp);
printf(" HeyFile = <%s>\n", enc.HeyFileName);
printf(" NextHist = %i\n", enc.NextHist);
printf(" AddPoints = %i\n", enc.AddPoints);
printf(" Interpolation= %i\n", enc.Interpolation);
printf(" ConfigurationError = %i\n",enc.ConfigurationError);
switch ( enc.EncType)
{
case 0 : printf(" EncType = %1i (Linear)\n",enc.EncType);
+3 -1
View File
@@ -57,7 +57,9 @@ struct T_enc
unsigned int Interpolation; /* 4096 default */
int HeyComp; /* Heydemanncompensation off=0, on=1 */
char HeyFileName[120];
HEYARRAY Correction;
HEYARRAY Correction;
int ConfigurationError; /* Falls bei der Konfiguration des Encoders etwas schiefgeht (1) */
/* oder er noch nicht konfiguriert ist (-1), oder alles i.o ist (0) */
};
typedef struct T_eib EIB;
+3 -3
View File
@@ -8,7 +8,7 @@
# RON
E0_Name "RON"
E0_iface 2049
E0_iface 2049 # incremental encoder, 11 uA
E0_RefMarks 1 # How meany reference marks (1 standard,2 = distance coded)
E0_EncType 1 # 0 linear, 1 rotary
E0_Lines 36000 # per mm for AxeType = 0, per revolution for AxeType = 1:
@@ -19,7 +19,7 @@
# X05DA
E1_Name "X05DA"
E1_iface 1
E1_iface 1 # incremental encoder 1 Vpp
E1_RefMarks 2 # How meany reference marks (1 standard,2 = distance coded)
E1_EncType 1 # 0 linear, 1 rotary
E1_Lines 36000 # per mm for AxeType = 0, per revolution for AxeType = 1:
@@ -31,7 +31,7 @@
# ROD
E2_Name "ROD"
E2_iface 1
E2_iface 1 # incremental encoder 1 Vpp
E2_RefMarks 1 # How meany reference marks (1 standard,2 = distance coded)
E2_EncType 1 # 0 linear, 1 rotary
E2_Lines 3600 # per mm for AxeType = 0, per revolution for AxeType = 1: