No announcement yet.

Inconsistent Execution of Linear Op Mode with Encoders

  • Filter
  • Time
  • Show
Clear All
new posts

  • Inconsistent Execution of Linear Op Mode with Encoders

    Hello, Forum friends.

    We are experiencing some inconstancy with our Linear Op Mode which is a program that navigates our robot with two dc motors. We are adding one step at a time (the steps are run straight, then turn right, run straight, back up, turn right, straight, turn left). The inconstancy comes in when we add a step, then run the robot, the first time we run it, it doesn't run through the whole program, it will only get so far, but then we run it a second time and it works fine after that. Sometimes it stops at the backing up and sometimes it stops before the backing up. The issue I am having in trying to trouble shoot this, is why does it work the second or sometimes the third time I restart the program. Any suggestions? By the way, the motors are AndyMark Neverest and I am using MR Motor Controller.

    I will try and post a pic of our program but not sure if I am posting the pic right. Could someone comment on this thread and explain how to do that please :).

    Thank you in advance for your help, also thank you for this forum, it has helped our team SOOOOOO much, we have also been able to help out some of the other Colorado teams because of the advice and direction we are receiving from the Forum. You all are a great help to so many of us, thank you, thank you, thank you :).

    Jack Dodge and PI Robotics #7483

  • #2
    Search the forums, in Linear op mode, you need to wait several hardware cycles when resetting encoders (we've also found it best to wait several cycles when setting motor run mode... Sounds like the same kind of erratic problems you'll see without doing that - sometimes it works, sometimes not.


    • #3
      I took a quick glance at the program you posted and it looks like you have the appropriate wait-for-hardware-cycles. I'll take another look later today but in the meantime I'm tempted to do what we software guys "always do" -- blame it on the hardware. The program will wait indefinitely for a particular encoder reading. If the encoder cable is loose or the USB connection to the motor controller is unstable it never receive what it's waiting for.


      • #4
        I took another look at your program. You may want to try increasing the motor powers to see if doing so will produce more consistent results. Also, I noticed one place where you set the power to 0.4 before the loop and then reduced it to 0.3 in the loop.


        • #5
          Thank you Bruce and Korimako, changing the wait for and powers fixed the problem. We really appreciate the help/advice.

          Jack and PI Guys