You are reading a single comment by @maze1980 and its replies. Click here to read the full conversation.
  • I assume the tracks are AC, there's a rectifier in the car (#4 you see the 4 diodes) and the motors are DC.
    I'd use a standard rc car ESC with BEC for 3S or 4S, depending on the DC voltage available after the rectifier. (There are ESCs for DC motors without aluminum cooling block and fan). These ESCs have the PWM already build in, so no need to build your own PWM software and hardware.
    Then just modify your board to work with the CR2031 as backup to avoid resets, and power it from the 5V BEC.
    To control the ESC:

    const servoPin = <pin>
    let servoPosition = 1.5; //1500ms == centered; 1000ms == min; 2000ms==max;
    //at 1000 you'll go backwards at max speed, at 2000 forward at max speed
    pinMode(servoPin , "output");
    setInterval(function() { digitalPulse(servoPin , 1, servoPosition ); }, 20);

Avatar for maze1980 @maze1980 started