VESC - WRONG VOLTAGE MEASUREMENT

Report your hardware problems here. Include as many details as possible with pictures to get the best possible help and feedback.
okp
Posts: 33
Joined: 15 Dec 2015, 13:07
Location: Paris
Contact:

VESC - WRONG VOLTAGE MEASUREMENT

Postby okp » 22 May 2016, 19:34

Hi there,

I got a FW 2.15 with HW 4.11

for some unknown reasons, the VESC is not identifying correctly the voltage ... which makes me go into LVC sooner than expected. I just connected one motor rolling with a voltmeter (I checked it also and the voltage is OK on the voltmeter)... and the realtime from BLDC. Big difference.

no error display in terminal when I type "faults"

Anyone knows what could be wrong ?

Thanks !


ViennaTom
Posts: 41
Joined: 21 Apr 2016, 13:06
Location: Austria/Vienna

Re: VESC - WRONG VOLTAGE MEASUREMENT

Postby ViennaTom » 22 May 2016, 22:21

Hi !
Wasn't there an issue with the value of R1 in the voltage divider ?
I guess this used to be 33000 and was changed to 39000 but if your firmware still uses the lower value for calculation this would be the reason.

GET_INPUT_VOLTAGE() ((V_REG / ADC_RESOLUTION) * (float)ADC_Value[ADC_IND_VIN_SENS] * ((VIN_R1 + VIN_R2) / VIN_R2))
VIN_R1=33000 | 39000, VIN_R2 = 2200
hence 18,7 vs 16 as a factor.
But maybe the firmware uses the right value than it must be something very different.
Regs, Tom

rew
Posts: 940
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: VESC - WRONG VOLTAGE MEASUREMENT

Postby rew » 23 May 2016, 07:58

In my implementation I was reading about 90% of VIN instead of the actual value. Digging though the code.. it turns out the resistor values were correct and used correctly....
What wasn't correct was the ADC channel to use... Apparently sampling a floating pin just after the correct analog pin will give you a reading of about 90% of the previous pin. (i.e. there is a 90% crosstalk when the driving impedance is infinity. This goes down as the driving impedance goes down.).

Prevas_erra
Posts: 24
Joined: 11 Apr 2016, 16:03
Location: Stockholm

Re: VESC - WRONG VOLTAGE MEASUREMENT

Postby Prevas_erra » 23 May 2016, 12:24

Its not correct to say its crosstalk, it is the internal sampling capacitor that slowly discharges.
From the datasheet: Internal sample and hold capacitor typical 4 pF
If you wait a bit longer it will be lower than 90% left.
In the datasheet page 134 you have an equation to determine what sampling time is needed to get low error.
Equation 1: RAIN max formula
The formula above (Equation 1) is used to determine the maximum external impedance
allowed for an error below 1/4 of LSB. N = 12 (from 12-bit resolution) and k is the number of
sampling periods defined in the ADC_SMPR1 register.

okp
Posts: 33
Joined: 15 Dec 2015, 13:07
Location: Paris
Contact:

Re: VESC - WRONG VOLTAGE MEASUREMENT

Postby okp » 23 May 2016, 20:59

guys, I love it but I don't understand one word about the calculations :) my question was... what can I do :) the firmware should be fine as I am using it on other VESCs

rew
Posts: 940
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: VESC - WRONG VOLTAGE MEASUREMENT

Postby rew » 24 May 2016, 08:17

Prevas_erra wrote:Its not correct to say its crosstalk, it is the internal sampling capacitor that slowly discharges.
It IS what is commonly called crosstalk: A signal from one channel carries over to another channel. And of course you are correct in that in this case it is caused by the sample and hold capacitor. But if you don't want to call it crosstalk, that's fine with me.

okp: Is the hardware the same between those "other VESCs"?

What I did is I checked the values of the resistors in the resistor divider. Then I checked with a multimeter the voltage on the measurement pin.

ViennaTom
Posts: 41
Joined: 21 Apr 2016, 13:06
Location: Austria/Vienna

Re: VESC - WRONG VOLTAGE MEASUREMENT

Postby ViennaTom » 25 May 2016, 12:44

You find the resistor "R3" part of the voltage divider here:

Vedder_board.jpg
Vedder_board.jpg (95 KiB) Viewed 3071 times


If you can not measure with an Ohmmeter maybe you can read the printing "333" or "393"

okp
Posts: 33
Joined: 15 Dec 2015, 13:07
Location: Paris
Contact:

Re: VESC - WRONG VOLTAGE MEASUREMENT

Postby okp » 29 May 2016, 18:22

thanks, I can't read the printing as it's too small or just not displayed on the resistor. I looked with an ohmmeter set to 200 and I read 2.6 on R3.

My actual battery voltage is 36.2V and the VESC realtime displays 29.5V. I have upgraded to FW 2.18, but well still the same.

Do you have any idea of what is going on? I am actually using HW 4.10.

I measure the R3 on a HW 4.7 from the good old days... and it's 4.6 displayed.

thanks!

rew
Posts: 940
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: VESC - WRONG VOLTAGE MEASUREMENT

Postby rew » 29 May 2016, 19:55

That is a suspiciously low value. if the meter is at 200 as you say and the reading is 2.6, that means 2.6 ohms. This is more than 10000 times less than the proper value. This cannot cause an error of 10-20 percent. So, either your measurement is wrong, or the value cannot be measured in circuit.

ViennaTom
Posts: 41
Joined: 21 Apr 2016, 13:06
Location: Austria/Vienna

Re: VESC - WRONG VOLTAGE MEASUREMENT

Postby ViennaTom » 30 May 2016, 13:08

hi !
well the readings of 2.6 and 4.6 in the ohmmeter seem to be wrong.
my ohmmeter has 7 ranges for resistance metering - diode test - 200 - 2K - 20K - 200K - 2M - 20M
we are expecting a value around 30000 to 40000 Ohm -> 30 to 40 KiloOhm -> range 200K
If the VESC firmware displays 29.5V it seems to measure 1,575 Volts on the analog input
because only 3.3V maximum can be measured the voltage of your battery is "divided" by 18.7272 (39000+ 2200) / 2200
and 1.575 therefore is multiplied by 18.7272 resulting in the 29.5V displayed

But if your battery actually has 36.2V the voltage measured at the analog pin should be higher: 36.2 / 18.7272 = 1.93V

From my calculation this would imply that the R3 resistor in your board has a value of 48000 instead of 39000 and thereby "dividing" the battery voltage by 22,8 (48000+2200)/2200 instead of the 18,72 calculated with.
Or the other resistor next to it (R4 I think) in the divider has a value of 1770 instead of 2200 giving the same result 22,8 = (39000+1770)/1770

You have to measure the resistance when the board is not powered and using the 200K range the value will show as xx.x kOhm


Return to “Hardware Problems”

Who is online

Users browsing this forum: No registered users and 1 guest