Jump to content
OMRON Forums

Rollover in Motor[x].ActPos causing waveform distortion?


tanakakai
 Share

Recommended Posts

I'll start off with an image of what I'm seeing. The ActPos is coming from a Renishaw BiSS absolute encoder tied to the end of one of our magnetostrictive actuators.

 

http://i.imgur.com/vbGaQmX.png

 

I have convinced myself this is not an issue with anything mechanical in our system since at all frequencies and drive levels the jump is a single data point. I'm having trouble finding where the problem is coming from, can anyone explain the entire chain of data from BiSS in to the ActPos register? I've posted my Renishaw code and motor config below in case I changed something that would be affecting this.[/code]

 

//--------------------------------------------------------------------------------
// Encoder Setup: Renishaw RESOLUTE encoder (Biss-C Unidirectional)
//--------------------------------------------------------------------------------

#define SingleTurnRes        26

//System Timing
Sys.ServoPeriod = 8427*3/117694.8;
Sys.PhaseOverServoPeriod = 1/3;

//Gate Setup
Gate1[6].PwmPeriod = 6527/2;  // Set PWM freq to 9.034 kHz
Gate1[6].PhaseClockDiv = 0;  // Set phase clock freq to 9.034 kHz
Gate1[6].ServoClockDiv = 2;  // Set servo clock freq to 2.33 kHz
Gate1[6].HardwareClockCtrl = 2258;  // Set Encoder sample clock to 4.9 MHz, others at default
Gate1[6].PwmDeadTime = 0;  // Dead time to zero per Copley/Delta Tau app note


//Renishaw Encoder Setup
ptr GlobalRegister->u.io:$A0007C.8.24;
GlobalRegister=$18000B        // Global Control register, 2 MHz Clock setting

ptr Chan1Reg->u.io:$A00020.8.24;
Chan1Reg = $211480 + SingleTurnRes    // Ch1 Control register, 26-Bit EnDat Encoder

ptr PosReg1->u.io:$A00000.8.24;
ptr PosReg2->u.io:$A00004.8.24;

EncTable[1].type=2;        // 24+8 bit read entry
EncTable[1].pEnc = Sys.piom + $A00000;    // address of lower 24 bit
EncTable[1].pEnc1 = Sys.piom + $A00004;    // address of upper 8 bits
EncTable[1].index1 = 32-SingleTurnRes;                    // left shift for sign adjustment 32-26=6
EncTable[1].index2 = 0;
EncTable[1].index3 = 0;
EncTable[1].index4 = 0;
EncTable[1].ScaleFactor = 1/exp2(32-SingleTurnRes);    // scale back to offset the left adjustment done by index2
EncTable[1].MaxDelta = 50000 * 256;

//Motor 5 Setup (PWM Output)
Motor[5].pDac = Acc24E2[6].Chan[0].Pwm[2].a
Motor[5].ServoCtrl=0;
Motor[5].pLimits=0 ; 
Motor[5].pEnc = EncTable[1].a;
Motor[5].pEnc2 = EncTable[1].a;
Motor[5].Desired.Pos = 0;
Motor[5].pAbsPos = Acc84E[0].Chan[0].SerialEncDataA.a;
Motor[5].AbsPosFormat = $00081A08;

Motor[5].Ctrl = Sys.PosCtrl;  //Set output for Open-Loop output
Motor[5].FatalFeLimit = 0; //Prevent disable from over error limit
Motor[5].MaxSpeed=300000000;

Motor[5].AbortTa=-1;

Link to comment
Share on other sites

  • Replies 10
  • Created
  • Last Reply

Top Posters In This Topic

Try the following settings in your EncTable:

 

EncTable[1].type=1
EncTable[1].index1=8
EncTable[1].index2=8
EncTable[1].index3=0
EncTable[1].index4=0
EncTable[1].index5=0
EncTable[1].pEnc1=Sys.pushm
EncTable[1].pEnc=Acc84E[0].Chan[0].SerialEncDataA.a
EncTable[1].MaxDelta=0
EncTable[1].ScaleFactor=1/256
EncTable[1].TanHalfPhi=0
EncTable[1].CoverSerror=0

Link to comment
Share on other sites

  • 1 month later...

Sorry to take so long in replying, another project needed my attention. I have implemented the code you suggested and it did not solve the issue. Again I have tested multiple drive levels and frequencies and they all display the same single data point length for the jump in values. I have noticed that they sometimes occur at different values, not sure if this means I'm looking for a mechanical issue now or if it could still be linked to the Delta Tau programming.

 

I've also observed sing data point spikes in the results as well:

 

http://imgur.com/cQuHkSt.png

 

Try the following settings in your EncTable:

 

EncTable[1].type=1
EncTable[1].index1=8
EncTable[1].index2=8
EncTable[1].index3=0
EncTable[1].index4=0
EncTable[1].index5=0
EncTable[1].pEnc1=Sys.pushm
EncTable[1].pEnc=Acc84E[0].Chan[0].SerialEncDataA.a
EncTable[1].MaxDelta=0
EncTable[1].ScaleFactor=1/256
EncTable[1].TanHalfPhi=0
EncTable[1].CoverSerror=0

Link to comment
Share on other sites

I made some modifications in your original settings. See if this fixes your problem:

 

//--------------------------------------------------------------------------------
// Encoder Setup: Renishaw RESOLUTE encoder (Biss-C Unidirectional)
//--------------------------------------------------------------------------------

#define SingleTurnRes        26

//System Timing
Sys.ServoPeriod = 8427*3/117694.8;
Sys.PhaseOverServoPeriod = 1/3;

//Gate Setup
Gate1[6].PwmPeriod = 6527/2;  // Set PWM freq to 9.034 kHz
Gate1[6].PhaseClockDiv = 0;  // Set phase clock freq to 18.068kHz (NOT 9.034 kHz - this comment was wrong)
Gate1[6].ServoClockDiv = 2;  // Set servo clock freq to 6.023 kHz
Gate1[6].HardwareClockCtrl = 2258;  // Set Encoder sample clock to 4.9 MHz, others at default
Gate1[6].PwmDeadTime = 0;  // Dead time to zero per Copley/Delta Tau app note


//Renishaw Encoder Setup
ptr GlobalRegister->u.io:$A0007C.8.24;
//GlobalRegister=$18000B        // Global Control register, 4MHz (Not 2MHz - this comment was wrong) Clock setting
// Try the following:
GlobalRegister=$18020B        // Global Control register,4MHz Clock setting, encoder read on rising edge of servo clock

ptr Chan1Reg->u.io:$A00020.8.24;
Chan1Reg = $211480 + SingleTurnRes    // Ch1 Control register, 26-Bit EnDat Encoder

ptr PosReg1->u.io:$A00000.8.24;
ptr PosReg2->u.io:$A00004.8.24;

EncTable[1].index1=8
EncTable[1].index2=8
EncTable[1].index3=0
EncTable[1].index4=0
EncTable[1].index5=0
EncTable[1].pEnc1=Sys.pushm
EncTable[1].pEnc=Acc84E[0].Chan[0].SerialEncDataA.a
EncTable[1].MaxDelta=0
EncTable[1].ScaleFactor=1/256
EncTable[1].TanHalfPhi=0
EncTable[1].CoverSerror=0

//Motor 5 Setup (PWM Output)
Motor[5].pDac = Acc24E2[6].Chan[0].Pwm[2].a
Motor[5].ServoCtrl=0;
Motor[5].pLimits=0 ; 
Motor[5].pEnc = EncTable[1].a;
Motor[5].pEnc2 = EncTable[1].a;
Motor[5].Desired.Pos = 0;
Motor[5].pAbsPos = Acc84E[0].Chan[0].SerialEncDataA.a;
Motor[5].AbsPosFormat = $00081A08;

Motor[5].Ctrl = Sys.PosCtrl;  //Set output for Open-Loop output
Motor[5].FatalFeLimit = 0; //Prevent disable from over error limit
Motor[5].MaxSpeed=300000000;

Motor[5].AbortTa=-1;

Link to comment
Share on other sites

I made the changes to the "GlobalRegister" and did not see any change in clipping behavior. I did notice that there was less noise, but I'm not sure if this is a coincidence or not. The data I am seeing now look more like those I collected before testing the last code you gave me.

 

http://imgur.com/PgaH0VR.png

 

The problem also happens multiple times per cycle (and is repeatable). This is a 1Hz sine wave input with a sample taken every servo cycle (.215 ms/sample).

 

http://i.imgur.com/zBeuCvv.png

 

I made some modifications in your original settings. See if this fixes your problem:

 

//--------------------------------------------------------------------------------
// Encoder Setup: Renishaw RESOLUTE encoder (Biss-C Unidirectional)
//--------------------------------------------------------------------------------

#define SingleTurnRes        26

//System Timing
Sys.ServoPeriod = 8427*3/117694.8;
Sys.PhaseOverServoPeriod = 1/3;

//Gate Setup
Gate1[6].PwmPeriod = 6527/2;  // Set PWM freq to 9.034 kHz
Gate1[6].PhaseClockDiv = 0;  // Set phase clock freq to 8.068kHz (NOT 9.034 kHz - this comment was wrong)
Gate1[6].ServoClockDiv = 2;  // Set servo clock freq to 2.33 kHz
Gate1[6].HardwareClockCtrl = 2258;  // Set Encoder sample clock to 4.9 MHz, others at default
Gate1[6].PwmDeadTime = 0;  // Dead time to zero per Copley/Delta Tau app note


//Renishaw Encoder Setup
ptr GlobalRegister->u.io:$A0007C.8.24;
//GlobalRegister=$18000B        // Global Control register, 4MHz (Not 2MHz - this comment was wrong) Clock setting
// Try the following:
GlobalRegister=$18020B        // Global Control register,4MHz Clock setting, encoder read on rising edge of servo clock

ptr Chan1Reg->u.io:$A00020.8.24;
Chan1Reg = $211480 + SingleTurnRes    // Ch1 Control register, 26-Bit EnDat Encoder

ptr PosReg1->u.io:$A00000.8.24;
ptr PosReg2->u.io:$A00004.8.24;

EncTable[1].index1=8
EncTable[1].index2=8
EncTable[1].index3=0
EncTable[1].index4=0
EncTable[1].index5=0
EncTable[1].pEnc1=Sys.pushm
EncTable[1].pEnc=Acc84E[0].Chan[0].SerialEncDataA.a
EncTable[1].MaxDelta=0
EncTable[1].ScaleFactor=1/256
EncTable[1].TanHalfPhi=0
EncTable[1].CoverSerror=0

//Motor 5 Setup (PWM Output)
Motor[5].pDac = Acc24E2[6].Chan[0].Pwm[2].a
Motor[5].ServoCtrl=0;
Motor[5].pLimits=0 ; 
Motor[5].pEnc = EncTable[1].a;
Motor[5].pEnc2 = EncTable[1].a;
Motor[5].Desired.Pos = 0;
Motor[5].pAbsPos = Acc84E[0].Chan[0].SerialEncDataA.a;
Motor[5].AbsPosFormat = $00081A08;

Motor[5].Ctrl = Sys.PosCtrl;  //Set output for Open-Loop output
Motor[5].FatalFeLimit = 0; //Prevent disable from over error limit
Motor[5].MaxSpeed=300000000;

Motor[5].AbortTa=-1;

Link to comment
Share on other sites

For the rollover to happen properly, the intermediate signed 32-bit value in EncTable[n].PrevEnc must go smoothly between +2^31 and -2^31 (+/-2,147,483,648). If this does not happen, there will be jumps in the resulting table output and resulting motor position. What does the data gathering show for this value?
Link to comment
Share on other sites

I have attached the data you requested.

 

Channels:

  1. Time
  2. EncTable[1].PrevEnc
  3. Motor[5].DesPos

 

It does not appear to be rolling over at the maximum value of the PrevEnc register. It also doesn't appear the that the rollover is occurring at the same value every time.

 

I have also noticed that the resting point for the PrevEnc register is on the order of ~1.35e9. That is pretty close to the maximum value of the register. Is there a way I could be setting the value of this register (or whatever feeds into it) manually each time the machine runs to prevent it from winding up?

 

tanakakai,

 

Please gather the EncTable[n].PrevEnc as CurtWilson explained. We need to find out why this register is not rolling over properly.

EncTableRolloverGather.zip

Link to comment
Share on other sites

Based upon the data that you have sent, it appears that you only have 16 bits of data and not 26-bits. Try the following setting and see if it solves the issue:

 

//--------------------------------------------------------------------------------
// Encoder Setup: Renishaw RESOLUTE encoder (Biss-C Unidirectional)
//--------------------------------------------------------------------------------

#define SingleTurnRes        16

//System Timing
Sys.ServoPeriod = 8427*3/117694.8;
Sys.PhaseOverServoPeriod = 1/3;

//Gate Setup
Gate1[6].PwmPeriod = 6527/2;  // Set PWM freq to 9.034 kHz
Gate1[6].PhaseClockDiv = 0;  // Set phase clock freq to 18.068kHz (NOT 9.034 kHz - this comment was wrong)
Gate1[6].ServoClockDiv = 2;  // Set servo clock freq to 6.023 kHz
Gate1[6].HardwareClockCtrl = 2258;  // Set Encoder sample clock to 4.9 MHz, others at default
Gate1[6].PwmDeadTime = 0;  // Dead time to zero per Copley/Delta Tau app note


//Renishaw Encoder Setup
ptr GlobalRegister->u.io:$A0007C.8.24;
//GlobalRegister=$18000B        // Global Control register, 4MHz (Not 2MHz - this comment was wrong) Clock setting
// Try the following:
GlobalRegister=$18020B        // Global Control register,4MHz Clock setting, encoder read on rising edge of servo clock

ptr Chan1Reg->u.io:$A00020.8.24;
Chan1Reg = $211480 + SingleTurnRes    // Ch1 Control register, 16-Bit EnDat Encoder

ptr PosReg1->u.io:$A00000.8.24;
ptr PosReg2->u.io:$A00004.8.24;

EncTable[1].type=1
EncTable[1].index1=16
EncTable[1].index2=8
EncTable[1].index3=0
EncTable[1].index4=0
EncTable[1].index5=0
EncTable[1].pEnc1=Sys.pushm
EncTable[1].pEnc=Acc84E[0].Chan[0].SerialEncDataA.a
EncTable[1].MaxDelta=0
EncTable[1].ScaleFactor=1/(256*256)
EncTable[1].TanHalfPhi=0
EncTable[1].CoverSerror=0

//Motor 5 Setup (PWM Output)
Motor[5].pDac = Acc24E2[6].Chan[0].Pwm[2].a
Motor[5].ServoCtrl=0;
Motor[5].pLimits=0 ; 
Motor[5].pEnc = EncTable[1].a;
Motor[5].pEnc2 = EncTable[1].a;
Motor[5].Desired.Pos = 0;
Motor[5].pAbsPos = Acc84E[0].Chan[0].SerialEncDataA.a;
Motor[5].AbsPosFormat = $00001008;

Motor[5].Ctrl = Sys.PosCtrl;  //Set output for Open-Loop output
Motor[5].FatalFeLimit = 0; //Prevent disable from over error limit
Motor[5].MaxSpeed=300000000;

Motor[5].AbortTa=-1;

Link to comment
Share on other sites

Nope, same results as before.

 

Any other data I can collect that would help determine what's going on here?

 

Based upon the data that you have sent, it appears that you only have 16 bits of data and not 26-bits. Try the following setting and see if it solves the issue:

 

//--------------------------------------------------------------------------------
// Encoder Setup: Renishaw RESOLUTE encoder (Biss-C Unidirectional)
//--------------------------------------------------------------------------------

#define SingleTurnRes        16

//System Timing
Sys.ServoPeriod = 8427*3/117694.8;
Sys.PhaseOverServoPeriod = 1/3;

//Gate Setup
Gate1[6].PwmPeriod = 6527/2;  // Set PWM freq to 9.034 kHz
Gate1[6].PhaseClockDiv = 0;  // Set phase clock freq to 18.068kHz (NOT 9.034 kHz - this comment was wrong)
Gate1[6].ServoClockDiv = 2;  // Set servo clock freq to 6.023 kHz
Gate1[6].HardwareClockCtrl = 2258;  // Set Encoder sample clock to 4.9 MHz, others at default
Gate1[6].PwmDeadTime = 0;  // Dead time to zero per Copley/Delta Tau app note


//Renishaw Encoder Setup
ptr GlobalRegister->u.io:$A0007C.8.24;
//GlobalRegister=$18000B        // Global Control register, 4MHz (Not 2MHz - this comment was wrong) Clock setting
// Try the following:
GlobalRegister=$18020B        // Global Control register,4MHz Clock setting, encoder read on rising edge of servo clock

ptr Chan1Reg->u.io:$A00020.8.24;
Chan1Reg = $211480 + SingleTurnRes    // Ch1 Control register, 16-Bit EnDat Encoder

ptr PosReg1->u.io:$A00000.8.24;
ptr PosReg2->u.io:$A00004.8.24;

EncTable[1].type=1
EncTable[1].index1=16
EncTable[1].index2=8
EncTable[1].index3=0
EncTable[1].index4=0
EncTable[1].index5=0
EncTable[1].pEnc1=Sys.pushm
EncTable[1].pEnc=Acc84E[0].Chan[0].SerialEncDataA.a
EncTable[1].MaxDelta=0
EncTable[1].ScaleFactor=1/(256*256)
EncTable[1].TanHalfPhi=0
EncTable[1].CoverSerror=0

//Motor 5 Setup (PWM Output)
Motor[5].pDac = Acc24E2[6].Chan[0].Pwm[2].a
Motor[5].ServoCtrl=0;
Motor[5].pLimits=0 ; 
Motor[5].pEnc = EncTable[1].a;
Motor[5].pEnc2 = EncTable[1].a;
Motor[5].Desired.Pos = 0;
Motor[5].pAbsPos = Acc84E[0].Chan[0].SerialEncDataA.a;
Motor[5].AbsPosFormat = $00001008;

Motor[5].Ctrl = Sys.PosCtrl;  //Set output for Open-Loop output
Motor[5].FatalFeLimit = 0; //Prevent disable from over error limit
Motor[5].MaxSpeed=300000000;

Motor[5].AbortTa=-1;

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...