Closed kirbyny closed 11 months ago
After looking at the source, it appears that PWM values I am seeing are the result of the channel data defined in pwmWrite.h.
Modifying these values produces the expected PMW values.
I am unsure where the original 5.7ms value came from, though changing the values shown below has eliminated the issue. Requesting a value lower than servoMinUs now outputs 2.5ms, though this seems counterintuitive (I would expect it to substitute .5ms rather than 2.5ms).
original code
` mem_t mem[16] = { // channel data (see above)
{255, 1000, 0, 8, 0, 0, 0, 544, 2400, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 0, 0, 0, 544, 2400, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 0, 1, 0, 544, 2400, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 0, 1, 0, 544, 2400, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 0, 2, 0, 544, 2400, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 0, 2, 0, 544, 2400, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 0, 3, 0, 544, 2400, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 0, 3, 0, 544, 2400, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 1, 0, 0, 544, 2400, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 1, 0, 0, 544, 2400, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 1, 1, 0, 544, 2400, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 1, 1, 0, 544, 2400, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 1, 2, 0, 544, 2400, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 1, 2, 0, 544, 2400, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 1, 3, 0, 544, 2400, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 1, 3, 0, 544, 2400, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0}
};`
modified code
mem_t mem[16] = { // channel data (see above)
{255, 1000, 0, 8, 0, 0, 0, 500, 2500, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 0, 0, 0, 500, 2500, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 0, 1, 0, 500, 2500, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 0, 1, 0, 500, 2500, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 0, 2, 0, 500, 2500, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 0, 2, 0, 500, 2500, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 0, 3, 0, 500, 2500, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 0, 3, 0, 500, 2500, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 1, 0, 0, 500, 2500, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 1, 0, 0, 500, 2500, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 1, 1, 0, 500, 2500, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 1, 1, 0, 500, 2500, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 1, 2, 0, 500, 2500, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 1, 2, 0, 500, 2500, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 1, 3, 0, 500, 2500, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0},
{255, 1000, 0, 8, 1, 3, 0, 500, 2500, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0}
};
Are the values of 544/2400 non-arbitrary?
Testing environment is Arduino Nano ESP32 (S3), IDE 2.2.1 Attached scope trace taken using GPIO 6, but other GPIO produce same results.
I'm assuming that I'm mis-reading the docs and simply doing something wrong here.