lib/libesp32/esp-32-vid6608-rmt/README.md
This library implements driver for native ESP-IDF framework for following driver chips for analog automotive gauges (Switec X25.168, X27.168 and clones) with microstepping support:
Driver chips with microstepping is the recommended way to drive such motors, they provide much more relailabe and smooth movement with reduced noise and to avoid skipping steps.
This library is very similar to Arduino-vid6608, but it implements hardware generator for driver steps sequence, the ESP-32 Remote Control Transceiver (RMT):
delay() call;Only the ESP-32 is supported. All chips has minimum 2 RMT channels.
This library has following features:
See VID6606 Datasheet (English).
This library requires that two pins (per drive) are connected to two outputs.
This library does not control RESET pin, please perform this inside your firmware.
I have problems with some IC's, as they lost function after RESET pin manipulation. Datasheet recommends to hold it LOW during boot, and set to HIGH to enable operation, but i recommend just to connect to VDD to be safe.
Motor is set to zero by moving whole scale and kept bouncing on the one of dead positions. This library provides optimized way to perform homing: it does 1/2 of scale forward, then full scale backward. This helps to reduce bouncing like in the classical "full scale back" method.
See inline documentation in source code: vid6608.h.
To compile and flash examples, navigate to example dir and call idf:
cd examples/gauge-cal
export IDF_TARGET=esp32c6
idf.py flash monitor
#include "esp32_vid6608_rmt.h"
extern "C" void app_main(void)
{
vid6608::Config cfg {
.stepPin = GPIO_NUM_14,
.dirPin = GPIO_NUM_18,
.maxSteps = 12 * 320,
};
vid6608 driver = vid6608(cfg);
driver.zero();
vTaskDelay(pdMS_TO_TICKS(2000));
driver.setPos(12 * 180);
}