X64v Posted February 9, 2009 Share Posted February 9, 2009 Today I wired in my crank trigger set-up, using this sensor and these magnets. I'm using a VB921 to drive a single coil, and the 024s9 decoder wheel setting to read the 6-1 magnet setup in the crank pully. I'm powering the sensor off s12 from megasquirt. The 'signal' pin is connected to pin 24 (grounds when magnet passes by, is open otherwise), and the sensor ground pin is connected to pin 2 via the shielding wire in my DIYautotune harness. In my MS1 v3.0 box I have TSEL wired to OPTOOUT, a 1k resistor between s12 and OPTOIN, and XG1 wired to TACHSELECT. As far as I can remember, I have C30 and C12 removed, and D1 and D2 jumpered. It runs fine at idle most of the time, and will rev with no load without much problem. But while driving I get tach spikes all over the place, which causes the car to buck and kick. I originally had the sensor powered from the coil positive, but it wouldn't even idle correctly then. Powering it from s12 fixed that. I wouldn't think it could be interference, since it's a 12v square wave. I'll post a datalog tomorrow. Any ideas why I would be getting such bad tach spikes under load? EDIT: I actually had this set up working a few weeks ago with almost zero tach spikes (maybe one per two minutes). The only difference between then and now is that I had OPTOIN connected directly to a 5v source, instead of through a 1k resistor to a 12v source. These two set-ups give almost exactly the same voltage across the opto-isolator when the sensor grounds the signal pin. I switched it only because the manual at msextra.com says to do it the way I have it set up now. EDIT 2: I switched OPTOIN to a direct 5v source like I talked about in edit 1, and now it seems to be working fine. I guess the question now is why? Quote Link to comment Share on other sites More sharing options...
Xander Posted February 9, 2009 Share Posted February 9, 2009 It is strongly recommended that an externalbypass capacitor be connected (in close proximity to the Hall sensor) between the supply and ground of the device to reduce both external noise and noise generated by the chopper-stabilization technique. This is form the Hal switch manual. I have pretty much the same setup and it works flawlessly. Why did you go for a 6-1 setup just three magnets should be enough. Quote Link to comment Share on other sites More sharing options...
X64v Posted February 9, 2009 Author Share Posted February 9, 2009 Ohh, gotcha, I never saw that. I got pretty much all my info from your thread on this a few months back. You used the 5v source to power the opto-isolator; did you install that capacitor as your quote says? I did a 6-1 setup because I want to go distributorless with MS running a wasted spark coilpack setup (but didn't want all the Ford EDIS stuff when MS can do it itself). I'm running the single coil now just until I get the crank trigger sorted out. Quote Link to comment Share on other sites More sharing options...
z-ya Posted February 9, 2009 Share Posted February 9, 2009 Yea, it looks like the datasheet recommends an external 0.1uF bypass capacitor: http://www.allegromicro.com/en/Products/Part_Numbers/3240/3240.pdf Do you have the A3240LUA-T output pulled up? You should put a 1k pullup resistor between pin 24 of the DB37 and S12. This will make pin 24 got to 12V when the A3240LUA-T output is off. If you just let it float, it will be very sensitive to noise, and it could be floating around the threshold of the opto in circuit. Quote Link to comment Share on other sites More sharing options...
X64v Posted February 9, 2009 Author Share Posted February 9, 2009 Will it be okay to put the capacitor about 3 feet back in the wiring? I could put it right on the sensor, but it would be a major PITA and require quite a bit of disassembly. No, I don't have a pull-up resistor there, I didn't see the point. When the sensor is off (no ground), there is no connection for any current to pass through the opto-isolator, so how could it cause it to light (i.e. where are the electrons going?)? I'm not saying one isn't needed, I just don't understand how it would do any good. Edit: I forgot to add that the way it's set up now is much better than the 12v source, but still will give me a spike every minute or two, so it's not fixed yet. Quote Link to comment Share on other sites More sharing options...
z-ya Posted February 9, 2009 Share Posted February 9, 2009 A bypass capacitor should be placed as close to the device as possible. Three feet away from the device will not do much. You need a pullup because an input (input to the opto circuit) will float to some nominal voltage. What is this voltage? What is the input threshold on the opto circuit? The goal of the pullup is to "pull" the input to a "known" voltage. You don't want input circuit floating at some unknown voltage. Noise can easily couple into floating inputs. This is what most likely causing your problem. The resistor is to limit current (the hall sensor has current limiting, but a resistor is a good idea to protect the device). A 1K Ohm will limit current through the hall sensor to ~12mA. The hall device can source 25mA before going into current limit mode. Quote Link to comment Share on other sites More sharing options...
X64v Posted February 9, 2009 Author Share Posted February 9, 2009 Alright, I'll switch OPTOIN back to s12 via the 1k ohm resistor, and add a 1k ohm pull-up resistor between s12 and TACHSELECT. I'll report back in a few minutes with the results. Quote Link to comment Share on other sites More sharing options...
Xander Posted February 9, 2009 Share Posted February 9, 2009 Z-ya. Your explanation of the pullup resistor is correct for a input like the ones on the processor. But the opto isolator is fired by grounding the negative side of the led inside. I doesn't matter if the voltage floats on the negative side. It should never be able to fire the led. The positive side of the led is connected to a regulated 5 volts from inside the megasquirt unit. I am not running a pullup and it is running fine. If you have connected the opto-in directly to a 5v source and you are not limiting the current with a resistor you might overload the opto. The input on the opto is can only handle 150mW. http://media.digikey.com/pdf/Data%20Sheets/Lite-On%20PDFs/4N25(26)(27)(28).pdf Oh and I am not using the capacitor. edit: I just checked the schematic and R12 is the current limiting resistor for the opto isolator. It should still be in place. Quote Link to comment Share on other sites More sharing options...
z-ya Posted February 9, 2009 Share Posted February 9, 2009 There still is an input threshold voltage at which the internal LED will turn on in the opto isolator. It looks like its somewhere between 1.2 1nd 1.5 volts. Quote Link to comment Share on other sites More sharing options...
X64v Posted February 9, 2009 Author Share Posted February 9, 2009 Those were my thoughts on the pull-up resistor, but since it was quick and easy I tried it anyways. No go, it acts exactly like it did in my original post. As to the overpower thing, I hook OPTOIN directly to 5v, but there's still a 390ohm resistor in that circuit (see here), plus the resistance of the opto-isolator's LED (120ohms) and the resistance in the hall sensor (30ohms). They're all in series so added up they equal 540ohms, which is 9mA at 5v, equalling 45mW. When it's set up like that, it's the exact same wiring inside the box as you have Xander, as far as I know. (Just re-read your post above; yes, R12 is in place) Edit: z-ya, the anode of the internal LED gets 12v (or 5v) when there's no current, but if there's no ground connection, how can it light? Any interference coming through the external wiring will be on the cathode side, so it could be 100v and nothing would happen. Quote Link to comment Share on other sites More sharing options...
X64v Posted February 9, 2009 Author Share Posted February 9, 2009 Xander - Looking at your picture below, I can see you have C30 removed, C12 in place, a zener diode in the reverse direction in D2, and I can't make out what's in D1. Is this how it worked, or did you just take that picture before removing those components? I have C30 and C12 removed, and D1 and D2 jumpered. Quote Link to comment Share on other sites More sharing options...
z-ya Posted February 10, 2009 Share Posted February 10, 2009 Those were my thoughts on the pull-up resistor, but since it was quick and easy I tried it anyways. No go, it acts exactly like it did in my original post. As to the overpower thing, I hook OPTOIN directly to 5v, but there's still a 390ohm resistor in that circuit (see here), plus the resistance of the opto-isolator's LED (120ohms) and the resistance in the hall sensor (30ohms). They're all in series so added up they equal 540ohms, which is 9mA at 5v, equalling 45mW. When it's set up like that, it's the exact same wiring inside the box as you have Xander, as far as I know. (Just re-read your post above; yes, R12 is in place) Edit: z-ya, the anode of the internal LED gets 12v (or 5v) when there's no current, but if there's no ground connection, how can it light? Any interference coming through the external wiring will be on the cathode side, so it could be 100v and nothing would happen. Are you asking me? Do you have XG1 and XG2 connected? If so, that is where the ground reference is coming from. If not, they should be connected. Yes, you should remove C30 and C12 as these are for connection directly to a coil. Depending on what the waveform looks like at OPTOIN, you can shunt D1 and D2 as well as these are adding another 1.4V of drop before the input of the opto isolator. Do you have a scope? Pete Quote Link to comment Share on other sites More sharing options...
X64v Posted February 10, 2009 Author Share Posted February 10, 2009 No, XG1 and XG2 cannot be connected. XG2 is a straight ground for when the trigger input powers the positive side of the opto-isolator. In my case with this sensor, the positive side of the opto-isolator is connected to constant power (5v to OPTOIN), and the sensor grounds the negative side (connected to XG1). If XG1 were connected to XG2, the opto-isolator would stay lit constantly, and the hall sensor would not be in the circuit at all. I wish I had an o-scope, but I do not. Quote Link to comment Share on other sites More sharing options...
z-ya Posted February 10, 2009 Share Posted February 10, 2009 So you are running the sensor ground back to XG1? Where is the sensor getting a ground reference to the 5V power? You must provide a ground reference to 5V for the sensor to operate correctly. This is a much better way to use that sensor with the MS 3.0 mainboard (see first attachment). Now if that isn't enough to convince you, look at attachement 2 from the Allegro application note: http://www.allegromicro.com/en/Products/Design/an/an27701.pdf Quote Link to comment Share on other sites More sharing options...
X64v Posted February 10, 2009 Author Share Posted February 10, 2009 Pin 2 of the sensor is grounded to pin 2 on the megasquirt box. The output pin (pin 3 on the sensor) is connected to XG1. Megasquirt would not read the 6-1 pattern correctly if it was wired up as per your diagram. Megasquirt needs the opto-isolator to light when there is a magnet in front of the sensor, and be off otherwise. The sensor grounds pin 3 when there is a magnet present, so in your diagram the opto-isolator would be lit except when there was a magnet there, which is backwards. To the best of my knowledge, Megasquirt will not read it that way (at least not with a 6-1 configuration). Edit: See attachment for my current mostly-working set-up. Quote Link to comment Share on other sites More sharing options...
z-ya Posted February 10, 2009 Share Posted February 10, 2009 OK, now I understand how you have things wired up. R12 is your "pullup" resistor BTW. The way you have it connected should work. My circuit will also work because the interrupt (IRQ) pin on the processor where the output of the opto isolator goes is configured to be "edge" triggered, not "level" triggered. So either circuit will work. Sorry I can't be much more help than than that without putting a scope probe on it. Pete Quote Link to comment Share on other sites More sharing options...
X64v Posted February 10, 2009 Author Share Posted February 10, 2009 Well thanks for the lively discussion anyways. If I can manage to get my hands on a scope I will. Xander, is yours set up any differently than mine that might be the fix? Quote Link to comment Share on other sites More sharing options...
Xander Posted February 10, 2009 Share Posted February 10, 2009 not really. It's just that I am now using the version 2.2 board now. I am using three magnets in the front balancer. It's been a while since I installed everything and I am not able to check my setup any time soon. sorry Quote Link to comment Share on other sites More sharing options...
X64v Posted February 10, 2009 Author Share Posted February 10, 2009 Alright, thanks. I guess my next move is installing that capacitor the data sheet calls for. I won't have a chance to get to that before it goes to the body shop though. How about shielding? I know Xander used a nice shielded cable for his. I'm using shielded cable as well, but I'm using the outer shielding braid as the ground for the sensor (which, from what I understand, negates the shielding effect). Quote Link to comment Share on other sites More sharing options...
z-ya Posted February 10, 2009 Share Posted February 10, 2009 You can use the sensor ground for the braided outer shield. Find some cable with two inner conductors, and use one for power, the other for the signal. Put the capacitor at the sensor between power and ground. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.