Electric Noise PIC problem

Discussion in 'General Electronics Chat' started by Tobias, May 31, 2010.

  1. Tobias

    Thread Starter Active Member

    May 19, 2008
    158
    0
    Threeattachments, first is the schematic and the second is data from a logger box. The schematic is a simplified version. The data is sampled at 100hz, logger limited. The last attachment is a data sheet for an OPTO-MOS on the board

    I have a box that is triggered by wide open throttle. At wide open throttle a timer starts and turns on outputs based on user set times. I am having a problem, I think with the wide open throttle getting noise and making the PIC think it lost the wide open throttle signal and resetting the timers.


    The wide open throttle signal (16v) goes through a OPTO-MOS relay. The relay pulls down a pin on the PIC. The output when activated turns on another OPTO-MOS relay that turns on a P-Type mosfet. I have a DC/DC isolated power supply on the board and every input and output is optically isolated.

    There are four traces on the data.pdf. The green wire is the output of the OPTO-MOS connected to the wide open throttle . When the OPTO-MOS receives 16v, the green trace goes low. This activates the timing sequence. The first output is programmed to trigger at wide open throttle and the second output activates at 1.2 seconds. So the yellow trace is the output of the OPTO-MOS triggering the MOSFET. The red trace is the output of the first MOSFET. The blue trace is the output of the second MOSFET. You can see the blue line going high at 1.2 seconds.

    Keep in mind this data is being logged at only 100 hz. The data looks great until around 2.3 seconds. The red and blue trace go low. The red trace then goes high again and then flickers off twice before staying high. The entire time the 16v input is high. The last flicker is at 3.46 seconds and the second stage goes high at 4.66, right at the correct amount of delay from first stage activation.

    This system works great on a test bench. I do have an ignition system on my test bench to simulate the engine running. However with cylinder pressure from the engine, there is more noise in a race car.

    I know the PIC isn't resetting. There is about ten seconds after power up for the device to be ready to activate based on Wide Open Throttle.

    SOmehow the PIC is losing the Wide Open Throttle signal and restarting the timers.

    Any suggestions?
     
  2. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    I know that this is not your primary problem but it looks to me like the transistor that you are using to drive your LED indicator has its emitter and its collector reversed.

    hgmjr
     
  3. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Your schematic does not indicate what you are using as the clock source for the PIC.

    hgmjr
     
  4. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    and if you can post the source code, atleast the config part, to see if maybe your pic is being reset by the watch dog timer or something....


    B. Morse
     
  5. Tobias

    Thread Starter Active Member

    May 19, 2008
    158
    0
    Clock source is an external 20 Mz OSC.

    I don't think it can be a code problem, ie Watchdog etc. On the test bench it will do just what is it supposed to do time and time again. I have a hardware problem. As soon as this device is on the racecar and the engine starts, the problem surfaces.

    On startup there is about a ten second startup routine. If the PIC was resetting, no outputs would turn on until the startup routine is complete.
     
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You have too much of a load on I/O pin 35.

    After you swap the collector and emitter on T2b, increase R1 to 2.2k.
    Increase R12 to 1.8k. This should give about 2mS current through the emitter side of the OPTOMOS relay.

    What is MS2? Part number, please.

    I don't know why you are driving the gate of a MOSFET using an optomos relay.
     
  7. Tobias

    Thread Starter Active Member

    May 19, 2008
    158
    0
    MS2 is a SUM110P04-05. Data sheet attached. Keep in mind this board works just fine on a test bench. The test bench has a 12v supply though, the race car is a 16v supply and of course electric noise. The board will fire the MOSFETS just fine on the race car until the engine starts.

    The collector and emitter is correct on the PCB, I drew it incorrectly for the example schematic. I will change the resistors on the PCB.
     
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    The SUM110P04-05 only has a Vdss rating of 40v. You may see voltage spikes exceeding 60v on the electrical system due to load dumps, etc.

    The limit for Vgs is +/-20v. You have no protection against voltage spikes. One spike on the electrical system will destroy the MOSFET.

    What is the load that your MOSFET is driving?
     
  9. Tobias

    Thread Starter Active Member

    May 19, 2008
    158
    0
    I have kickback diodes but they aren't on the board. The board is driving solenoids that control a nitrous system. There are two solenoids per stage. The total amperage draw from the two solenoids are 16v is 42amps.
     
  10. Tobias

    Thread Starter Active Member

    May 19, 2008
    158
    0
    The input channel I am using on the PIC is a Schmitt Trigger. I am still learning the logic level types but I would think this would be good yea?

    What would be a bulletproof/noise proof way of taking the 16v input and pulling the PIC pin low?
     
  11. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    OK, I'm looking at your WOT side now.

    What kind of switch are you using to sense WOT?

    I see you have R22 and R23 over to the left, both 220 Ohms.

    I don't see what purpose R22 serves other than to generate heat and add more load to the switch? 16v over 220 Ohms will mean 72.7mA current through R22, and 1.164 Watts of power dissipation. Maybe you needed a heater? I don't know.

    R23 is again, much too low in value if your WOT signal is in fact 16v. It should be about 7.2k Ohms, if WOT is a rock-steady 16v. However, if you have power spikes, your OptoMOS relay will get the emitter side fried.

    The relay will pull pin 1 low, but there is nothing acting as a pull-up. Do you have the internal weak pull-up enabled for pin 1? You'd probably be better off to use an external 10k resistor.
     
  12. Tobias

    Thread Starter Active Member

    May 19, 2008
    158
    0
    I think I have it. It is the WOT side. I screwed myself by not using a 16v input!!! Thanks
     
  13. Tobias

    Thread Starter Active Member

    May 19, 2008
    158
    0
    What would you use to pull the P channel MOSFET low? I don't need anything with a high frequency.
     
  14. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You can use your OPTIMOS relay. However, you should have a 1W 10v Zener from the source to the gate so that the gate can't go more than about 1v higher than the source terminal, or more than about 10v lower than the source terminal.

    Then use either a constant 20mA current sink between the gate and the OPTOMOS relay, or a low-wattage 300 Ohm resistor. That way if there is a voltage spike, hopefully the low-wattage resistor will fry before the 10v Zener.

    It would've been easier if you'd used an N-ch logic-level MOSFET to sink current from the solenoids than trying to fiddle with the P-channel MOSFET.
     
Loading...