RPM meter with HALL sensor and DC offset - Page 1
Forum section: electronics / beginners

author: SHristovBG
author_rank: Newbie
timestamp: February 26, 2024, 03:51:06 pm
content: Hi guys,For the last couple of days I'm working on RPM meter for gyrocopter (Autogyrohttps://en.wikipedia.org/wiki/Autogyro)It uses hall sensors (switch) to count the pulses from two different axles (the propeller and the rotor). My first idea was:SimulatorFrom the hall sensor, 10k and 3.3 zenner, 1nF for nose reduction (from the ignition).After that one shmitt trigger to guarantee the fronts and it goes to the MCU. With the signal generator everything was working fine.Today we tested it on the real engine and big nopeThe output of the trigger was constant high.I found out, that the signal from the hall sensor have ~400mV offset so the high level is 12V the low is 0.4~0.5VMaybe the transistor in the hall sensor isn't saturated + drop over the wiring...If I reduce the pullup resistor, the low level will drop.It will have to be around 10k to get it working, but I'm afraid, that this could get the device sensitive to noise.So my next idea looks like this:SimulatorWith the 100 Ohm resistor I'm adding that 0.5V offset.The 4.7uF is used to block the DC component. The OpAmp is used as comparator + small positive feedback for hysteresis.In theory, that should work. (I hope)I will be happy to hear the opinion of someone with more experience in the analog domain or how I could improve it.Best regards,Spas

author: Infraviolet
author_rank: Super Contributor
timestamp: February 26, 2024, 06:47:50 pm
content: What type of device is the hall sensor? I've used them before for rotation tracking, but not in electrically noisy environments (your ignition sparks...). TLI49, TLE49 and AH3772-SA-7 have all worked for me. These are latching not linear sensors, so should already filter some noise themselves, though probably more for magnetic noise than filtering of the output electrical signal. Each needs to have a magnet pair swing past it with about 4milliTesla (or more) of voltage swing at the device's location between when the north facing magnet passes and the south facing magnet passes.They are small consumer/automotive grade SMD devices, perhaps not aerospace grade, but a bunch of them working independently then voting on their signal state via some logic ICs, then feeding that to the MCU could probably be as reliable as a prebuilt hall sensor unit.Also, it sounds like you are doing speed tracking, not position. So long as it can be electrically survived by the parts involved, and is relatively rare, a spurious fake pulse from noise might not be a problem. Reading say one extra pulse per second than should be counted would be a problem for position tracking applications as it integrated over time, but won't be a significant eror for a speed reading.Be warned, the 4.7uF cap in your second design means you are only passing the AC component of signals, that might not be the behaviour you want. It was only for 5V, not for 12V to 3V3 conversion, but attached is a picture of the setup I've used when deliberately adding hysteresis to a signal:One solves for R1, R2 and R3 for given choices of voltage levels with the follofiwng script (runs in R, but you could translate for other languages):#R1 runs from op amp +ive input to 5V#R2 runs from op amp +ive input to gnd#R3 runs from op amp +ive input to +5v while below flipping point and to gnd once above it#solve for a combination of R1,2 and 3 so as to give desired values for Vutp and Vltp hysteresis limitsCommonRVals=c(1,1.2,1.5,1.8,2.2,2.7,3.3,3.9,4.7,5.6,6.8,8.2,10,12,15,18,22,27,33,39,47,56,68,82,100)R=c(1,1,1)Vutp_des=3.8 #calculates for these desired valuesVltp_des=3.5 #these are your upper and lower thresholdsVin=5 #this is your supply voltageBadnessUOld=1e9BadnessLOld=1e9counterA=1counterB=1counterC=1calcCount=1BestA=1BestB=1bestC=1counterMax=length(CommonRVals)while(counterA<=counterMax){while(counterB<=counterMax){while(counterC<=counterMax){R=CommonRValsR=CommonRValsR=CommonRValsVutp=Vin * ( R/ ( R + (1 / ( (1/R) + (1/R) ) ) ) )Vltp=Vin * ( ( 1/( (1/R) +(1/R) ) ) / ( R + 1/( (1/R) +(1/R) ) ) )#print(calcCount)calcCount=calcCount+1BadnessU=(Vutp_des-Vutp)^2BadnessL=(Vltp_des-Vltp)^2#to prevent it getting stuck on a peak of one voltage optimised but the other stuck far away, we improve solutions either if better or if within 0.05V of ideal, 0.05^2=0.0025if((BadnessU<=BadnessUOld || BadnessU<0.0025) && (BadnessL<=BadnessLOld ||BadnessL<0.0025)){BadnessUOld=BadnessUBadnessLOld=BadnessLBestA=counterABestB=counterBBestC=counterC}counterC=counterC+1}counterC=1counterB=counterB+1}counterB=1counterA=counterA+1}#show off resultsR=CommonRValsR=CommonRValsR=CommonRValsVutp=Vin * ( R/ ( R + (1 / ( (1/R) + (1/R) ) ) ) )Vltp=Vin * ( ( 1/( (1/R) +(1/R) ) ) / ( R + 1/( (1/R) +(1/R) ) ) )print(paste("R=",R," R=",R," R=",R,sep=""))print(paste("Vltp=",Vltp," Vutp=",Vutp,sep=""))print(paste("combinations tested: ",calcCount,sep=""))#That gives a resistor ratio, scale it to the relevant factor of 10, so this situation outputs 3.3, 10 and 39, you might choose 330R, 1K and 3K9 or 3K3/10K/39K or so on