Jump to content
OMRON Forums

Averaging encoders


leandro.martins

Recommended Posts

Hello all,

 

I am controlling a direct-drive 3-phase brushless that have 2 encoders, disposed 180 degrees apart from each other.

 

To minimize the eccentricity errors from the encoder's scale, I'm trying to take the average of both to use as position feedback, but when I post-processed the data from Motor[1].ActPos, Gate3[0].Chan[0].ServoCapt (main encoder), Gate3[1].Chan[0].ServoCapt (auxiliar encoder), it seems it is using only the Gate3[0].Chan[0].ServoCapt as the source.

 

//******************************************************************

// Encoder Table - Averaging encoders settings

 

EncTable[31].type = 8 // Addition of two sources

 

EncTable[31].pEnc = Gate3[0].Chan[0].ServoCapt.a // Ch. 1

EncTable[31].pEnc1 = Gate3[1].Chan[0].ServoCapt.a // Ch. 5

EncTable[31].index1 = 0

EncTable[31].index2 = 0

EncTable[31].index3 = 0

EncTable[31].index4 = 0

EncTable[31].index5 = 0

EncTable[31].ScaleFactor = (1/2)*(1/256)

//******************************************************************

 

Is there some point that I'm missing?

 

Tks

Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

I issued a $$$*** and downloaded the following code on my PMAC. My motor position moves from either encoder. Are you sure the code is downloaded and those are the current values in PMAC? Type the name of a structure element in the terminal to check it's value.

 

EncTable[1].type = 8
EncTable[1].pEnc = Gate3[0].Chan[0].ServoCapt.a 
EncTable[1].pEnc1 = Gate3[0].Chan[1].ServoCapt.a
EncTable[1].index1 = 0
EncTable[1].index2 = 0
EncTable[1].index3 = 0
EncTable[1].index4 = 0
EncTable[1].index5 = 0
EncTable[1].ScaleFactor = (1/2)*(1/256)
Motor[1].ServoCtrl=1

Link to comment
Share on other sites

Hello Eric

 

I checked the values of the structures and it seems as expected (first image)

 

Using the fft of the plot tool of the IDE, we can see that there are some frequencies that appear in Gate3[1].Chan[0].ServoCapt doesn´t have the same amplitude as the Motor[1].ActPos frequencies (second image)

 

On another hand, when we plot the fft of Gate3[0].Chan[0].ServoCapt and Motor[1].ActPos all the curve is superimposed (third image)

Terminal_encoderAveraging.png.b9e57a817ed6fca86398d0dc0f6a177e.png

Gate1Chan0_Frequencies.thumb.png.519e6fb138519ff17da9c72fd41eb134.png

Gate0Chan0_Frequencies.thumb.png.200c5adc73685810748407a5aa1a071b.png

Link to comment
Share on other sites

It´s not possible to move by hand, so the only way is to disconnect one of the encoders, but for this, I will need to reconfigure some registers

 

Now is as it follows:

 

Motor[1].pEnc=EncTable[31].a

Motor[1].pEnc2=EncTable[25].a

 

EncTable[31] is configured as the previous post, trying to make the average

And EncTable[25] is using only Gate3[1].Chan[0] as source.

 

Unfortunately, the system will be available for tests next Monday.

 

Eric, is it possible to have some relation in use Gate3[0] and Gate3[1] in the average operation? Or maybe the or the number of EncTables?

 

Thanks for the attention.

Link to comment
Share on other sites

Just a thought here …

 

In a Type 8 ECT entry, pEnc and pEnc1 typically do not point directly to the encoders’ hardware channels but to the ECT entries of each of the processed encoders’ hardware channels:

EncTable[m].type = 1

EncTable[m].pEnc = Gate3[0].Chan[0].ServoCapt.a

. . .

EncTable[l].type = 1

EncTable[l].pEnc = Gate3[1].Chan[0].ServoCapt.a

. . .

EncTable[l].type = 8

EncTable[n].pEnc = EncTable[m].PrevEnc.a

EncTable[n].pEnc1 = EncTable[l].PrevEnc.a

 

This should be done anyway to prevent any “roll-over” issues with the source HDW.

 

Maybe the ECT behaves in an unexpected way when looking directly at the HDW.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...