I been testing the IME and Quad Encoders trying to get a good understanding on how easyC works and calculating RPM. My test code would not reiterate fast enough for a quality controled robot but simplifies and slows thing down.
Set up 393 motor with IME *High Torque Config
Quad Encoder direct to Output of motor.
Using a stop watch the set motor to 1 Rotation Per Sec
pseudo code: *easyC V4
While(1)
//get Encoder values
encoder_last = encoder_current;
encoder_current = GetQuadEncoder(2,3);
RPS = ((encoder_current - encoder_last)/1000)*(1000/360) // (Ticks /loop)*(1000ms/1sec)*(1rev/360Ticks)
//get IME values
IME_Last = IME_Current
IME_Current = GetIntergratedMotorEncoder(2)
IME_RPS = GetIntergratedMotorEncoderSpeed(2)
//Print to screen.....
...
...
...
wait(1000)
My output is…
encoder last = 50682 encoder current 51047 RPS = 1.014
motor last =130353 motor current 130992 RPS = 2.59
What I see is:
encoder = 365 ticks / sec >> 365 ticks * 1 rev / 360.000 ticks >> 1.014 RPS
motor = 639 ticks / sec >> 639 ticks * 1 re v/ 261.333 ticks* >> 2.45 RPS *? Turbo Mode ?
Does GetIntergratedMotorEncoderSpeed always calculate assuming Turbo gearing? How can I get that instruction to retrieve RPS when in High Torque.