3 Attachment(s)
Unwanted output signal jitter
Hello everyone,
First of all, thank you all for sharing your time and wisdom so others can excel.
I'm making a fuel injection circuit using the PIC16F737 that would allow me to control the outputs ON/OFF +/-. After gleaning the data specs on my part for understanding and researching this forum to get me this far plus experimentally trying different ideas, I hoped that an expert would be able to spot why I'm experiencing this unwanted signal jitter.
Attached are:
1. Copy of sample code working just one input. You'll notice that the ADC settings are not the usual settings but were left this way because I got a nicer response from the pot control. This might also be the band aid to the problem.
2. Scope screen shot of ouput signal with ON time delayed and with unwanted jitter at opposite end. If I turn the pot CCW from center, the output turn ON delay is increased from 0 to 500us.
3. Scope screen shot of ouput signal with OFF time delayed and with unwanted jitter at opposite end. If I turn the pot CW from center, the output turn OFF delay is increased from 0 to 500us.
The top trace (Yellow) is the input, bottom trace (Blue) is the output.
Input signal is 5V with 2.5ms LOW pulse and 20K pull up, pot is a 5K from 5V to GND. Output driving a current limited LED at the moment.
My sleeves are rolled up again
Thanks for the info Skimask.
Yeah, some of my comments are left overs from the different attempts to feel my way through when thinking got too hard. Now I've got something else to study "Default Justify".
I implemented all your suggestions except that one until I know what I'm doing.
Thanks again,
You guys rock!
And now for something completly different,
In keeping with my philosophy of keeping it simple, how about this idea, dump the ADC altogether, and use the CCP input to read the signal pulse duration. Bruce has posted an example how to do it using Darrel's Instant Interrupts. Instead of a pot to adjust, just read two buttons, up and down. I think you could get far greater resolution than you will turning a pot, and you could read the buttons using interrupts, or watch them in a loop. Wouldn't the four input signals, and the four injector pulses be pretty much identical for each revolution? I wonder if you could just read one or two input pulses on each revolution, and make all the outputs identical. Given the mass of the pistons and the fact that they are connected to the same crankshaft I'd be surprised if there needs to be a great variance between cylinders on a single revolution. If you can assume that the input signals and output signals would be identical that makes you job a lot easier, one timer would do it. I'm thinking that having an up and down button would allow a rider to make adjustments on the track, not just on a dyno, it would be hard to tweak a pot while sitting on a bike at speed, and eventually you will likely want to get this on the road I imagine. Your software could adjust the range of adjustment based upon the rpms of the engine, so at higher rpms you couldn't make a drastic change if you held a button too long, but at lower rpms holding the button could make a faster (greater percentage) change.
Jerry.
Heck yeah, more good info
It's been a long day, my eyes hurt from all the reading...
Making all the outputs the same on a pass makes capitol sense. Then update with the gathered timer info next time around. I'm all for simple as soon as I get some speed on this learning curve.
The adjustments will be almost a one time setting until the bike gets upgraded again or has to be readjusted on track day at the track due to temp., elevation, and things like that. But one thing for sure, can't have the rider racing one handed except for cruel entertainment pleasure on the spectators part.
Thanks for the added info b1arrk5. I will study it and try it out.