You are here

[solved] Where the motor configuration signature is from?

6 posts / 0 new
Last post
Beren
Offline
Last seen: 3 years 6 months ago
Joined: 2021-05-29 05:27
Posts: 2
[solved] Where the motor configuration signature is from?

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>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; ; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;The MOSFET temperature threshold(below which the cooling system turns off).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</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.

vadicus
Offline
Last seen: 4 days 7 hours ago
VESC Free
Joined: 2018-08-17 07:26
Posts: 431

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)

Beren
Offline
Last seen: 3 years 6 months ago
Joined: 2021-05-29 05:27
Posts: 2

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

benjamin
Offline
Last seen: 5 days 20 hours ago
VESC FreeVESC OriginalVESC Platinum
Joined: 2016-12-26 15:20
Posts: 490

I have added a few more AUX port options in the 5.03 development version. Is that what you are looking for?

ddoenges
Offline
Last seen: 1 year 9 months ago
Joined: 2022-04-16 06:34
Posts: 1

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

rafeh1
Offline
Last seen: 3 weeks 1 day ago
VESC Free
Joined: 2018-01-07 02:24
Posts: 9

I have same problem but dont understand the solution

 

rafe