Menu

#9 MotorRotationCount & MotorBlockTachoCount bug

general
closed-rejected
None
9
2014-09-16
2007-04-20
No

Hi,
I think I found a bug in MotorRotationCount and in MotorBlockTachoCount.

I made this simple program:

#include "NXCDefs.h"

task main()
{
while (true)
{
NumOut(0,LCD_LINE2,MotorRotationCount(OUT_B));
}
}

Then I ran the program on my robot, and tried turning with my hand the wheel on the motor B.
Everything's ok if I turn the wheel increasing rotation degrees.
But if I reach a number >100° (for example, I reach 150°), and then I go back, it doesn't work correctly.
In fact, between 0° and 100°, it displays numbers between 0° and 1000°! For example, instead of 90°, it displays 900°!!!
It's a big problem, because I need to realize a position control.

Please, tell me if I'm doing something wrong, or fix the bug as soon as possible.

Thank you
Lorenzo

Discussion

  • LorenzoSabattini

    Logged In: YES
    user_id=1774284
    Originator: YES

    Only one more thing: I tried release 27 and release 28, with the same results.

     
  • LorenzoSabattini

    • priority: 5 --> 9
     
  • John Hansen

    John Hansen - 2007-04-20

    Logged In: YES
    user_id=661666
    Originator: NO

    What you are seeing is a bug in your little test program. You need to clear the screen before you write out the new number. Otherwise, once you have displayed

    100

    when it writes

    90

    to the screen it will be directly on top of the previous text which means that you will see

    900

    All you have to do in your test program is add ClearScreen(); in front of the NumOut call.

     
  • John Hansen

    John Hansen - 2007-04-20
    • milestone: --> general
    • assigned_to: nobody --> afanofosc_99
    • status: open --> closed-rejected
     
MongoDB Logo MongoDB