george.kontogiorgos Posted April 9, 2021 Share Posted April 9, 2021 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 More sharing options...
Smakarem Posted April 23, 2021 Share Posted April 23, 2021 Hi George, After confirming some information, it sounds like you are correct. PrevEnc is the unintergrated position value and does not use the scaling from the first encoder table. Regards, Shadi Link to comment Share on other sites More sharing options...
george.kontogiorgos Posted April 26, 2021 Author Share Posted April 26, 2021 Hi Smakarem, Thank you for the information. Maybe my manuals are not the latestest and it does not appear on there. Link to comment Share on other sites More sharing options...
Richard Naddaf Posted May 15, 2021 Share Posted May 15, 2021 You could point "open" motors to the entries and subtract their corresponding Motor[x].DesPos in a user servo. Link to comment Share on other sites More sharing options...
Recommended Posts