I solved the signature problem. Turns out the signature is just an integer converted from a very long string containing all parameters' settings. Once the correct signature is written in the firmware, the whole thing run perfectly.
Below is my original situation. Basically I editted the code of bldc and vesc tool by adding a variable to motor configuration which causes the motor configuration deserialization to fail. Now I narrow the problem down to something being wrong with the motor configuration signature. In confgenerator.h I found the constants of the signature but it's just a long number and doesn't make any sense. Can someone tell me how to generate the correct signature so that the motor configuration can be deserialized? Thank you!
my confgenerator.h:
// This file is autogenerated by VESC Tool
#ifndef CONFGENERATOR_H_
#define CONFGENERATOR_H_
#include "datatypes.h"
#include <stdint.h>
#include <stdbool.h>
// Constants
#define MCCONF_SIGNATURE 2211848314
#define APPCONF_SIGNATURE 3264926020
// Functions
int32_t confgenerator_serialize_mcconf(uint8_t *buffer, const mc_configuration *conf);
int32_t confgenerator_serialize_appconf(uint8_t *buffer, const app_configuration *conf);
bool confgenerator_deserialize_mcconf(const uint8_t *buffer, mc_configuration *conf);
bool confgenerator_deserialize_appconf(const uint8_t *buffer, app_configuration *conf);
void confgenerator_set_defaults_mcconf(mc_configuration *conf);
void confgenerator_set_defaults_appconf(app_configuration *conf);
// CONFGENERATOR_H_
#endif
I want to control aux to switch on and off depending on mosfet temperature and I want to change the temperature settings directly on vesc tool.
So, for the source code of vesc tool, I modified parameters_mcconf.xml by adding extra variables like this:
Around line 500:
<l_temp_fet_low>
<longName>MOSFET Cooling Low Threshold</longName>
<type>1</type>
<transmittable>1</transmittable>
<description><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Sans Serif'; ; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The MOSFET temperature threshold(below which the cooling system turns off).</p></body></html></description>
<cDefine>MCCONF_L_LIM_TEMP_FET_LOW</cDefine>
<editorDecimalsDouble>1</editorDecimalsDouble>
<editorScale>1</editorScale>
<editAsPercentage>0</editAsPercentage>
<maxDouble>120</maxDouble>
<minDouble>0</minDouble>
<showDisplay>1</showDisplay>
<stepDouble>1</stepDouble>
<valDouble>85</valDouble>
<vTxDoubleScale>1000</vTxDoubleScale>
<suffix> °C</suffix>
<vTx>9</vTx>
</l_temp_fet_low>
Around line 3500:
<ser>l_temp_fet_low</ser>
Around line 3600:
<param>::sep::MOSFET Cooling</param>
<param>l_temp_fet_low</param>
After done this I can actually see the field appear in vesc tool.
And for firmware, I modified datatypes.h by adding the corresponding float variable in mc_configuration struct like the following.
float l_temp_fet_low;
conf->l_temp_fet_low = MCCONF_L_LIM_TEMP_FET_LOW;
In confgenerator.c, "buffer_append_float32_auto(buffer, conf->l_temp_fet_low, &ind);" is added.
In mcconf_default.h, the following is added.
#ifndef MCCONF_L_LIM_TEMP_FET_LOW
#define MCCONF_L_LIM_TEMP_FET_LOW
#endif
But when vesc tool tries to connect with the firmware, the error message throws out saying deserializing motor configuration failed. Can someone tell me what may cause that problem? Thanks.
Your changes are likely the cause. But you didn't bother to elaborate what they were. The quality of an answer is directly related to the quality of the question.
NextGen FOC High voltage 144v/34s, 30kw (https://vesc-project.com/node/1477)
Thanks for pointing that out. I edited the question by adding all the modifications that I have done. By doing that I just want to add an extra parameter in motor configuration. Any idea?
Haocheng Chang
I have added a few more AUX port options in the 5.03 development version. Is that what you are looking for?
How did you know what to update the signature to? I Am trying to do a very simple build that just allows 0x72 as a valid MPU9150_WHO_AM_I, and can't get the signatures to work.
ddd
I have same problem but dont understand the solution
rafe