This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I recently purchased an eval board for the MSP430FR6047 Water Meter. I use transducers from Audiowell (same as those used in documention).
The pipe with transducers is on a testing bench with a flowrate (water) fixed at 500L/h.
I read the mean value of the flowrate on USS, and i'm able to calculate the new "Meter constant".
The problem is, when i want to change the default value (12742000.00) by the new one (33390985.00), i've the following error " Non-advanced parameter error : Invalid Meter Constant"
Can you help me ? I didn't find any solution in the documentation
i'm using this version : UltrasonicWaterFR604x_02_20_00_08
Best Regards,
Maxime
Hello Maxime,
To get around this issue, you need to use a multiplication factor on the meter constant. In hmi.c, you can add a multiply by 10 and scale your value entered in the GUI accordingly.
USS_getResultsInFloat( pt_alg_res, &alg_results_float); alg_results_float.deltaTOF -= gUssSWConfig.algorithmsConfig->dcOffset; DC_User_Params->plot_dtof = ((double) alg_results_float.deltaTOF); DC_User_Params->plot_abs_ups = alg_results_float.totalTOF_UPS; DC_User_Params->plot_abs_dns = alg_results_float.totalTOF_DNS; DC_User_Params->plot_vol_flow_rate = (float) 10*(alg_results_float.volumeFlowRate); //multiplication added here
You will also need to provide a divide function inside of ussDCCommandHandlers.c to divide the offset by the same factor as shown in the added code below.
//Send the Calibration Linear Constants packet->payload[COMMAND_HANDLER_CMD_BYTE_POS] = COMMAND_HANDLER_CALIBRATION_LINEAR_CONSTANTS_ID; for ( i=0 ; i < USS_VFR_METER_CALIB_RANGES ; i++) { packet->payload[3] = (i+1); temp = (uint8_t*) &gUssSWConfig.algorithmsConfig->pMeterConfiguration[i]; //temp points to the address of the meter constant calibration gUssSWConfig.algorithmsConfig->pMeterConfiguration[i].slope /= (USS_VOLUME_SCALE_FACTOR*1.0f); gUssSWConfig.algorithmsConfig->pMeterConfiguration[i].offset = gUssSWConfig.algorithmsConfig->pMeterConfiguration[i].offset * 10.0f; //added code for(j = 0 ; j < 12 ; j++) { packet->payload[j+4] = *(temp+j); } gUssSWConfig.algorithmsConfig->pMeterConfiguration[i].slope *= (USS_VOLUME_SCALE_FACTOR*1.0f); gUssSWConfig.algorithmsConfig->pMeterConfiguration[i].offset = gUssSWConfig.algorithmsConfig->pMeterConfiguration[i].offset / 10.0f; //added code Comm_writePacket(packet);
In the next release of the code, we are working to have a more elegant way to handle larger meter constants.
Hi Eddie,
I did all the steps, it seems that I'm not doing it correctly, I'm pretty new to CCS.
A screenshot of the modification of hmi.c, am i do it correctly ?
After the modification, i rebuild and then flash the card, but the result is the same, no modification.
Edit : Also need to x10 the value inside of USS_userConfig.h after generating new headers
#define USS_VOLUME_SCALE_FACTOR
Best Regards,
Maxime
Maxime,
It looks like the 10x multiplier is in the wrong spot in hmi.c actually. Please see the code snippet below with an added line of code. I have tested and this seems to work properly.
{ USS_getResultsInFloat( pt_alg_res, &alg_results_float); alg_results_float.deltaTOF -= gUssSWConfig.algorithmsConfig->dcOffset; alg_results_float.volumeFlowRate *= 10.0; //10x multiply DC_User_Params->plot_dtof = ((double) alg_results_float.deltaTOF); DC_User_Params->plot_abs_ups = alg_results_float.totalTOF_UPS; DC_User_Params->plot_abs_dns = alg_results_float.totalTOF_DNS; DC_User_Params->plot_vol_flow_rate = (alg_results_float.volumeFlowRate); }
**Attention** This is a public forum