This topic has 1 reply, 2 voices, and was last updated 3 weeks, 5 days ago by SuperDroid.

  • Author
    Posts
  • #8018
     Che Martin
    Participant

    Good Morning All,

    I have the Omni-wheel Vector robot and I am working on making it autonomous. I used the wheel speed in m/s to get a PID output. My question is how do I convert the PID output to a PWM for my Analogwrite command? My PWM range is -225, 255.

    Regards,
    Che

    #8019
     SuperDroid
    Keymaster

    The analogWrite() command takes values from 0 to 255. You need to take the absolute value (or magnitude) of your pid output, scale it to 0-255, and set the direction pin output for that motor high or low depending on the sign.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Login Register

©2020 SDRobots.com | All rights reserved.

Log in with your credentials

or    

Forgot your details?

Create Account