Jump to content
OMRON Forums

PrevEnc and Index4


george.kontogiorgos

Recommended Posts

Hello,

 

I have to report the position of a single encoder through a motor structure without InPos and DacLimit problems due to absence of feedback signal. So I was trying to create a second reference signal (Apart from DesPos signal) to input an EncTable structure pointed to the single encoder (without motor). So I was performing some tests with virtual motors modifications to attempt this second reference signals by the following snippets of code:

 

EncTable[31].type=1 // 32-bit register read
EncTable[31].pEnc=Sys.Idata[9].a // Same as Motor[5].pDac
EncTable[31].pEnc1=Sys.pushm // Dummy read (not used)
EncTable[31].index1=0 // No shift right of source data
EncTable[31].index2=0 // No shift left of source data
EncTable[31].index3=0 // No accel limiting
EncTable[31].index4=1 // Single integration
EncTable[31].PrevDelta=0 // No bias before integration
EncTable[31].MaxDelta=0 // No velocity limit
EncTable[31].ScaleFactor=1/65536 // 32 bits -> 16 bits

 

EncTable[32].type=9 // 32-bit register read
EncTable[32].pEnc=EncTable[31].PrevEnc.a // Same as Motor[5].pDac
EncTable[32].pEnc1=Sys.Idata[10].a // Same as Motor[5].pDac
EncTable[32].index1=0 // No shift right of source data
EncTable[32].index2=0 // No shift left of source data
EncTable[32].index3=0 // No accel limiting
EncTable[32].index4=0 // Single integration
EncTable[32].MaxDelta=0 // No velocity limit
EncTable[32].ScaleFactor=1 // 32 bits -> 16 bits

 

Motor[9].pEnc=EncTable[32].a

 

When I set

 

Sys.Idata[9]=1 

 

I would expect that the motor 9 position start running to infinite since Index4 of EncTable[31] is 1 and so it perform a single integration. When I set

 

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

 

The motor 9 position behave as I expect (incrementing due to integration).

 

I suppose that PrevEnc ignore the integration (as it does with ScaleFactor) but I just find this behaviour with ScaleFactor on software manual.

 

I would like to know if my hypothesis is correct.

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • 3 weeks later...
Guest
This topic is now closed to further replies.

×
×
  • Create New...