Author Topic: How can i protect my circuit from clueless plebs  (Read 4999 times)

0 Members and 1 Guest are viewing this topic.

Offline iwtommoTopic starter

  • Contributor
  • Posts: 22
  • Country: gb
Re: How can i protect my circuit from clueless plebs
« Reply #25 on: January 06, 2018, 07:23:06 pm »
Ha, funny you ask.

When i am hacking together electronics projects in the garage my usual plan of attack is to separate the project into modules and then buy each module on ebay. For example, the last project was a wireless 3 phase hydraulic pump for a man sized bottle jack - Sourced all the bits from work, buy the 3 phase inverter, the 24vac power supply module, lowering valve, the 2channel car fob wireless relay module, the contactor, and then buy a few enclosures and wire everything together. Minimal 'design' work required, and doable cheaply using cheap 'industrial lego' boards mentality.

This project initially came about trying to drive a Mahle 03F145725G wastegate actuator to replace the boost control solenoid on my Mazda Mx5, using my microsquirt ecu. (i appreciate this will mean more to some than others!) Ive got a 0-12v configuarable output to play with, and a 5 wire box of tricks to connect it to (2 wire brushed motor, 3 wire hall sensor). Looking on ebay, nothing. "Well, ill build one then!"

Then a few friends have announced their interest in this little box of tricks, (for various other uses)... "Well sod it ill build a handful of them then"

Everyone's recommendations have been really helpful, thank you. Ive attached a picture of what i think is a finished schematic. Well, it is finished, for now, as i've put an order in for 3 at oshpark so its as finished as it gets for now until i manage to break them all in prototyping/testing/ect.

F1 is a 5a (? 7.5a?) micro blade fuse. This is obviously for overcurrent protection, and will also blow in reverse polarity situation thanks to the freewheel diodes in the TLE5206. Both the setpoint and feedback inputs have resistors and zeners as an overvoltage/overcurrent protection and the capacitor is there to act as a snubber/low pass filter (values to be tuned as reqd)

I think this means that any wiring combination error on P1 is protected for, and the samecan be said for P2 thanks to the setpoint filtering circuitry, the generous output protection of the motor driver, and using D1 and R5 to keep voltages higher than 5v of the 5v rail. Overcurrent on 5v is handled thanks to the vreg and this also has undervoltage lockout should p1 v fall too low.

I'll be honest, and it has probably become apparent by now, but maths is not my strong point so little actual engineering has gone into this but i think (barring any other blatant oversights) this is good enough to start testing. Should i need/decide to swap the zeners for TVS's i shall and as above i suspect exact component values will need tuning, but i will probably get there with experimentation (not that this means i am deaf to further/past advice, my ears are always open!)I also had a pin left to use on the mcu so wired that to an error LED - Not certain yet on strategies to use this but im sure something will happen. Oh, and i think ill leave the icsp pads unpopulated on the finished ones of these things i sell. You never know  ;D

I believe that, short of connecting this thing up to AC mains or an ign HT lead, i think what i have in there so far is 'enough'.

Now would probably be a good time to learn how to code.

EDIT: Attach the friggin picture
« Last Edit: January 06, 2018, 07:59:24 pm by iwtommo »
 

Offline max_torque

  • Super Contributor
  • ***
  • Posts: 1305
  • Country: gb
    • bitdynamics
Re: How can i protect my circuit from clueless plebs
« Reply #26 on: January 06, 2018, 10:15:00 pm »
A few things to add for the next respin of the pcb  :-DD

1) Load dump protection   (ie http://www.vishay.com/docs/88387/sm8s.pdf )
2) Small low ESR capacitance for the power feed to the H bridge
3) Some common mode and differential input filtering to prevent conducted EMC issues propogating upstream from the driver into the rest of the vehicle
4) Some series resistance between your input clamping zeners and the micro (as it is, the internal diodes will almost certainly conduct before your external one, defeating the point of having it.  I use a split R scheme, ie seriesR -> zener clamp (or diode to vcc and gnd, a BAT54S is handy here) then another seriesR.  Depending on the bandwidth requirement of the input, you can run a large total resistance to provide a  large over voltage protection.  (of course, any analogue input should have a suitable hardware AAF inline anyway, and you can use the C of a RC filter to provide suitable charge for the ADC's sample and hold capacitor to prevent that high input impedance from skewing the results.
5) Be careful when programming or when you have the programmer attached to the ISP, as you share these with the PWM output, hence programmer will also drive the H bridge!
6) It's generally good practice to use high value resistors to pull signal and data lines to known states during programming/brownout etc.
7) you'll have to disable the RESET pin, as your ErrorFlag pulls low   :palm:
« Last Edit: January 06, 2018, 10:22:10 pm by max_torque »
 

Online wraper

  • Supporter
  • ****
  • Posts: 17064
  • Country: lv
Re: How can i protect my circuit from clueless plebs
« Reply #27 on: January 07, 2018, 02:46:48 am »
A few things to add for the next respin of the pcb  :-DD

1) Load dump protection   (ie http://www.vishay.com/docs/88387/sm8s.pdf )
Nice way instantly making the circuit financially non viable. If you sell some industrial stuff for a lot of money, then sure, but otherwise...
EDIT, Placing cheap TVS like P6KExx on power is more than enough.
« Last Edit: January 07, 2018, 03:44:25 am by wraper »
 

Online wraper

  • Supporter
  • ****
  • Posts: 17064
  • Country: lv
Re: How can i protect my circuit from clueless plebs
« Reply #28 on: January 07, 2018, 02:51:41 am »
4) Some series resistance between your input clamping zeners and the micro (as it is, the internal diodes will almost certainly conduct before your external one, defeating the point of having it.  I use a split R scheme, ie seriesR -> zener clamp (or diode to vcc and gnd, a BAT54S is handy here) then another seriesR.  Depending on the bandwidth requirement of the input, you can run a large total resistance to provide a  large over voltage protection.  (of course, any analogue input should have a suitable hardware AAF inline anyway, and you can use the C of a RC filter to provide suitable charge for the ADC's sample and hold capacitor to prevent that high input impedance from skewing the results.
How to make vastly inferior protection compared to specialized ESD protection devices and not save any money.
 

Online HwAoRrDk

  • Super Contributor
  • ***
  • Posts: 1527
  • Country: gb
Re: How can i protect my circuit from clueless plebs
« Reply #29 on: January 07, 2018, 05:28:22 am »
In addition to what max_torque said about the series resistance on the feedback and setpoint inputs, I would change those 2.2K resistors to something like 4.7K or 10K. If those inputs ever get 24V+ and assuming you are using common 1/4W resistors, with 2.2K they will be dissipating more than their rating and may burn up if the situation is prolonged.
 

Offline max_torque

  • Super Contributor
  • ***
  • Posts: 1305
  • Country: gb
    • bitdynamics
Re: How can i protect my circuit from clueless plebs
« Reply #30 on: January 07, 2018, 01:08:19 pm »
A few things to add for the next respin of the pcb  :-DD

1) Load dump protection   (ie http://www.vishay.com/docs/88387/sm8s.pdf )
Nice way instantly making the circuit financially non viable. If you sell some industrial stuff for a lot of money, then sure, but otherwise...
EDIT, Placing cheap TVS like P6KExx on power is more than enough.

er, no one said anything about cost!  The title of the thread was "how do i protect my circuit from clueless plebs" not "how do i optimise the cost to robustness characteristic for my product"..

that ^^ TVS diode is basically industry std in the automotive industry. Open up pretty much any OEM control unit and you'll find one lurking in there (and that's because it's qualified to meet the full  ISO 7637-2 and SAE J1113-11 standards for load dump on 12 and 24v (nom) systems. Your dinky little 600w device is going to get vapourised unless you can protect it with some upstream impedance, which for a device that needs significant power (several amps of more) becomes difficult)

So, given that OEMs don't like spending money, and want to get every single cent of cost out of their products, do you think they are fitting that "expensive" TVS diode for fun??


« Last Edit: January 07, 2018, 01:22:23 pm by max_torque »
 

Offline max_torque

  • Super Contributor
  • ***
  • Posts: 1305
  • Country: gb
    • bitdynamics
Re: How can i protect my circuit from clueless plebs
« Reply #31 on: January 07, 2018, 01:09:52 pm »
4) Some series resistance between your input clamping zeners and the micro (as it is, the internal diodes will almost certainly conduct before your external one, defeating the point of having it.  I use a split R scheme, ie seriesR -> zener clamp (or diode to vcc and gnd, a BAT54S is handy here) then another seriesR.  Depending on the bandwidth requirement of the input, you can run a large total resistance to provide a  large over voltage protection.  (of course, any analogue input should have a suitable hardware AAF inline anyway, and you can use the C of a RC filter to provide suitable charge for the ADC's sample and hold capacitor to prevent that high input impedance from skewing the results.
How to make vastly inferior protection compared to specialized ESD protection devices and not save any money.

explain your statement please?
 

Offline max_torque

  • Super Contributor
  • ***
  • Posts: 1305
  • Country: gb
    • bitdynamics
Re: How can i protect my circuit from clueless plebs
« Reply #32 on: January 07, 2018, 01:17:51 pm »
For "slow" AVR type inputs (analogue and slow digital ones) i regularly use a 4k7 either side of a diode clamp, for a total of nearly 10k total input resistance to the micro pin.  Use a suitable capacitor downstream of the resistance to not only provide the necessary AAF, but also to provide de-bouncing / HF noise rejection and a suitable charge source for the ADC's SaH cap etc

10k allows for continuous accidental connection to 24v (nominal, up to 32v continous) systems, and in my testing also provides several hundred volts of transient protection (ESD / Load dump etc)
 
The following users thanked this post: Siwastaja


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf