Quote:
|
Originally Posted by Matt Adams
You need to set your variable enc_Right_Count_Old = 50 before you want to use math involving it, or it will just use zero (it doesn't know any better!). Move it to the line above the subtraction, it should work as expected.Matt
|
Hi Matt,
Thanks for the time in checking this out.
We don't want to set that varible first, or before the math. It is true that the first loop through the CPU it will be ZERO. But then it gets a value (50) at the bottom on the first loop. Shouldn't the CPU remember this value, so in loop pass #2, now that varible is set to 50 and it should correctly excute the subtract math?
We only want to update this varible at the end because we are doing a velocity measurement sampling the encoder counts.
I posted Screen 1 through 4 to show you what we are trying to do our testing, basiclly to eliminate "Have you tried this? Have you tried that?" Sort of thing....
Screen shot #5 is what we want, but we found out the problem in screen shot 3 and 4. By the varible updating but not being able to get subtracted above it.