gateRate() method outputs wrong rate

I give the encoder the distance per tick in the constructor when creating the object and the distance per tick converges, the full revolution of the wheel is about 320 millimeters, which is what it should be, but when I call gateRate to get the speed of the encoder mm / sec, then at maximum revolutions I get 67.3 , although at the maximum speed of 530 mm / s, what’s the problem? Distance per tick: 0.21888145537305936mm

I’m getting deja vu here… Didn’t you already ask this in a different post? Or maybe it was a comment under a different thread?

This was a comment, I decided to post it as a general question

Or is it not correct?

Ah okay, as long as I’m not imagining things.

As for your question, I’m sure it relies on information that came out in the other thread but that hasn’t been linked here. We would need more information to even begin to guess at the cause. What does the mechanism look like (motor specs, gear ratio, wheel size)? What does your code look like (ideally as a link to a full project in github or similar)?

ok, i’ll give it now

You can see the characteristics of the engine here: Maverick DC Motor — Studica Robotics 1.0.0 documentation, a wheel with a radius of 51 mm is attached to the engine

As for the code, I just create an encoder, assign channels to it, set the distance per tick, and then use the gateRate() method to get the speed, and output it to the shuffleboard

He is very simple

Okay, so what are the units you’re expecting? mm/sec? Or rotations/minute(or per second)?

If you leave the “distance per tick” as default (i.e. comment out that line of code), what values do you get?

Yes, I’m expecting mm per second since my distance per tick is in millimeters

I’ll check with comments

mm/tick is a linear distance measurement, not a velocity measurement. GetRate() will return a velocity unit.

Without assigning a distance, it outputs approximately 310

I meant that it correctly calculates the distance that the wheel has traveled, but does not correctly calculate the speed

I converted the heart rate distance to radians (6.28 / 1464) and gateRate gives me 1.2 radians per second, but that’s not true. How does it even work?
I mean that if you find the linear speed at these radians, then it will not be correct
My maximum angular velocity should be about 10 radians per second, then it will be correct

Oh, I still can’t understand how this method works, it doesn’t output the correct angular or linear speed (I just want to get the speed at which my wheel is spinning …

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.