Prom ID's appear to be the same as the charted values posted last night. Only the speed displayed has changed
I can post the results every 15Hz again if needed
Prom ID's appear to be the same as the charted values posted last night. Only the speed displayed has changed
I can post the results every 15Hz again if needed
No, that's good, thanks.
I looked at the code this morning and I have a preliminary rewrite that allows the road speed constant at for the magnetic VSS to be used for both speed sensor types. That would save time with trial and error and would allow one to determine pretty readily whether or not the optical input is viable.
If running this code and doing trial and error with the road speed constant seems like too much hassle, I can try and dig out my ecm bench and my speed signal generator.
I guess that choice is up to the OP and JeepsandGuns. I'll test any code changes with the bench setup you guys want. I'm going to be around home pretty much all day. Its pouring rain here so outside work is on hold. I'll check the thread for updates throughout today. I just set up the signal generator so we could input a known frequency and test changes. Thats a lot easier than trying to spin a sensor with a drill etc. I'll load up the bins later and do a compare to see what you are changing.
Hmm, well if I'm reading the schematic right then B21 goes into a logic gate and the gate is CMOS and powered by battery voltage, so the input signal must switch from 0V to Vbat-3V. So, 0V to 9V if you're using a 12V supply, or 0V to about 11.5V if it's in vehicle. This could be tested by increasing the signal voltage and see what voltage is required for the PCM to read the correct speed.
There are 3 ways to fix this problem.
#1 - Power the sensor by battery voltage.
- the sensor could just output at 12V switched signal instead and everything would work correctly.
- the higher voltage might also kill the sensor
- feeding the higher signal voltage to the speedometer might hurt the speedometer
#2 - build a circuit to take the 0-5V signal and convert it to a 0-12V signal
- this is fairly easy using a transistor and a couple of resistors.
#3 - build a circuit to take the 0-5V signal and convert it to a -2.5V to 2.5V signal and use the magnetic input.
- I think a capacitor and resistor of the correct value would work. Basically a high pass filter which removed the DC offset
- this could have issues measuring speed when transitioning from a stop to moving
I just checked the lowest input signal it can accept and it is about 2.6 Vp/p. I just now measured the input and it is internally pulled up to battery voltage. When I connect the signal generator directly to the input, it lets signal bounce betwen 0 and 5v or whatever I set the amplitude of the output. If this is a concern, all that would have to be done, is to use a 2n3904 transistor with about a 1k series resistor to the base from the sensor. Tie the collector to the B21 input and the emitter to ground. This input is just switched to ground through the sensor. It works fine if the input is pulled to 5v on high and near zero on low so the direct connection of the sensor to the input will probably work.
Edit: I can breadboard my solution if needed
Last edited by sturgillbd; 03-14-2015 at 07:42 PM. Reason: Edit is labeled in post
I went ahead and breadboarded the transistor circuit I described. It made absolutely no difference in what speed the ECM shows in the datastream. So a 0-5v signal is no different than a 0 to battery voltage signal. The 0 -5 volt VSS will supply the proper signal if the code can be worked out.
I was expecting the code would just use 2k instead if 4k meaning 133hz would produce 240mph. But, it's never that simple.
The magnetic VSS input goes VSS -> zero crossing detector -> divide by 2 flip flop -> logic to select which input -> processor
The optical VSS input goes VSS -> inverter -> logic to select which input -> processor
Here's the schematic of the circuit. Once processed, either VSS signal should produce the same the same signal at VSS on the right. Well the ZCD and flip flop likely have the magnetic still putting 4k at VSS while the optical puts 2k at VSS, assuming the ZCD produces 2 pulses per cycle as 1project2many posted earlier. If the code just switches out4 then the other input would work, but it has a 2x speed multiplication on it. You have pretty much proved the 2x pulse difference is there with your test giving 30hz producing 118mph instead of ~60mph. So, 1project2many is correct. If he can figure out how to count 8k pulses instead of 2k pulses it should work. So, routing the optical VSS to the same magnetic VSS code should make it work.
I'm just curious why the code suddenly starts counting the optical input as other than 2kppm when you increase the pulse input from 60hz to 133hz. How does it decide that's not a 2k ppm input?
Attachment 8638
Last edited by lionelhutz; 03-14-2015 at 10:29 PM.
This is the second bin file that 1project edited. I can flip the flag and tell you the results of connecting to the magnetic vss inputs too. I may just connect my emulator up so the changes can happen more easily.
If you're bored, try slowing increasing the frequency into the optical input and see if there is a sudden jump in speed. It seems the PCM drops down to a 1000ppm input with a high number of VSS pulses. Just curious if it does it on the fly.
It seems to be pretty linear on the speed. I noticed no sudden jump in speed. Lowest it will register is 4 mph then drops out. I just rechecked with optical vs magnetic. Magnetic seems to be expecting 4kppm and the optical is expecting 2kppm. That is just flipping the flag and moving the input. It does need the slightest offset to make it cross zero for the magnetic sensor to register. Emulator is making it much easier to test. I didn't zoom in very close to see that last night that the signal was just crossing zero to a negative voltage when I was connected to the magnetic inputs.
If you're still bored, try a 10uf cap between your 0-5V signal and the magnetic input and a 100k resistor between the magnetic input and ground. See if that gives enough DC offset that it works.
Been looking for a dual flip flop IC in my parts bins. The second bin file that 1project posted seems to want 1kppm for the optical. The first bin seems to be 2kppm. I had noticed that earlier and decided to try and find the ic so I could do a divide by 4 on the signal generator output. If it works, I can post up a diagram and pics to show how to do it without modifying the code. It would just be a flag switch and go. The chips are less than a dollar. A few parts, and a perf board and the divider could be built with hardware pretty simply. We'll see how all this stuff plays out. I'll still test bins etc but I am going to work on a hardware solution.
Looks like a lot has happened since I left for work this morning. I got home around 12:30, had to eat then run some errands and I was finally able to get some testing done.
I started out with test bin #1 and run it. I figured it would be easier to record it then try to describe it. I had already run it a tiny bit before I started recording. I tried to vary the drill speed a bit for different speeds. I also went ahead and hooked up the jeep speedo I have so I could compare the datastream speed to what the jeep speedo reads I show both so you can see.
About halfway through I paused it, switched to the 2nd bin and then tried to run about the same test. I did notice the 2nd bin read much faster than the first.
https://www.youtube.com/watch?v=-Svl...ature=youtu.be
79 Jeep Cherokee, AMC 401, T-18 manual trans, hydroboost, 16197427 MPFI system---the toy
93 Jeep YJ Wrangler, 4.0L, 5 speed, 8.8 rear, homebrew hub conversion and big brakes, hydroboost, 2.5in OME lift, 31x10.50's---the daily driver
99 Jeep WJ Grand Cherokee limited, 4.0L, auto, 2wd, leather and power everything, 99% stock---the long distance highway ride.
The second bin file that 1project posted seems to want 1kppm for the optical. The first bin seems to be 2kppm.Just to keep track, are both of these comparisons against the the TEST1_ANHT file using optical sensor input on B21?I did notice the 2nd bin read much faster than the first.
Anyway, here's the latest file. The VSS road speed constant is set to approximately 8000 pulses but can be changed in your favorite cal editing program. lmk.
Bookmarks