You are here

ADC pin voltage not zero

13 posts / 0 new
Last post
zoppp
Offline
Last seen: 11 months 2 weeks ago
Joined: 2018-09-24 04:24
Posts: 10
ADC pin voltage not zero

Hey all, 

Been having and issue with my FOCBOX where my adc pin is reading 1.2v and will not read any throttle inputs. I was using 5v on my throttle, but after learning the ADC input needs 3.3v, I swapped my throttle to 3.3v. The system was working fine for the last week, but I would notice that every so often the pin would read 1.2v, but now pin always fluctuates around 1.2v and does not change with applying throttle. Even with the throttle disconnected, ADC1 and 2 read nonzero values. 

I continuity tested the pins and it does not seem like anything is shorting. The board has been conformal coated.

The temperature sensor seems to be unaffected, maybe the ADC is okay? I have tried putting a pulldown resistor from adc_ext to ground but that only bring ADC1 to 0 and makes it unresponsive to inputs, ADC2 remains at its non-zero voltage. 

Is my ADC toast or is there a way to fix this?

https://imgur.com/a/lYzxAHy : Screenshot of problem

 

Edit: After taking apart my throttle, measuring the values on the hall sensor, the voltage has now returned back to normal. Could this point to a faulty throttle? I have no clue what I did that fixed the problem, im guessing when taking the throttle apart, I moved some wires around which made the sensor work again. 

sam.vanratt
Offline
Last seen: 10 months 3 weeks ago
Joined: 2018-11-18 14:09
Posts: 83

Hi

I answered that on my thread:

https://vesc-project.com/node/727

 

P.S.: let your throttle run in save voltage at 5V (3,3V is too low for HALL sensors) and use a resistor bridge to lower the voltage

Pedelec usage in combination with a GoldenMotor MagicPie3 BLDC

zoppp
Offline
Last seen: 11 months 2 weeks ago
Joined: 2018-09-24 04:24
Posts: 10

Even when I was running 5v, I had the same problem. I was not using a voltage divider, and the max signal voltage was around 3V. Now the max voltage is around 1.5V while running on 3.3 which may not be enough to power the hall effect sensor. 

-zoppp

zoppp
Offline
Last seen: 11 months 2 weeks ago
Joined: 2018-09-24 04:24
Posts: 10

As suggested, I used a 10K pot to divide the voltage, throttle works well for now. Hope the phantom noise doesn't return. 

-zoppp

sam.vanratt
Offline
Last seen: 10 months 3 weeks ago
Joined: 2018-11-18 14:09
Posts: 83

Hi zoppp

I'm unable to figure out why you got 1,5V out of 3,3 (btw: I'm pretty sure your HALL throttle does not really work with 3,3V but 5V). If you use a R/2R (e.g. 10kOhm vs 22kOhm) Divider, your throttle will be downgraded from e.g. 4.2V to about 2,9V (1/3 is sheered off). One end of the divider (the 20k Resistor) must be against ground which is important as the input of the STM does not have a pulldown resistor so it is open to any static around. Your poti is  just a divider with a variable value. Potis tends to "scratch" and lift off the resistor, so using a resistor after finding the real value is quite common.

It's important it works in the end, no matter how :-)

Cheers

Sam

 

Pedelec usage in combination with a GoldenMotor MagicPie3 BLDC

zoppp
Offline
Last seen: 11 months 2 weeks ago
Joined: 2018-09-24 04:24
Posts: 10

Starting to think my ADC is toast. After installing a 10k pot, the phantom noise stopped for a few days, but now has returned. ADC1 will get stuck around 1.1V and moving the throttle does not change the value at all, this results in the motor still spinning even though no throttle is commanded.  I am using a 10k pot with the wiper pin connected to the ADC pin, the other two pins are connected to the signal wire from the 5v throttle and to ground on the VESC. I have a bluetooth module drawing 5V power in parallel with the throttle circuit. I hooked my throttle circuit with the Pot to a bench power supply and an oscilloscope to see if I could replicate the behavior and it was not replicable. With the pot wiper turned all the way to one side, the range of values varies between 0.74V to 1.39V. I also read the ADC values when no throttle is connected, ADC1 reads 0V while ADC2 fluctuates rapidly around 1.4V. @Sam.vanratt, I believe I have my pot wired like the divider you are describing. 

Any ideas what could still be wrong? I have remade my wiring harness 3 times now thinking that the issue was bad connections. 

-zoppp

sam.vanratt
Offline
Last seen: 10 months 3 weeks ago
Joined: 2018-11-18 14:09
Posts: 83

Hi zoppp

basically the ADC1+2could be tested very nice with the help of a poti and the 3,3V Vcc. The wiper connects to the ADCx Input, and the other two are GND and the Vcc. The Input then MUST follow the 0...3,3V else the Input is severely damaged (soldering paste, input floating). The divider from me just justifies the 5V output of my throttle (as mentioned before 3,3 is currently too low for all HALLs I know, even when it works with limits). In the same go I diagnosed a free floating Input (ADC1+2) so I solved the floating just as well (any R from Input to GND would have solved this floating, but the STM offers a pull down or pull up if programmed on any input; the VESC is just not doing it, so it floats). My first VESC had a bad soldering on the 5V Vcc so it fluctuates while testing which costed me a lot of time just to find the many causes I had in my "ESC-bugzilla".

I'd connect a multimeter on the ADC1/2 just to see if the VESC is getting a wrong input (like in my case) or if the Input is OK, but the VESC is not interpreting it the right way (as in my case with the fluctuating 5V) OR if some secondary function like Brake on ADC2 is stopping/interrupting the ADC1 signal (again:_like in my case as I was unaware of the floating gate).

Cheers

Sam

Pedelec usage in combination with a GoldenMotor MagicPie3 BLDC

zoppp
Offline
Last seen: 11 months 2 weeks ago
Joined: 2018-09-24 04:24
Posts: 10

Ill check out my 5V level to see if it is stable. Could be that my throttle is not getting enough voltage to run properly. I tested the throttle without any potentiometer on a bench supply with the output signal passed into a scope. The throttle seems to function fine between 4.7-5V and it still works with the potentiometer. I have noticed occasionally the throttle will work fine for a few seconds before entering the failure mode discussed previously, leading me to believe it could be the 5v pin.

Diagnosing this has been a mess as the system seems to work fine when not attached to my bike, but as soon as I enclose everything and put it on the bike, the throttle will work for a few mins before failing. This is leading me to believe the failure is due to a combination of unstable voltage and possible poor connection quality

 

-zoppp

sam.vanratt
Offline
Last seen: 10 months 3 weeks ago
Joined: 2018-11-18 14:09
Posts: 83

Hello zoppp

one of the advantages of lab solutions is the reproducibility. It took me a complete disassemble of all ingredients just to find a multiple error in my assumptions (missing PullUp/down resistor), the hardware (Vcc) and my defective cable/Throttle and the meaning of the VESC Software modes. When I did a lab construction suddenly software and hardware worked as expected. Then I checked each component and point by point it grew better when I transferred the VESC back into it's place and checking all the sensors/inputs. Then I found the poti is working but the throttle not, then the brake interception when acceleration because of the missing Pullup (in my case) resistor. It was fast solved as soon as I understood each component and function and what was wrong. Bad soldering is very rare and hasn't happend on a professsional assembly for many years, so not the most likely place to search. A simple poti is a quick fix to simulate a working throttle.

Cheers

Sam

Pedelec usage in combination with a GoldenMotor MagicPie3 BLDC

zoppp
Offline
Last seen: 11 months 2 weeks ago
Joined: 2018-09-24 04:24
Posts: 10

Hey Sam, 

Thanks for all the input in this thread. I actually have tried a new potentiometer in my voltage divider and the problem is still persisting. At this point I am guessing my chineseum throttle is defective and was unable to get it to fail during my lab bench tests. When I disconnect the throttle, my ADC reads 0v which tells me the pot is soldered properly as the signal is no longer floating. Ill give your idea of using a poti as a throttle a try to see if my ADC is messed up. I also have a new 5v throttle on the way to see if the throttle is truly the problem. 

-zoppp

sam.vanratt
Offline
Last seen: 10 months 3 weeks ago
Joined: 2018-11-18 14:09
Posts: 83

Hi zoppp

in 7 years I'd three defective throttles, so that does not sound unfamiliar. It was always the HALL sensor... The last time I ordered 4 pieces, so I've enough spare parts.

Cheers

Sam

Pedelec usage in combination with a GoldenMotor MagicPie3 BLDC

zoppp
Offline
Last seen: 11 months 2 weeks ago
Joined: 2018-09-24 04:24
Posts: 10

Yeah my previous throttle was exhibiting similar behavior after a few months. It very well could be my throttle. I am starting to believe an inductive spike from my motor phase wires might have caused my sensor to fail. My phase wires are quite close to my throttle wires, so there is a chance an inductive spike fried my hall sensor.

-zoppp

zoppp
Offline
Last seen: 11 months 2 weeks ago
Joined: 2018-09-24 04:24
Posts: 10

Looks like the throttle was the problem. After changing my throttle, my voltages range from .5 to 3.3v and it is not cutting out randomly.....yet

-zoppp