Commit Graph

2 Commits

Author SHA1 Message Date
Maximiliano Cordoba 4a9bf528a9 Fix virtual motor to work with latest Vesc v5.
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>
2020-06-20 13:36:56 -03:00
Maximiliano Cordoba 4a94d0ec4c Add command to connect a virtual motor with configurable parameters
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>
2019-04-06 10:36:00 -03:00