Ideas for limiting false frequencies or jitter to propellers input pin in a noisy env
turbosupra
Posts: 1,088
My prop is in a noisy environment, and I took my project out of the bench testing phase where I have 2 prop's feeding each other and into the noisy environment and my code failed miserably.
Either the noise is causing my code to fail, or my code is useless so I'd like to rule out or be able to point the finger at the noise, that noise being an automotive environment.
Are there any best practices for cleaning up power inputs in an automotive environment, as well as frequency inputs? Right now I have something close to a standard Darlington Pair that converts a 12v ac sine wave signal to a 3.2v dc square wave signal to be inputted to the prop and my power supply is just the components that came in the kit from Parallax, a 5v regulator and a 3.3v regulator.
Thanks for reading.
Either the noise is causing my code to fail, or my code is useless so I'd like to rule out or be able to point the finger at the noise, that noise being an automotive environment.
Are there any best practices for cleaning up power inputs in an automotive environment, as well as frequency inputs? Right now I have something close to a standard Darlington Pair that converts a 12v ac sine wave signal to a 3.2v dc square wave signal to be inputted to the prop and my power supply is just the components that came in the kit from Parallax, a 5v regulator and a 3.3v regulator.
Thanks for reading.
Comments
BTW, my suggestion only makes sense of the Propellers are separated. If they're in the same enclosure, the shielding and power filtering recommendations are all you can do.
One of the propellers simulates the engine frequencies in the bench setup, but inside of the vehicle I am only using 1 propeller as I don't need to simulate the engine frequencies at that point. If I understood your response correctly I believe I may have misled you into thinking I was still using both in the vehicle?
What about the chassis ground, do you think there could be any back feed with that?
Series resistance is always good, we often use a PTC 'fuse' and a decent Zener, as both series resistance, and protection.
For frequency inputs, a schmitt buffer with a RC IP filter is always good to remove 'out of range' signals.
If you want to add isolation, a Logic opto coupler like the H11L1 is widely sourced, and includes the Schmitt action.
Since my code works well on the bench, I'm inclined to think it is the environment, although I'm not a very good coder so there is that too.
If you click on the bottom picture you can see a much larger version and something that indicates where it is on the board. The first picture is the signal conditioning circuit.
Each signal enters in through the white wires to their 10k resistors
You should convert at least to a perf board, all soldered connections.
Although I understand the value in having the perfboard/pcb, I'm not sure how it is possible (although I'm open to ideas) as I have no idea how my final layout is going to be.
I can add the caps (since I convert to dc, should they be polarized?) pretty easily and even put a giant piece of grounded metal under the whole thing or around the whole thing if you think that's a decent idea, but I really need the flexibility to move components around. The i/c's currently are not being used, but were tested for functionality and will be used in the future. At this point I am just trying to get the transistor pairs up and running and functional or the whole project is useless.
How do people do proof of concept with perfboards/pcbs? The signal is 6khz at highest, 300hz at lowest.
Polarized is just a negative side effect requirement with some type of caps and nothing should "look" for.
Ceramic caps don't have this side effect and with 0.1uF you should definitely go with Ceramic (and up to and including 10uF)
And you should also make power and gnd connection wires just thin enough to handle the board requirements, as bigger is not better in this case.
-Mike
So has anyone ever tried shielded wire on the breadboard runs? Is that even reasonable? I will look for a metal enclosure today and map out where I can place capacitors as well.
@Mike, care to share some details about what type of vehicle, etc? Did you use any specific circuit that is readily available online that I could look at? I see that they use that i/c with the megasquirt as well.
For a small project requirement like yours, I like this little radio shack board which has two power busses through the center. You can stack these with standoffs of mount them side by side with screws if you need more room. For a Prop Stick prototype, use one board and single row headers on each side for each connections. Then use another board for the other components. Stack them or side by side, then place in a box. Run GND to the box.
Given the incoming signal may be attenuated by the 100k and the possiblity of differing ground potentials I'd consider ac-coupling the input (that way if the square wave ends up being more like 2..10V peak to peak it won't read as constantly high. Alternatively use a resistor divider to bring the 12V range down to 3V.
I have used the small inductors (don't recall exact values) that resemble 1/2 watt resistors to add filtering to circuits in noisy environments. In a 12V system they have the added benefit of reducing the power dissipation of the regulator since they also have some resistance. If you use an optoisolator for the signal you could use a PII filter for the power and ground to reduce noise on both.
Components have been sourced and Radio Shack has been raided
I believe I have the Schmitt triggers in my electronics parts, I have to go check though.
VRS type sensors are very noise resistant, but only if you follow the proper interfacing procedures. You must use a shielded cable, with the shield connected at the PCB ground side, preferably as close to the power supply ground as you can, to create a low impedance path.
If you follow proper decoupling, grounding, and interfacing guidelines, and use the LM1815 (with the reference circuit they provide), you should be able to see the signal with very little noise.
You still need to implement filtering and recovery in your code to prevent signal hiccups from torching your process.
What are you doing with this signal? What does your circuit do? If you have visions of generating a similar signal, you need to understand how zero-crossing interfacing works.
It is a hall effect sensor, both crank position and cam position.
Do you still recommend looking at the LM1815?
I may have to do software filtering, if I have the space in my code
I right now I am monitoring the signal and then doing some calculations, I do have visions of generating a modified duplicate signal down the road.
I seem to recall that MegaSquirt users reported a lot of issues with Toyota motors due to noise. Often related to the charging system.
If you have this already, you can craft your own filter/schmitt.from here, with small changes.
* Add a capacitor across D1, start with around 1nF - exact value depends on signal overdrive amplitude.
* Join the Q1.Q2 emitters, and insert a resistor to ground, R4.
* Skew the values or R1 and R3, with R3 smaller.
A lower R3 gives a higher emitter voltage when Q2 is on, and as Q2 turns off, the falling emitter voltage is positive feedback to Q1, so you get a schmitt action.
If R3 is 4.7k, and R1 is 10k, then R4 = 220 ohms, will give about 140mV of hysteresis, from a quick calc.
Easy to run this up on spice.
If you are piggybacking the ECU, you would only need to buffer the input and filter it. IF you are not piggybacking, you need to provide a pullup to 12v to bias the sensor, buffer, and level translate
I can't see any decoupling capacitor around PROPELLER on Yours setup!.
Not mention at least one Tantalum on XTal side of it.
So I can say that way -- You are lucky that it function for You --- BUT if You will that function in noisy environment -- YOU need add much of them.