uno Posted March 27, 2019 Posted March 27, 2019 Hello, Up until now I've rarelly used or needed the features of the ECT. Mostly I had some absolute and some A quad B Encoders, and got all I needed without much changes there. But there were always some things that I calculated myself, but should in general be possible with correct setup of the ECT. Perhaps there is also a fundamental problem I'm not seeing. The ECT was always a big mystery. I think a lot of things can be done with it, but every time I try something, I don't get it to work and write my own code for the specific problem. Now at my current project I need some estimate of the current acceleration and jerk of a telescope. So this means 2nd and 3rd derivative of position. The customer wants these for logging purposes, and knows that these values are not too exact. But anyhow, I need to send them with every position package, and I'm looking for a way to calculate this using the ECT. In TurboPMAC there is more about differentiation in the ECT (although not enough for me to try and use it back than when we used TurboPMAC), but with PowerPMAC I can only find everywhere "you can differentiate with the ECT". But not "How"? I've just looked again at the training slides, but even there it stops at the end with Triggered timebase. (In Turbo PMAC there was also a "non triggered timebase", but this seems gone?) So, my question is: Is there any more documentation/examples for the ECT? I'm right now thinking that I have overlooked something...Or think too complicated. But I would also be grateful for an example, how to get velocity, acceleration and jerk by using the ECT to put it into some variable to send it somewhere. So how to configure the ECT 3-5 to process the position of the Motor in e.g. EncTable[2] to get velocity, acceleration and jerk of this motor? I have no Trigger attached to IC Channels to trigger from external. Which is not needed for this problem I think. (ok, I could wire something from an ACC65 to the ACC24E3 Inputs, but there must be another simple way for my problem) Greetings, the guy who somehow does not understand how to use the ECT ;) A question related to this, but not so critical right now: I've also found in the ACC24E3 manual a way to ask for additional data using the Gate3.AdcEncStrobe. (Direct Velocity Value, around page 59) But eighter I'm missing some critical piece, or these values are not retrievable with the system here) Using the example on this page I never get any change of the result.
Omron Forums Support Posted March 27, 2019 Posted March 27, 2019 We can use the ECT to get a first derivative, velocity. This would be done by reading Enctable[n].DeltaPos in your own program. However, there is no way to take further derivatives without using some tricks. Basically you can get velocity from Enctable[n].DeltaPos, Motor[x].ActVel, or Motor[x].FltrVel. Out of these Motor[x].FltrVel has the least noise because it is based on the current position and the position 16 cycles ago. This also means it's really a best guess of the velocity 8 servo cycles ago. To get motor units per millisecond you can use Motor[x].FltrVel/(16*Sys.ServoPeriod). If you calculate acceleration and jerk from Motor[x].FltrVel, then hopefully you can get a little less noise. On the additional data request question, are you using an autocorrecting interpolator?
uno Posted March 28, 2019 Author Posted March 28, 2019 We can use the ECT to get a first derivative, velocity. This would be done by reading Enctable[n].DeltaPos in your own program. However, there is no way to take further derivatives without using some tricks. Basically you can get velocity from Enctable[n].DeltaPos, Motor[x].ActVel, or Motor[x].FltrVel. Out of these Motor[x].FltrVel has the least noise because it is based on the current position and the position 16 cycles ago. This also means it's really a best guess of the velocity 8 servo cycles ago. To get motor units per millisecond you can use Motor[x].FltrVel/(16*Sys.ServoPeriod). If you calculate acceleration and jerk from Motor[x].FltrVel, then hopefully you can get a little less noise. On the additional data request question, are you using an autocorrecting interpolator? Hello again, Eric ;) thanks for the answer. The version with DeltaPos I tried yesterday, since this appeared to me as the "normal mathematical way". But now two questions arrise: 1. It should be possible, to feed DeltaPos (or FltrVel) into another ECT, to get then DeltaPos for this value, and have acceleration, right? But how would this be done? Just point another EncTable to this DeltaPos or FltrVel? (type = 1? ) 2. My main reason for all this trial and error over the years with "outsourcing to the ECT" was "speed" or "less calculation time" and of course "keep it simple". My understanding is, that the ECT is somehow good optimized for such calculations. So if I write my own calculations, I could mostly not be faster, compared to "if I did it the correct way inside the ECT". It seems to me that by moving such repeating calculations to the ECT, I save time, keep problems with other code parts away and make sure I always have the values I want calculated and ready when the rest of the programs need it. Is this correct? Or is the effort to move these calculations to the ECT in the end not making any difference compared to PLC/plain C calculations? Greetings, Georg And short regarding the interpolator: Yes, the incremental encoder use an interpolator, but I'm not sure about the auto correction. Its an Heidenhain EXE or IBV, not sure right now which one I used for my short experiments. But from my point of view I just use the "$$$***" defaults for AquadB encoder on the ACC24E3 channel and it works. So the PMAC should only see the pulses. Could this be the problem? Our electrician is on vacation right now, so if it is worth digging further there, perhaps I ask you later about this. This telescope is about 30 years old. Some parts are original, some have been replaced, so I'm not sure about all details right now.
Omron Forums Support Posted March 28, 2019 Posted March 28, 2019 1. It should be possible, to feed DeltaPos (or FltrVel) into another ECT, to get then DeltaPos for this value, and have acceleration, right? But how would this be done? Just point another EncTable to this DeltaPos or FltrVel? (type = 1? ) In theory, this would be done either with "EncTable[2].pEnc=EncTable[1].DeltaPos.a" or "EncTable[2].pEnc=Motor[1].FltrVel.a". However, either of these will throw a "error #70: Struct Write Data Error". If you wanted to force this method to work, you could repeat Motor[1].FltrVel into Sys.Udata in a custom servo algorithm so that on the next pass through the ECT the value is available. Set Enctable[n].pEnc=Sys.Udata.a to read the copied FltrVel. 2. My main reason for all this trial and error over the years with "outsourcing to the ECT" was "speed" or "less calculation time" and of course "keep it simple". If you do the calculations in C they should be about the same as the ECT, where script would be a little slower. And short regarding the interpolator: Yes, the incremental encoder use an interpolator, but I'm not sure about the auto correction. Its an Heidenhain EXE or IBV, not sure right now which one I used for my short experiments. We sell the ACC-24E3 with two sinusoidal interpolator options; standard and auto-correcting. The velocity and acceleration data require the auto-correcting option.
uno Posted April 1, 2019 Author Posted April 1, 2019 Hello Eric, And short regarding the interpolator: Yes, the incremental encoder use an interpolator, but I'm not sure about the auto correction. Its an Heidenhain EXE or IBV, not sure right now which one I used for my short experiments. We sell the ACC-24E3 with two sinusoidal interpolator options; standard and auto-correcting. The velocity and acceleration data require the auto-correcting option. thanks for the clarification. I think we have the "non auto correcting version than. I'll check the order later, but this should be the reason than. 1. It should be possible, to feed DeltaPos (or FltrVel) into another ECT, to get then DeltaPos for this value, and have acceleration, right? But how would this be done? Just point another EncTable to this DeltaPos or FltrVel? (type = 1? ) In theory, this would be done either with "EncTable[2].pEnc=EncTable[1].DeltaPos.a" or "EncTable[2].pEnc=Motor[1].FltrVel.a". However, either of these will throw a "error #70: Struct Write Data Error". If you wanted to force this method to work, you could repeat Motor[1].FltrVel into Sys.Udata in a custom servo algorithm so that on the next pass through the ECT the value is available. Set Enctable[n].pEnc=Sys.Udata.a to read the copied FltrVel. That I tried, and yes, with the error message you mentioned :) Thanks for the "forced method". Perhaps not with this problem, but at other places I will try this...eighter for good reasons or just to have fun. 2. My main reason for all this trial and error over the years with "outsourcing to the ECT" was "speed" or "less calculation time" and of course "keep it simple". If you do the calculations in C they should be about the same as the ECT, where script would be a little slower. Ok, than I use the "good old C way", if this is the same speed. Thanks for all the insights into the ECT. Now a lot is clearer to me, and my mind can rest regarding the "ECT should be faster or more beatiful" topic :) Now, back to my telescope, Thank You for now and see you later with new problems, Georg
Recommended Posts