Skip to content

For ESP32 motor driver the ADC code does not take the attenuation in to account #510

Description

@norventa

Having looked through the ESP32 code for the motor driver, attenuation is set:

adc1_config_channel_atten(pinToADC1Channel(pin),ADC_ATTEN_11db);

in DCCTimerESP.cpp

but then it is not taken into account when calculating the current.

ESP32 documentation shows:

Vout = Dout * Vmax / Dmax (1)
`where:

Vout
Digital output result, standing for the voltage.

Dout
ADC raw digital reading result.

Vmax
Maximum measurable input analog voltage, see ADC Attenuation.

Dmax
Maximum of the output ADC raw digital reading result, which is 4095 under Single Read mode, 4095 under Continuous Read mode.
`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions