Odometry ru: Unterschied zwischen den Versionen
(→Differential drive) |
(→Circuit) |
||
Zeile 44: | Zeile 44: | ||
</gallery> | </gallery> | ||
− | == | + | == Подключение == |
VCC pinArduino | VCC pinArduino |
Version vom 23. August 2015, 15:21 Uhr
Inhaltsverzeichnis
Abstract
Latest Ardumower code requires motor encoders for odometry. Using odometry you can calculate the robot's speed and the short-term position of the robot. This works by counting the rotations of left and right wheel (motor encoders - required by latest Ardumower software).
Currently, odometry is used:
- to ensure the robot left and right wheel are turning the same speed (in forward direction)
Encoder pinout (Ardumower motors)
The Ardumower has a 2-channel encoder with 5 pulses at one cycle of motor multiplied by gear ratio 1:212, resulting in 1060 encoder ticks per one full tire resolution.
Wiring/pinout of motor encoder connector:
green ---- GND brown ---- VCC blue ---- odometry1 purple ---- odometry2
IMPORTANT: PCB v0.5/1.2 are missing pull-ups! You need to add them yourself:
odometry1 --- 4.7k --- 5v odometry2 --- 4.7k --- 5v
Signal of odometry encoders
Forward: pin1 makes LOW->HIGH transition and pin2 = HIGH Reverse: pin1 makes LOW->HIGH transition and pin2 = LOW
Do-It-Yourself encoders
Подключение
VCC pinArduino +--13 KOhm----+-------Collector Emitter---GND +--380 Ohm------------Anode Kathode---GND
Расчет расстояния, пройденного каждым колесом
При подключении датчиков оборотов мы можем вычислить расстояние и направление движения.
Расстояние на каждое колесо:
left_cm = ticksLeft / odometryTicksPerCm right_cm = ticksRight / odometryTicksPerCm
Направление движения (курс):
wheel_theta = (left_cm - right_cm) / odometryWheelBaseCm odometryTheta += wheel_theta
Общее расстояние:
avg_cm = (left_cm + right_cm) / 2.0 odometryX += avg_cm * sin(odometryTheta) odometryY += avg_cm * cos(odometryTheta)
Неточность наземных измерений
Путем сложения (интеграции) показателей движения и скорости, мы можем вычислить расстояние и направление движения. Однако из-за не точного физическое измерения, расстояние и угол ошибки возрастает с каждой итерацией. Это может быть решено путем обработки сигналов с разных датчиков.
Регулятор скорости мотора (ПИД)
Скорость двигателей регулируется с помощью программного ПИД-регулятора. Вы можете следить за качеством управления скорости через pfodApp (Plot->Motor control):
Видео
Еще нет видео (функционал в разработке)