I’m trying to control brushed motor with OpenMV’s PWM and getting wierd result.
Wiring scheme is following:
TB6612FNG dirvier used as a motor driver. There are two pins to define mode and another one for PWM. Mode pins connected to P8 and P9 OpenMV’s pin. P7 pin connected to driver’s PWM pin.
Test program is:
from pyb import Pin, Timer m1_1 = Pin('P8', Pin.OUT_PP) m1_2 = Pin('P9', Pin.OUT_PP) m1_1.high() m1_2.low() m1_tm = Timer(4, freq=488.28) m1_pwm = m1_tm.channel(1, m1_tm.PWM, pin=Pin.board.P7, pulse_width_percent=50)
With this code I getting this result: https://youtu.be/w19WEoutPcw
Why it moves intermittently? Same setup with arduino doing slow smooth moving (at exactly same hardware).