如何计算机器人在avr中的行进距离

时间:2018-03-04 06:27:02

标签: avr atmega avrdude

在这里,我想计算机器人在atmega 2560中的行进距离?我知道公式距离=车轮周长*电机以rpm为单位的旋转。但我没有得到如何将此公式应用于以下问题。

What is the approximate distance covered by the robot in 2 seconds, if OCR5AL=OCR5BL=0xB2. Given that, maximum speed at which the motors rotate is 300 rpm and wheels have a radius of 2.8cm.
Where
OCR5AL is Output compare register low value for Left Motor
OCR5BL is Output compare register low value for Right Motor

Maximum speed is attained, when OCR5AL =OCR5BL =0xFF.

1 个答案:

答案 0 :(得分:0)

电机每分钟转数(rpm)和车轮转速是不同的。我不认为你的机器人的轮子以300转/分钟的速度旋转。 因此,为了能够计算距离,您需要知道车轮旋转360度需要多少马达转数。 如果你有一个步进电机,这将工作正常。知道车轮完整转弯的步数为您提供了计算距离的数学公式。 如果您想使用时间测量来解决这个问题,您需要确定使用不同电机速度转动车轮所需的秒数和毫秒数。

相关问题