Skip to content

[BUG] feed_forward_voltage/current can contain random stack/heap garbage #522

@StijnWoestenborghs

Description

@StijnWoestenborghs

Describe the bug
FOCMotor.h defines

    DQCurrent_s feed_forward_current;//!< current d and q current measured
    DQVoltage_s feed_forward_voltage;//!< current d and q voltage set to the motor

These variables are never actively set somewhere when not initialized properly to zero.

proposal; initialize to zero

    DQCurrent_s feed_forward_current{0.0f, 0.0f};//!< current d and q current measured
    DQVoltage_s feed_forward_voltage{0.0f, 0.0f};//!< current d and q voltage set to the motor

Describe the hardware setup
For us it is very important to know what is the hardware setup you're using in order to be able to help more directly

IDE you are using

  • Something else: raw ESP_IDF with platformio

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions