OpenVSP Import, ESC, Avionics, Battery problems

20 views
Skip to first unread message

RON SHAHRIER

unread,
Aug 26, 2025, 4:30:01 AMAug 26
to SUAVE FORUM
I did a vehicle import from OpenVSP (the vehicle was already designed in openvsp) and running SUAVE analyses on it. Here I am sharing the problems I faced and solutions I found so it may help others.

Problem 1: Following the tutorial of basic eVTOl, trying to initialize battery using initialize_from_mass  didn't work. 
Cause: Going through the output of print(vehicle) I found, I had two battery networks name battery_propeller and battery_propeller1. I guess importing vehicle using vsp_read creates a network by default and then I was creating a second one. One had battery initialized, one didn't, that made the battery component NoneType, ultimately failing initialize_from_mass.
Solution: Delete unitentional battery network (if exists) before creating new one. 
# *******************************************************Network**********************************************************************************
# Remove the auto-created network
if 'battery_propeller' in vehicle.networks:
del vehicle.networks['battery_propeller']

net = SUAVE.Components.Energy.Networks.Battery_Propeller()
net.number_of_lift_rotor_engines = 0
net.number_of_propeller_engines = 6
net.identical_lift_rotors = True
net.identical_propellers = True
net.voltage = 400.

# *******************************************************Battery*********************************************************************************
bat = SUAVE.Components.Energy.Storages.Batteries.Constant_Mass.Lithium_Ion_LiNiMnCoO2_18650()
bat.mass_properties.mass = 800. * Units.kg
bat.max_voltage = net.voltage
initialize_from_mass(bat)

net.battery = bat

RON SHAHRIER

unread,
Aug 26, 2025, 4:38:31 AMAug 26
to SUAVE FORUM
Problem 2: battery didn't have valid discharge map. 

Cause: I installed SUAVE using both "git clone https://github.com/suavecode/SUAVE.git cd SUAVE/trunk python setup.py install"  and  manually downloading the zip file. Unfortunately, both didn't copy the NMC_Raw.Data.res file to the same location as C:\Users\Administrator\anaconda3\envs\openvsp_suave_final\Lib\site-packages\SUAVE-2.5.2-py3.6.egg\SUAVE\Components\Energy\Storages\Batteries\Constant_Mass\Lithium_Ion_LiNiMnCoO2_18650.py

Solution: Copy the NMC_RAW_DATA.res file to the location manually.
 Untitled.jpg

RON SHAHRIER

unread,
Aug 26, 2025, 4:42:16 AMAug 26
to SUAVE FORUM
Problem 3: this error: 
File "C:\Users\Administrator\anaconda3\envs\openvsp_suave_final\lib\site-packages\suave-2.5.2-py3.6.egg\SUAVE\Components\Energy\Networks\Battery_Propeller.py", line 155, in evaluate_thrust
    esc.inputs.voltagein = volts
AttributeError: 'NoneType' object has no attribute 'inputs'

Cause:  After going through output of print(vehicle), found out network.propeller_esc was initialized, but network.esc was still NONE (My vehicle has only propellers, no lift rotors, so no lift escs).

Solution: Also initialize network.esc 
# *******************************************************ESC**************************************************************************************
esc = SUAVE.Components.Energy.Distributors.Electronic_Speed_Controller()
esc.efficiency = 0.95
net.propeller_esc = esc
net.esc = esc

RON SHAHRIER

unread,
Aug 26, 2025, 4:47:29 AMAug 26
to SUAVE FORUM
Problem 4: This error: 
  File "C:\Users\Administrator\anaconda3\envs\openvsp_suave_final\lib\site-packages\suave-2.5.2-py3.6.egg\SUAVE\Components\Energy\Networks\Battery_Propeller.py", line 244, in evaluate_thrust
    avionics.power()
AttributeError: 'NoneType' object has no attribute 'power'

Cause: To understand the code, I was following along the tutorial of Basic eVTOL. I wrote the code following the video. The video has this mistake:  
# *******************************************************Avionics**********************************************************************************
avionics = SUAVE.Components.Energy.Peripherals.Avionics()
avionics.power_draw = 700. * Units.watts
net.payload = avionics
So, avionics was not initialized. (The code for basic evtol tutorial on github does not have this error)

Solution: Fix the error. 
# *******************************************************Avionics**********************************************************************************
avionics = SUAVE.Components.Energy.Peripherals.Avionics()
avionics.power_draw = 700. * Units.watts
net.avionics = avionics
Reply all
Reply to author
Forward
0 new messages