ELake20
Lifetime Supporting Member
I'm working on calculating the velocity of a cylinder. The cylinder can extend and retract.
I've got a solution that I *think* works, but I'm concerned with accuracy and I'm always looking for a neater/cleaner way of doing things.
I'm using a clock bit (M10.2) which is from what I've read a 1S pulse timer. I one shot this and take the current position and store it.
Then I simply subtract the stored value from the actual value. I didn't bother dividing since my timebase is 1S.
I'll post the STL code (paste and convert to LAD)
Thanks in advance
Edit: Uploaded image in LAD, didn't want to make people type stuff into the declaration table
I've got a solution that I *think* works, but I'm concerned with accuracy and I'm always looking for a neater/cleaner way of doing things.
I'm using a clock bit (M10.2) which is from what I've read a 1S pulse timer. I one shot this and take the current position and store it.
Then I simply subtract the stored value from the actual value. I didn't bother dividing since my timebase is 1S.
I'll post the STL code (paste and convert to LAD)
A M 10.2
FP #bOneShot
JNB _009
L #rCylPos_Meters
T #rCylPos_Storage
_009: NOP 0
Am I on the right track?L #rCylPos_Storage
L #rCylPos_Meters
-R
T #rVelocity
NOP 0
Thanks in advance
Edit: Uploaded image in LAD, didn't want to make people type stuff into the declaration table
Last edited: