Shop OBEX P1 Docs P2 Docs Learn Events
Need Help With Position Controller Commands — Parallax Forums

Need Help With Position Controller Commands

JohnBFJohnBF Posts: 107
edited 2011-01-03 10:15 in Robotics
I've got the Parallax Motor Mount and Wheel Kit set up on a test stand. First I wired it up to run the motors directly with HB-25s. No problem. Then I wired in the Position Controllers and ran MPC_Roll_Demo.spin from OBEX. No problem, and wow, I love the quality and smoothness of the whole setup.

But now I'm stuck. I understand how to get the wheels to travel a set distance, forward or backwards at max speed, but not how to set a slower speed, so a bot can travel more slowly or turn.

I'd appreciate any help on what to do or where to look.

Thanks!

/John
1024 x 681 - 139K

Comments

  • JohnBFJohnBF Posts: 107
    edited 2011-01-02 14:59
    Yes, I read the documentation. It's excellent and I couldn't have have gotten this far without it. I can get the motors to travel a set distance forward and backward and stop, and I can obtain position and speed information from the controllers. But I can't figure out how to get the position controllers to tell motors to run at less than max speed.

    I'm sure I'm missing something obvious, and I'm hoping to get to the point of saying "duh!" Not there yet.

    /John
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2011-01-02 15:21
    When the final code that was writen for the position controllers the command to change speed was not used you are not missing any thing at all I had the same question and call tech support at Parallax and talked to Dave and that what he had told when I asked about the same thing

    I hope this helps
  • JohnBFJohnBF Posts: 107
    edited 2011-01-02 17:46
    Thanks, _sam. Interesting.

    I found Wheel_Controller.spin in Obex and it has methods for doing everything you could want with the position controllers. Works great. So the practical problem is solved.

    But I'd still love to understand what's going on. I'm just not able to figure out from the PASM in this object how it works. So I'm still looking for help understanding how to get the controllers to tell HB25s to go slow.

    /John
  • NikosGNikosG Posts: 705
    edited 2011-01-03 06:24
    JohnBF wrote: »
    Thanks, _sam. Interesting.

    I found Wheel_Controller.spin in Obex and it has methods for doing everything you could want with the position controllers. Works great. So the practical problem is solved.

    But I'd still love to understand what's going on. I'm just not able to figure out from the PASM in this object how it works. So I'm still looking for help understanding how to get the controllers to tell HB25s to go slow.

    /John

    Hi John,
    Acording the product manual that metioned "Franklin" you must change the SMAX (Command#8) focus on page 16 of 19
    It says: "*While not recommended, it is possible to change the maximum speed value in mid-travel.
    Keep in mind that this value is the maximum speed that the position controller is allowed
    to travel. During motion, if the Position Controller receives a new speed maximum which
    is greater than the current speed maximum, it will begin accelerating at the speed ramp
    rate up to the new speed maximum. If the Position Controller receives a new speed
    maximum which is lower than the current speed maximum, the speed will instantly be
    clipped to the new value which will generally be abrupt and undesirable."
    The maximum speed is the SMAX.
    It works properly with Bs2 code. I haven't tried yet with Spin code.
  • JohnBFJohnBF Posts: 107
    edited 2011-01-03 10:15
    Yes, good point. I probably skipped over this too quickly after seeing "...not recommended." Manipulating the max speed is probably a reasonable workaround. It works fine for increasing speed, but to decrease speed you need to provide a series of gradual steps so the change is not "...abrupt and undesirable". Needing to provide your own ramping is unfortunate because automatic ramping is a big selling point of these devices. Thanks.

    /John
Sign In or Register to comment.