|
HF-MAX22200 Driver 0.1.0-dev
HF-MAX22200 C++ Driver
|
Real-hardware Parker C21 24 V solenoid cycle test on MAX22200 CH0. More...
#include <cinttypes>#include <cstdio>#include <memory>#include "freertos/FreeRTOS.h"#include "freertos/task.h"#include "esp_log.h"#include "esp32_max22200_bus.hpp"#include "esp32_max22200_test_config.hpp"#include "max22200.hpp"#include "max22200_registers.hpp"#include "max22200_types.hpp"Namespaces | |
| namespace | cfg |
Macros | |
| #define | ESP32_MAX22200_ENABLE_DETAILED_SPI_LOGGING 0 |
| #define | ESP32_MAX22200_ENABLE_VERBOSE_BUS_LOGGING 1 |
Functions | |
| void | app_main () |
Variables | |
| constexpr uint8_t | cfg::kChannel = 0 |
| OUT0 / SOL_CH0. | |
| constexpr uint16_t | cfg::kHitCurrent_mA = 102 |
| 24 V / 235 Ω ≈ 102 mA | |
| constexpr uint16_t | cfg::kHoldCurrent_mA = 51 |
| 50 % of hit per C21 table | |
| constexpr float | cfg::kHitTime_ms = 100.0f |
| C21 minimum hit pulse. | |
| constexpr ChopFreq | cfg::kChopFreq = ChopFreq::FMAIN_DIV4 |
| ≥ 1 kHz floor | |
| constexpr uint32_t | cfg::kOnDuration_ms = 2000 |
| constexpr uint32_t | cfg::kOffDuration_ms = 2000 |
| constexpr uint32_t | cfg::kCycleCount = 0 |
| 0 = run forever | |
| constexpr uint32_t | cfg::kTelemetryPeriod_ms = 100 |
| 10 Hz | |
| constexpr bool | cfg::kEnableSlewRateControl = true |
| constexpr bool | cfg::kEnableOpenLoadDetection = false |
| constexpr bool | cfg::kEnablePlungerMovementDet = false |
| constexpr bool | cfg::kEnableHitCurrentCheck = false |
Real-hardware Parker C21 24 V solenoid cycle test on MAX22200 CH0.
Drives a single Parker C21-series 24 V solenoid (235 Ω coil → 102 mA peak / 51 mA hold per the C21 Hit-and-Hold table) on MAX22200 channel 0 in CDR (current-controlled hit-and-hold) mode and cycles it ON / OFF periodically. A 10 Hz telemetry task scrapes:
Default cycle profile: ON for 2000 ms (102 mA hit pulse for 100 ms then 51 mA hold) OFF for 2000 ms (channel released) telemetry @ 10 Hz throughout run forever (Ctrl-] to stop)
Edit the cfg namespace below for a different C21 variant or cycle cadence.
main/esp32_max22200_test_config.hpp for the full pinout. SPI: MISO=GPIO35, MOSI=GPIO37, SCLK=GPIO36, CS=GPIO38; Control: ENABLE=GPIO2, CMD=GPIO39, FAULT_N=GPIO42, TRIGA=GPIO40, TRIGB=GPIO41. Coil between OUT0 and +VM (low-side switching).c21_dpm_tuning_test for live tuning.| #define ESP32_MAX22200_ENABLE_DETAILED_SPI_LOGGING 0 |
| #define ESP32_MAX22200_ENABLE_VERBOSE_BUS_LOGGING 1 |