motor controller software design

Discussion in 'The Projects Forum' started by kasunt, Nov 18, 2011.

  1. kasunt

    Thread Starter New Member

    May 24, 2011
    I have to design a PID controller for a differential drive robot.

    • The hardware board consists of a AVR atmega168 running at 16mhz.
    • Driven by two 24v scooter motors with 256 CPR encoders
    • The motors spin roughly at about 4700 RPM and has a 51.56:1 gear ratio
    So far I can read the encoder direction and the tick count based on interrupts at 1x. But I have no idea how to convert this to speed. And eventually a PID controller. I also want to be able to rotate the robot at a given angle. Can someone please help me to get started ?

    Currently I am having problems figuring out a suitable timer calculation for this.