From 7ae4248d98969ad90e472f7d75329b95bd5518b0 Mon Sep 17 00:00:00 2001 From: James Aguilar Date: Thu, 30 Apr 2026 15:23:54 -0600 Subject: [PATCH] Fix feedforward voltage initialization. Resolves https://github.com/simplefoc/Arduino-FOC/issues/522#issue-4218247852. --- src/common/base_classes/FOCMotor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/base_classes/FOCMotor.h b/src/common/base_classes/FOCMotor.h index e769c0fa..99a2c6ce 100644 --- a/src/common/base_classes/FOCMotor.h +++ b/src/common/base_classes/FOCMotor.h @@ -220,8 +220,8 @@ class FOCMotor float voltage_bemf; //!< estimated backemf voltage (if provided KV constant) float Ualpha, Ubeta; //!< Phase voltages U alpha and U beta used for inverse Park and Clarke transform - 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 + 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 // motor configuration parameters float voltage_sensor_align;//!< sensor and motor align voltage parameter