connect_virtual_motor_command only requires 3 arguments, load torque, load inertia and battery voltage.
The rest of the motor characteristics, are taken from already existant variables in VESC motor configuration.
Solved issue with encoder sensor configuration.
Solved fault gate driver undervoltage
Improved hardware dependency defines in virtual motor.c
Signed-off-by: Maximiliano Cordoba <mcordoba@powerdesigns.ca>
This commit adds a motor model running within the vesc firmware,and
from the vesc terminal a user or a test script can set the
mechanical load torque, inertia, phase resistance, Lq and Ld phase
inductances (this generic model includes IPM motors), flux linkage
and battery voltage.
Virtual motor parameters set at the command line should match with
vesc configuration, for example phase resistance, inductance and
flux linkage should match and have the correct observer gain.
Observer works with the virtual motor, with some hiccups during
startup
For solid results its better to use sensored mode. If vesc is
configured to use an SPI encoder the virtual motor phase angle
will be injected as an encoder angle readout.
For safety PWM outputs are disabled during simulation.
Signed-off-by: Maximiliano Cordoba <mcordoba@powerdesigns.ca>