How to make an over-current fuse/switch to avoid damage to a brushless motor

Discussion in 'OnBoard Electronics & Controls' started by BertKu, Aug 15, 2015.

  1. BertKu
    Joined: May 2009
    Posts: 2,521
    Likes: 47, Points: 58, Legacy Rep: 223
    Location: South Africa Little Brak River

    BertKu Senior Member

    Hi Porta and EK. I am back from Cape Town. I had 5 good reasons why you did not hear from me.
    1) My wife decided 2 weeks ago to start a spring cleaning and boy oh boy did I get involved.
    2) I blew all my PIC18F2431 with testing and run out of components
    3) I picked up a cold and did now feel like working for you both. Sorry, my apology.
    4) I am not impressed with the P MOS fets for high currents. If the PIC12F675 fails or during start up, or the connection to gate ,the P MOSfet opens up. I don't like that, thus for you EK,I have decided to fork out some dollars and buy a DC to DC converter and go back to the IRFP064N MOSfet. 115 Ampere, 55 Volt.
    5) I run out of blank pc boards
    I am now busy again to get everything going again.
    Bert
     
  2. BertKu
    Joined: May 2009
    Posts: 2,521
    Likes: 47, Points: 58, Legacy Rep: 223
    Location: South Africa Little Brak River

    BertKu Senior Member

    Good morning EK and Porta,
    You must be wondering what the hell is going on. Let me explain it. First at all, I make this overload protection for myself and after I blew 4 PIC18F2431, I had to go to Cape Town to stock up. With the knowledge gained from the up to 90 Ampere, I can help you with your applications. However I am happy with the result for myself, but have some major issues for you both.

    1) I have 1 millOhm as shunt. At 60 – 100 Ampere , I have 60 to 100 milliVolt over the 1 milliOhm. My motor can handle 6.3 Kw and with 90 Ampere for 10 minutes. Thus my philology is , that for currents up to 90 Ampere, I do not have an issue.

    2) However because I measure in 10 bit mode the current i.e. 0.460 Volt for the threshold voltage + 60 – 100 milliVolt for the over current, it does not matter for me, that after transferring the 10 bit to the 8 bit processor, that suddenly I have steps of 19.5 Ampere. i.e. either the cut off is at 60 or 80 or 100 Ampere when I have some fluctuations due to the high current. My normal usage is only 30 Ampere in anyway.

    3) In both of your case I have 40 milliOhm for you Porta at 2 Ampere gives me 80 millivolt, but now my problem. When the ADC collect this, it is in 4.8828 milliVolt steps. After transferring to 8 bit, suddenly I can only regulate it in 19.5 milliVolt steps and that is for you Porta 0.5 Ampere steps. With any fluctuations I am out by 1 Ampere. Whatever I have tried for tricks, I cannot get it better than 0.5 Ampere.

    4) For you EK, it means at 2,5 milliOhm, 30 Ampere max overload 75 milliVolt with either 19.5 higher or lower. i.e. 10 Ampere below or over the 30 Ampere you have set. At 5 milliOhm it becomes more acceptable i.e from 135 milliViolt to 170 milliVolt.

    5) What are the solutions. A) to go for a faster and 16 bit processor , which I don’t have. B) we accept the fluctuations, or i need more time to see whether I can overcome with all kind of other tricks to make it more accurate.

    6) I use the debugger and in line programmer with the ICD3 development program. Your PIC12F675, I have not been able to do that with the ICD3 , but only with PICstart plus development platform and that is very time consuming. I have to create the program, transfer this to the uP PIC12, then do the testing, try to figure out what I have done wrong, figure theoretical out what maybe the issue is and start all over again. With the ICD3 platform I can make the changes directly and straight away test it out. I am able to see what sits in the registers and what it should be, not with PICStart plus.


    Trust that you have understanding. I am very happy for the result for myself. It was worth to blow 4 processors. We need lots of time for your application, sorry for that. I am using now a DC to DC converter to enable to use the PIC12 with the robust IRFP064N N type MOSfet. The result is excellent, just the differentiation what is bothering me.

    Bert
     
  3. BertKu
    Joined: May 2009
    Posts: 2,521
    Likes: 47, Points: 58, Legacy Rep: 223
    Location: South Africa Little Brak River

    BertKu Senior Member

    Hi Porta, EK.

    The ADC read the value in a 10 bit mode. It get rid of the furthest 2 left digits and then it gets transferred to the 8 bit processor. Then I deduct or add a value to it, which sets either an overflow/borrow or not. The overflow/borrow bit dictates to stop the motor or not

    I am playing with the idea to multiply the result of the ADC by 4 and then add that with an 8 bit amount. which result in possible an outcome of steps of 4.8828 milliVolt at the end of the process.

    Alternative, divide the added 8 bit amount by 4 and shift and add that to the 8 bit result of the ADC.

    Is there any bright candle who could help me before I waste a lot of time?
    Bert
     
  4. BertKu
    Joined: May 2009
    Posts: 2,521
    Likes: 47, Points: 58, Legacy Rep: 223
    Location: South Africa Little Brak River

    BertKu Senior Member

    Let me express my thinking , what I have in mind for Thread 108.

    I see it this way.
    I have information transferred from an 10 bit to 8 bit and ignore the furthest left 2 digits. i.e. I measure sometimes 1,2,3,4,5,6,7,8,9 etc as a result. Because I am now adding an amount in 8 bit i.e. 0,4,8,12,16 to 1,2,3,4,5,6 and I will have 5,10,15,20 etc. While if I multiply it first by 4 >>> I get 4,8,12,16,20 etc. If I now add 4,8,12,16 etc (an amount expressed in 8 bit) does that not mean I am getting a 10 bit steps result effect at the end of the calculation? Anybody out there who could help me out?

    Bert
     
  5. BertKu
    Joined: May 2009
    Posts: 2,521
    Likes: 47, Points: 58, Legacy Rep: 223
    Location: South Africa Little Brak River

    BertKu Senior Member

    Hi Porta and EK,
    First you EK

    ....................over 5 milliOhm shunt @10 bit + 10 bit threshold step.. Total.......binary 10 bit
    .................................................................................( 453 milliVolt)
    26 Ampere = 130 mVolt = 26.62 steps......92.77 steps of 4.8828 mV... 119 steps > 01110111
    28 Ampere = 140 mVolt = 28.67 steps .....92.77 steps of 4.8828 mV... 121 steps > 01111001
    30 Ampere = 150 mVolt = 30.72 steps .....92.77 steps of 4.8828 mV... 123 steps > 01111011
    32 Ampere = 160 mVolt = 32.76 steps .....92.77 steps of 4.8828 mV... 125 steps > 01111101
    34 Ampere = 170 mVolt = 34.81 steps .....92.77 steps of 4.8828 mV... 127 steps > 01111111

    Conclusion: in 10 bit, steps of 1 Ampere can be achieved ( 1 step).

    Now the 10 bit loses 2 outer left bits i.e. in the shift to 8 bit, the result stays the same as in 10 bit.
    However to enable us to add or deduct in 8 bit , those steps are 4 fold higher. (1 step = 19.53 mVolt)
    i.e. to complement 119 steps to 256 steps (8 bit) , it can only be done in 19.53 mV steps. (8 bit)i.e we have to add 137 steps and then the overflow will be set and the program shuts down.
    i.e. Supply voltage = 5 Volt divided by 256 steps (8 bit) = 19.53 mVolt per step. Thus we multiply the result of the 26 Ampere by 4 = 476 steps, 484, 492, 500, 508 etc for 34 Ampere.

    We aiming for 30 Ampere, i.e. 492 steps ( 4 x 123) but then we go over the 8 bit, which can only handle 256 steps. Conclusion, lovely dream, but cannot be done.

    Conclusion: we multiply the ADC reading by 2 i.e. 30 Ampere becomes 246 steps and we have to add 10 steps to set the overflow bit, if the 30 ampere is exceeded.

    It means we can only then do it in steps of 2 Ampere. Thus the accuracy is then: the unit switches off anytime over the 28 Ampere or below 32 Ampere . ElectricKayak Accepted?

    Alternative we lower the threshold resistor from 470 Ohm to 220 Ohm and have only a threshold of 223 milliVolt. This means if we multiply the ADC result + threshold by x 3 , 30 Ampere = 30.72 steps (+ 223 mV) = 45.67 steps Total = 76.39 steps x 3 = 229.1 steps i.e. added by 27 Steps to get an overflow bit set.
    Conclusion: Now we have an accuracy of minus 1.33 Ampere from the 30 Ampere level to 31.33 Ampere. Should the current rise so fast that the rise time will be greater than the 18 – 20 uSeconds it will take to do an ADC cycle/loop , the current may be 40 Ampere before switching the unit off.
    Electric Kayak which one would you prefer? X 3 with a lower threshold resistor or 2 X with the 470 Ohm /4700 Ohm threshold divider.

    Now you Porta,

    Your shunt resistance is 40 milliOhm , the Blue light comes on by 21 Volt battery : 1.95 Ampere, stalling 3 Ampere and by 24 Volt: 2.3 Ampere the blue light and stalling current of 3.3 Ampere.

    You will be losing 80 milliwatt + 80 miliwatt in the N type IRFP064N MOSfet + 100 milliWatt in the DC to DC invertor Total 260 milliWatt i.e. your resistance with a other device was 2 watt at least. Accepted?

    I can only multiply it by 3 x by lowering the threshold resistor. I have emailed Microchip, what the minimum input voltage in millivolt can be for the PIC12F675 ADC converter.

    Which means as it stands now an accuracy of:
    1.95 Ampere = 78 milliVolt and 3 Ampere = 120 milliVolt at a drop to 21 Volt battery Voltage
    2.3 Ampere= 92 milliVolt and 3.3 Ampere = 132 milliVolt at 24 fully charged battery (remember we are having two independent software loops.

    By 3 x multiplying, ( I will try 4 x, but don’t know yet how to do it.) it means an accuracy of 6.51 milliVolt, which means +/- 0.3 Ampere both ways.

    Blue light from 1.8 to 2.1 Ampere and stalling from 3.15 Ampere to 3.45 Ampere for 21 Volt dropped battery. This for a fully charged 24 Volt battery .

    This is all theoretical, now I have to put it into practice. The result maybe even much better. Bear with me.

    Bert
     
  6. BertKu
    Joined: May 2009
    Posts: 2,521
    Likes: 47, Points: 58, Legacy Rep: 223
    Location: South Africa Little Brak River

    BertKu Senior Member

    Hi Porta and EK.
    Some good news. I received feed back and opinions differ. Some engineers says, that measuring very small signals from zero will better from a small threshold. Other state, we can do it from zero. I have decided to use a 100 Ohm instead of 470 Ohm and am now able to multiply it by 4. For EK, it means 1 Ampere both sides deviation and for you 100 mA deviation. i.e. 10 bit accuracy. You want hear from me, until the units are finished and ready for dispatch. Bert
     
  7. BertKu
    Joined: May 2009
    Posts: 2,521
    Likes: 47, Points: 58, Legacy Rep: 223
    Location: South Africa Little Brak River

    BertKu Senior Member

    Hi ElectricKayak, I am terrible sorry to give you this news, but whatever I have done, I cannot get the PIC12F675 properly working for your unit. I have spent all my spare time to make it work and now at the end, I have to get going for Porta, to finish his unit then first, before I carry on with your unit. I am embarrassed to do that to you, special now the summer is finished and your Canadian Winter starts. I have a problem with one pin to get it working as it should. In view I have no debugger for the PIC12, I have to make a change, program it in the chip and then test it in your pc board, not working? Back to another change; program again and then test it again in the pc board. I must have done this some 500+ times. Bear in mind I am using now 2 pins for your 20 MHz oscillator.

    I did find a silly fault of me, to make a mistake, by omitting ONE character o and that took me days and days to find the fault. I am using a PIC18F2431 for myself and am very pleased with the result. In my case I have a debugger and every step I can monitor and see what is wrong or the reason why something is not working. You could say, why don’t you then use the PIC18 also or me? I have ordered some from www.microchipdirect.com and expect them soon. That will be my last resort, in view that I have then to make a new pc board for the longer IC and also the casing. For Porta, I am using the internal oscillator and have 4 output pins available. Should one pin not work as I thought it would work, I just use another pin as output. Once again, my apology that I will now go further for Porta and have to let you down.
    Bert
     
  8. BertKu
    Joined: May 2009
    Posts: 2,521
    Likes: 47, Points: 58, Legacy Rep: 223
    Location: South Africa Little Brak River

    BertKu Senior Member

    Hi ElectricKayak, You must be thinking I am totally nuts, but I got your board working. It is now a matter of finding a way to test the window between current is "not cutting the motor out" and when "the motor is cutting out". If you want to know how I solved the problem? I swapped the two output pins and could make a conclusion in what to change, to make it working. I am doing that parallel to the work I am doing for Porta. By solving your problem, I am now able to progress faster with Porta's unit. Bert
     
  9. BertKu
    Joined: May 2009
    Posts: 2,521
    Likes: 47, Points: 58, Legacy Rep: 223
    Location: South Africa Little Brak River

    BertKu Senior Member

    Oh ElectricKyak, I forgot to mention. I could not accept that if the IC is removed or is going faulty, that the unit is not "Fail safe" I .e. like with the railways, a signal must go to red, if anywhere a problem crops up. I am happy that now all pins are performing well and if the IC is removed or go dead, the motor switches off. Bert
     
  10. ElectricKayak
    Joined: Mar 2015
    Posts: 78
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Canada

    ElectricKayak Junior Member

    Wow, thanks a lot Bert. I can't really imagine doing all that without a debugger. I agree it should be "fail safe", I create enough of my own problems as it is! And yes the weather is changing here, nice sunny days are becoming rare but greatly valued when they appear!
     
  11. BertKu
    Joined: May 2009
    Posts: 2,521
    Likes: 47, Points: 58, Legacy Rep: 223
    Location: South Africa Little Brak River

    BertKu Senior Member

    Hi EK,
    Yes, nothing more frustrating than NOT be able to look into the registers and see what is collected from the ADC into 10 bit and then what is transferred to 8 bit and why it can only be multiplied by 2 and not by 4, etc. It is a painstaking slow process. Attached the test rig I put together with globes/bulbs, if something goes wrong only the lights will go on or off, but no damage. At present I am only testing from 10 to 14 Ampere and cannot get a window of only 1 ampere, which I should be able to get. Also observe the 75 milliVolt over the 2 MOSfets at about 14 Ampere, when the blue light has come on, you can see it is at 12.65 Volt and it means consumption of 14 A x .075 V = 1.05 Watt. You will find that with Lithium batteries it will be more, in view that the voltage will be 4 x 3.35 Volt = 13.4 Volt. As soon I have figured out what is wrong with the window (If I make a short circuit, it perfectly opens the MOSfet) I will tests the system at various voltages i.e. from 12 to 14.5 Volt. Unfortunately not higher as the DC to DC converters will not tolerate this. You may have to wait for days, even weeks or even months before it is working perfectly.
    Bert
     

    Attached Files:

  12. ElectricKayak
    Joined: Mar 2015
    Posts: 78
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Canada

    ElectricKayak Junior Member

    What battery voltage range will this work with? I am currently using 12v Pb and 4s Lithium depending on situation.
     
  13. BertKu
    Joined: May 2009
    Posts: 2,521
    Likes: 47, Points: 58, Legacy Rep: 223
    Location: South Africa Little Brak River

    BertKu Senior Member

    Hi EK, Like I mentioned I will test the system for input Voltages from 12 to 14.5 Volt. A Fully charged Slab or liquid lead acid battery will not be more than 13.8 Volt., while a fully over charged Lithium battery could be 3.65 V per cell x 4 = 14.6 Volt. That violates the specs from the DC to DC specs. I will then place a diode in series with the DC - DC to ensure it stays in spec. No, what my concern is that you will insist on lets say 30 Ampere cut off, which will be fixed. Whether the battery drops to 11,5 Volt or is 14 Volt. But by 11,5 Volt you current by your motor drops due to the voltage drop and it means that maybe by stalling your current will no longer reach 30 Ampere, but 28 and then the unit does not switch off.

    But we are running ahead of maybe possible problems which we can only measure when we have the unit running 100%. I still have to find out what is actual transferred from ADC via the 10 bit to the 8 bit register and why I cannot multiply it by 4, but only by 2. Although theoretical it is possible. (thread 110). Don't worry we will find a solution when it is so far that we have test data. Bert
     
  14. BertKu
    Joined: May 2009
    Posts: 2,521
    Likes: 47, Points: 58, Legacy Rep: 223
    Location: South Africa Little Brak River

    BertKu Senior Member

    Do you want to know whether you could use it on 24 Volt? Yes it is possible, but then you have to place a switch and a 12 Volt zener diode in serial with the DC - DC invertor and replace the diode or just a link. which I will make provision for, so you can use the unit also for 24 Volt. But bear in mind, the doubling of voltage means a 4 fold in current. But let us not jump the gun. ( is that not an English expression? ) Bert

    P.S. If it comes to the push we have to give you a second IC for 24 Volt
     
    Last edited: Oct 13, 2015

  15. ElectricKayak
    Joined: Mar 2015
    Posts: 78
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Canada

    ElectricKayak Junior Member

    Your comments on testing at 12-14.5 volts etc made me think. What is the lower limit it will work? And upper?

    I had not realized it may be limited since i tend to think of battery voltages being quite nominal while actuals can vary greatly. Especially with all the different chemistries that exist these days... Nothing is really 12v or 24v these days!

    My lead acid ranges from about 10.5v up to 14 and actually higher since i usually charge with the system connected. Maybe goes to 15v.

    Also my 4s lithium (lipo) at full charge can be 4x4.2=16.8. Typically i use 16.4v. Cutout is around 14v.

    So i am now wondering how will all these voltages work in real life?
     
Loading...
Forum posts represent the experience, opinion, and view of individual users. Boat Design Net does not necessarily endorse nor share the view of each individual post.
When making potentially dangerous or financial decisions, always employ and consult appropriate professionals. Your circumstances or experience may be different.