Chip Reset/Hang

Go To Last Post
40 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a circuit board with an ATMEGA 16 running 2 L298 motor controllers. Everything works fine, but when I stall the motors (stalls at about 2.2A) the chip somtimes hangs or resets. If it hangs it seems to freeze in some random state, setting or reseting varoius i/os. The only way to restore the board is unplug and plug back in the 19V power supply.

I have the reset pin on the chip connected to the 5V feed through a 10K resistor. I also have a 100V 470uf cap on the board to help reduce noise.

Thanks in advance for the help.

JL

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you have filter caps on the VCC-pins? It is also normal to have a cap on the reset line.

More information on how things is connected would be helpful, schematic, pcb and such.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a 0.1 on the VCC lines, and nothing on the reset line. I did try putting a 120 uf and a 330 uf right at the reset resistor which is about 25mm from the chip and this did nothing.

What sort of cap and placement did you have in mind for the reset line?

I attachted is the schematic and board layout.

Thanks,
JL

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wow, tight routing on that board!

From appnote AVR042 the advice is a cap between reset and gnd, could not find a size but i guess 0.1uF would do.

Thinking more about it, it could help using a brownout and put the MCU to sleep if voltage falls.

It is kind of hard debugging this, do you have a oscilloscope at hand? If so, check the regulator output, VCC-pins, and battery voltage when the engine is stalled. Also, make sure there is good filtering on the motors themselfs, diodes and caps.

I guess you have checked this, but to be sure, is the batteries rated for those currents?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I see some pretty heavy traces. That suggests high currents in places. Have you checked how things behave during power-up?

For example, initially, during reset, I/O pins are inputs. That means that their output state is undefined. If you need a particular pin (say, to control a relay or motor controller) to be in a specific state to hold it off during reset, YOU need to add a pull-up or pull-down resistor to insure that the pin is in the logic state you need.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And the stall suggests there is only a high constant current involved (no switching).

I suggest you should check MCUCSR first.

No RSTDISBL, no fun!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, I switched the reset pull-up resistor to 4.7K, no change. I added a 0.1uf cap to the reset line, no change.

I don't have a scope at hand which make this a little difficult to diagnose.

The batteries are rated for 5A, so no problem there. Did you think it could be the batteries? They are 19V which is well over the 5V regulator.

The most current going through those traces would be about 3A.

During start-up things behave normally. Nothing is turning on when it shouldn't. It is only when I stall the motor does it hang/freeze in an unknown state or just reset.

How do I check the MCUCSR?

Thanks,
JL

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jlotz wrote:
How do I check the MCUCSR?

With a debugger for example. But first use "Search" button for MCUCSR (or MCUSR on newer models).

No RSTDISBL, no fun!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Motor stall means VERY high current. Maybe 5x running current. You will certainly exceed the 5A battery rating and your power supply input voltage will drop and the processor may brown out, and it may "hang" in that condition.

Either do not stall the motor or build in more current capability or measure the motor current (in your circuit) and cut it back (with PWM) when it over-loads. Some motor driver ICs have current sense capability.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Motor is 6.6 ohm across the leads. This means that the stall is about 3A. The application is an ROV so there is no way to stop stuff from binding in the propellers.

I stalled the motors and measure the voltage in the battery droping from 19.6V to 19.3V.

It is programmed now to stop sending the PWM to the L982s after about 1 second of the motor drawing more then 2.2A. I could program it so that it stalls earlier, but at a 3A stall for 1 second, all components should be ok I would think.

JL

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For a quick test cut all the GND traces at mcu, and connect with reasonably thick wire directly to battery negative terminal on the PCB.
Looks like all the mcu grounding is in series with high current ground ant it's not good. Sorry can not follow exact digital ground patch on PCB, so just a guess.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Does that "fix" the reset?

JIm

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No luck. Cut the ground and jump back to battery. I should note that the board layout was doing this already. The ground trace to the ICs was direct to the battery terminal. The ground for the motors is on a separate trace.

The odd thing about this is it is a 2nd board I have soldered. The first board which is the same I made a few months ago never did this at all. Could one of the components be damaged on this new board? A cap, or the MCU?

JL

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just a suggestion from left field ... I would insert a diode feeding the Vcc to the mega32 so that if there is a sudden dip in the supply rail due to the stall event, the caps on the mega32 will hold the rail up.

Cheers,

Ross

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hmm, not that easy to do given the board layout. Could I insert a schotty right after the 5v reg? That means all chips would get about 4.7V I guess.

JL

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What I am suggesting is to isolate the "program running" power supply side from the "motor grunt" power supply. If your suggested place achieves that ... OK. It is just another example of the "divide and conquer" approach to investigation.

Cheers,

Ross

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Fixed I think, but unsure of why.

Looking back through my notes I noticed that I changed C1, which is the cap on the output line of the 5volt reg from 0.22 uf 50V (EEE-HB1HR22AR) to 33 uf 35V (EEE-FP1V330AP). Basically on my prototype I misread the data sheet for the reg and thought it said use a 0.22 uf cap here....later I found my mistake and switched to EEE-FP1V330AP for the first production board...the one giving me problems. So it works now, but my concern is I am using a cap that is smaller then called for on the datasheet....and my question to you is why did the 33 uf cap do this to the board? I always thought bigger is safer for somthing like this.

Data sheet page 13 says:
"The minimum output capacitance required to maintain stability is 22 μF (this value may be increased without limit). Larger values of output capacitance will give improved transient response."

http://www.national.com/ds/LM/LM...

Do I risk problems by using the 0.22?

Thanks,
JL

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe the ESR of the bigger capacitor is not within the region specified by the datasheet? See page 10, Capacitor ESR.

If the datasheet specifies 22uF as a minimum, you should use it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This one really has me. Built a few circuit boards with this .22 cap, and now found another that does same thing....with .22 cap, and with the original 22 tant cap. This time I even tried putting in an old LM7805C through hole on and same thing. For this I tried a ) no caps on either side and b) a 330 uf cap on the 5vdc side. How can I have such a large cap on the 5VDC side and still have this problem?

Thanks,
JL

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So, how much is your maximum current draw (worst-case scenario) and how much can your regulator(s) supply? Checking your power supply rail (regulator's output) with a scope should reveal the problem I think, can you try to find one? Maybe even a multimeter could reveal the temporary drop, if it's fast enough. And if the reg manufacturer suggests 22uF then it is for a reason. IMHO, you should try and make it work with that and not .22uF.

-Pantelis

Professor of Applied Murphology, University of W.T.F.Justhappened.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you have noise suppression caps across your motor leads? We use to place 3 right on the motor itself, 1 across the 2 leads, and 1 from each lead to the motor casing. I'm thinking we used .1uf.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I don't have a scope at hand which make this a little difficult to diagnose.

"Little difficult"? Yeah, like trying to replace the head gasket on your car engine with only a pair of pliers & a screwdriver.

I am constantly amazed that seemingly sensible men design and build complex systems like this one and have not even a DVM or clip leads to evaluate and debug the prototypes or production units. Duh.

Famous Roman Expression:
(translated to English)

"Beware of carpenters without hammers."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I tried the cap trick on the motors a while back and it did nothing. This carpenter just ordered a hammer, so I will post the results once it arrives and I learn how to use it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jlotz,

If you take the time to learn the fundamentals of O-scope operation and use, you'll be able to make meaningful readings and get some good clues to help solve your problem in a few hours.

As to your resetting problem.....

The type of design you have here I call a "mixed power" design. Meaning, you have a low-voltage, low-current control and (possibly) instrumentation section, and a high-voltage, high-current, noisy "power" section. Motor controllers, solenoid controllers, electronic ignition systems, automotive accessories, and the like, fall into my "mixed power" category.

The main design challenge in a Mixed Power design is to keep the high-power disruptions out of the control & instrumentation section. My basic approach in pretty much all of these mixed power designs is to provide autonomous power for the micro. Simply speaking, a separate Vcc regulator with its own dedicated input voltage holding capacitor (I call it the "reservoir cap"). This input cap is fed by a diode from the main input supply so it will not lose charge when the input supply voltage is inevitably drawn down, or otherwise crapped-up, by the antics of the high-power section (coil kickbacks, motor-stalls, and the like) or the power supply itself (as in automotive apps).

The Reservoir Cap needs to be sized to hold up the regulator & micro, and possibly, other components of the instrumentation & control section, for a time period which is appropriate for the project. In general, I start with around 500 mSec, and tailor accordingly as I get more expereince with the specific system and learn its various worst-case and special-case scenarios and gothcas.

The overall "theme" of this approach is to make sure the micro is always "in control" regardless of what is happening to the power supply and power section. And that the micro is capable, though hardware facilities and software processes, of keeping the power-section "out of trouble" (too big a topic to discuss here).

So, while you are waiting for the "hammer" to arrive, you may want to try adding a diode, reservoir cap and dedicated micro regulator to see it it helps your situation. A reasonable debugging alternative is to use a separate lab supply for the micro Vcc.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That all makes perfect sense, so for a very fast trial I added a diode into my existing 5vreg (Vin) and a 220 uf electrolytic between the diode and the reg and the caps (-) to system ground. No change. Amperage draw on this 5vdc reg for all 5v ICs was about 90ma.

Should I redo with a reg on the micro only as you say, or is this not the same thing?

If the lab test, is it ok to hook the micro up to a 5v battery and the rest of the circuit up to the 19V battery? I assume I need to connect the grounds?

Thanks for the help. Hammer still in mail.

Thanks,
JL

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I stalled the motors and measure the voltage in the battery droping from 19.6V to 19.3V.

But what is the voltage drop at the input to the regulator supplying the MCU?
I reckon that Ross's idea of a backfeed preventing diode is a good idea.

It is always a brave person who puts high current circuitry on a board with sensitive inputs.

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jlotz,

A. I cannot answer your questions specifically because I was not able to view your schematic on my computer (but I could view your PCB artwork). Maybe you could re-post the schematic as a pdf?

B. I always put the micro on the regulator, other control & instrumentation circuitry - maybe, depends on the actual design, current draw vs needed reservoir cap size, etc.

C. What type regulator are you using & what is its input, unregulated voltage? If you provide me with this info, I will explain how to do a rough calculation of the required reservoir cap size.

D. Using batteries (instead of lab supplies?) as you suggest is OK for a test. Just make sure the battery supplying the micro is within the micro's operating voltage range. Yes, you need to tie the grounds together, and you need to be careful and thoughtful as to where you tie them together. One of the other major design issues in "mixed power" designs is "ground bounce" - voltage differences between different points on the PCB ground traces caused by high-current induced IR drops & similar inductive effects. Are you knowledgable & experienced in this area?

D. Does you circuitry provide any means of measuring motor current, supply current, etc? How about measuring motor or driver temperature?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, here it is in PDF.

IC8 - LM2940IMP-5.0/NOPB
IC1 - ATMEGA16A-AU
C1 - EEE-FP1V330AP
C10 - UVR2A471MHD
C15 - T491A334K035AT

c. Input unregluated voltage is from LIFEPO4 battery pack 19.2V nominal. As I measured yesterday the amp draw on this 5v reg is a little under 0.1A.

d. Circuit provides trip point for motor overcurrent. Trip point of somthing like 2.1A. If this happens IC20 picks it up and tells both IC 11 and the microcontroller IC1. IC11 will start to chop the enable lines on the L298s (IC2, IC3) and after 1 second of this happening the IC1 will just shut down the enable lines altogether. If this is happening for 1 second or longer then the motor (thruster) has been jammed with debris. This all seems to work very well. However on these last few boards, the micro resets usually before this 1 second is up.

Thanks,
JL

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jlotz,

OK, I can read this PDF version.

A. So, how many PCBs have you built and tested? What percentage exhibit the problem?

B. What is your calculated power dissipation in the 2940 regulator? Which package are you using and what heat-sinking have you provided.

C. Does your code enable the AtMega's watchdog timer?

D. You have a 0.33 MFD cap on the input to the LM2940 reg, the 2940 data sheet calls for 0.47. I'd try that, or even a 0.68. From my experience with this regulator, both the input and output caps need to be close to the 2940's pins. Are they?

Let me get answers to the above, then I'll comment further.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A. 11 pcbs , 1 showing is very badly, 2 showing it at times, and the rest have not showed it at all.

B. (19-5)*0.1=1.4W should need no heat sink. I do have it connected to the smlal ground layers though, maybe about 1 in^2. Measured temp once on it and it was around 90C.

C. It does not. Should I consider this?

D. I can try a slightly large cab here. Before I was soldering caps directly to the pins to see if that helped, but it did not. I tried a 220 UF on the input pin and it did nothing...maybe made it worse.

Thanks for the help.
JL

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, another day of trouble shooting, no fix, but some useful info.

Scope arrived and seems to work well. It is USB into my PC so I could record video and post on youtube.

Basically, it seems like there is some choppy supply voltage when my motor is a) turning in the forward direction or b) while it is loaded. Not so much when it is stalled. The resets however can happen while it appears as though the supply voltage (battery or 5v) is clean. Restarts as usual do happen when loaded heavily or stalled. The reason it may be choppy in one direction only is because I used phase anti-lock for my pwm where 50% is neutral 50%-100% is one direction, 50%-0% is the opposite direction. It is choppy on the 50-100% end for an unloaded motor, but clean on the 50%-0% direction. Again this free running stuff is not where it stalls but I will post the results anyways.

Channel #1 is output of 5VDC regulator,
Channel #2 is PWM input to the L298 motor driver.

Here is unloaded reverse/forward - Chip does not reset.
http://www.youtube.com/watch?v=V...

Here is unloaded reverse/forward - Chip resets at 18seconds and you see it bounce back to 50% duty cycle, since that is what program initializes at.
http://www.youtube.com/watch?v=w...

Here is stalled reverse/forward - Chip resets at 15 and 46 seconds. . No chop observed in signals because motors was not turning. Voltages go to 0 after first reset, because in this case it required me to turn the unit back on.
http://www.youtube.com/watch?v=J...

Channel #1 is output of 5VDC regulator,
Channel #2 is 19VDC battery power.

Here is stalled reverse/forward - Chip resets at 16 and 38 seconds. No chop observed in signals because motors was not turning.
http://www.youtube.com/watch?v=m...

Channel #1 is ground of 5vreg-ground of battery terminal
Channel #2 is ground of ATMEGA16-ground of battery terminal

Here is free running reverse/forward . It is with the probes comparing different points on the gnd traces to battery pin ground. Motors did not stall here.
http://www.youtube.com/watch?v=q...

I also tested as you suggested with another power supply. I first tested with a separate battery pack, supplying + from it (7.6VDC) into my LDO 5vreg feeding the micro and connected the grounds. No difference, micro still reset upon stalling motors. I then hooked this separate 7.6VDC battery up to its own 5vreg, and connected the grounds, disabled the 5vreg on the problem board and no difference.

Tried a different 5vreg, a Micrel 576-1152-nd, and no difference, maybe worse.

All this testing was done with the prescribed 22 uf tant. cap on the 5vreg Vin line. When I use the 0.22 uf electrolytic, it resets far less, but still a problem. Also the .22 uf is way out of the recommended range for the 5vreg.

Could this problem be software related, or maybe a problem on the ground circuit? I’m not sure how it could still do this when I am using a separate battery on the 5V line altogether.

Thanks again for all the help.
JL

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jlotz, best thing that you can do now is to throw away this PCB and not to waste any more time with it. It is sooo poorly designed.

mistakes:
- use a lot of tiny GND traces, same width as signals
- many right angle on the PCB tiny traces
- GND under uC, switch layers few times
- GND tiny trace with several right angle that connects the caps for the crystal oscillator is used to connect two other gates ICs (south or the uC), IC, without their own caps.
- only one cap for 6 GND connections (4 for uC, two for two gates ICs)
- long GND horizontal trace that provide GND to the uC connected to the battery '-' instead to be connected either to the big capacitor - or to the linear regulator that power the uC. Worst, it switches sides two times to get to the linear regulator (I do not understand why)
- same trace uses unnecessary two many angles, some of them 90 degrees
- same trace provide GND to the big ICs pin 8 and connections to C5 and C4 which are supposed to provide filtering for the main power supply full of noise
- no poured copper for GND at all.

These are the main mistakes I noticed at first. Not worth to investigate further.

Suggestion:
- at this complexity (board functions and number of components) if the overall size is restricted to be increased, I suggest four layer PCB
- GND connection to uC, use trace width at least the width or the pads
- connect all four uC GND pads in one layer
- use more than one capacitor for the uC power supply and as close as possible
- pour copper for GND in both layers, and connect them with vias
- do not use autorouter
- avoid sharp angles on GND traces
- when switch sides on GND, use more than one pad / via connecting same pair of traces
- try to use star connection for the GND. At its main node should be the big capacitor cathode, the battery cathode and the linear regulator GND.

George.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jlotz,

Lot's of good information here.

A. Let's start with the one video where the "chip resets" at 15 & 46 seconds. It looks like the 5 volts (greeen trace) is collapsing to near ground for a while and then springs back to life. Is my observation correct?

B. It's good that you are NOT using the WDT. In most cases I don't endorse the use of WDTs, but that's a whole other topic.

C. I think you are flirting with an over temperature shutdown of the LM2940 due to excessive power dissipation. If you are not an experienced power supply designer, you are probably misinterpretting the thermal capabilities of the package. Your part number indicates you are using the TO-263 package, correct?

You should try to replace the LM2940 with a 5 VDC bench supply to eliminate it entirely from the picture.

If you will tell me your experience level with power supply/regulator design, I'll give you an explanation of why I think your are likely having a thermal problem with the LM2940.

D. You have an analysis advantage here in that you have multiple units to judge. You have 1 major dud, 2 IF-ies, and 8 good ones. That tells you something! It tells you you have a working design (perhaps not optimal, but working in 8/11 instances). In this situation there are three major categories your failure(s) falls into. These are all CLASSIC Electronic Failure Scenarios I have seen in hundreds (if not 1,000s) of electronic products coming directly off the manufacturing floor.

A. BAD CONNECTIONS - #1 cause - unsoldered parts, mis-crimped connector pins, broken PC traces, fractured or misplated PC vias, solder shorts, unetched PCB copper, broken wires,incorrect PCB component footprint solders right most of the time, but not all the time, and well.... you name it.

B. WRONG COMPONENTS - #2 cause - wrong value R or C, chip installed in wrong orientation, wrong IC, diodes backwards, polarized capacitors backwards, wrong component (e.g. chip inductor instead of a resistor), crossed or mixed-up wiring connections. Again, you name it, the possibilities are endless.

C. MARGINAL DESIGN - #3 cause - There is one or more problems with the design itself (electronic or PCB layout) that is present in all instances of the product, even the working units, but it's bad enough in one unit to cause the observed problem or syndrome. These flaws are created by tolerance stack-ups, or a particular parameter is far to the low or high side of its spec - e.g. regulator output voltage, op-amp gain, etc. - and a vast array of other causes. Again, the sky's the limit! Still, the fact that some units "work" and others don't, tells you to look for something operating "on the edge".

The best means of finding the problem in #1 & #2, or eliminating these as the Class of the Problem, is simple VISUAL OBSERVATION. With SMD that usually means under a microscope or good magnifier. Take the bad board and a good one side-by-side and go over every square inch of both sides of the board, looking for the type of flaws I mentioned above. Years of experience have taught me that you will find these problems far more quickly by visual observation than by electrical measurement techniques. Sometimes the measurements will narrow down the area of the PCB or circuit for you, but the actual discovery will be by observation. For a board of this complexity and size, I'd guess you would want to spend about 10-15 minutes looking at all of the details. Maybe longer, it depends on your level of expereince with this type of troubleshooting technique, and your ability to recognize the specific flaw when it is staring you in the face.

If you come up OK with the visual observation, you most likely have the #3 cause - a marginal design problem.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Chuck and George
Thanks for your input so far.

Chuck - yes the 5V line drops to 0V here twice, because in the case the chip reset, and required me to restart it again, using a switch. The chip holds a relay on in order to maintain power to the board, and sometimes during a reset the relay releases and requires me to send the turn on jump start signal again from the controller. What is interesting about that 16/46 second reset, is the 5V line is very stable at 5VDC, and there is no evidence of it dropping at all just prior to the reset.

My experience with regulators.....none, I am trained in mechanical engineering, and self taught in electrical/programming.

Are you sure it could be thermal? This reset will happen when the chip is cold to the touch. It will happen just a few seconds after turning on the system, and the chip is cold. Package is SOT-223-3.

George – your suggestions are helpful, and I plan to implement some of them on my next run of boards. I was able to try a couple on my current boards too. I cut the ground track to the uC and ran a wire back to the battery pin, no change. I then added a 0.1uf decoupling cap to an op-amp and noticed an improvement….reset only 25% of the time I stalled it instead of the usual 80%. I added another decoupling cap to the hex inverter and now I cannot get it to reset at all. I ordered some tiny sm caps now to solder across each VCC=GND pin on the 4 sides of the uC and will see if it is still ok. Is that the fix for these boards? Seems to work, but the scope does not pick up any difference from this addition, since my 5V line appeared smooth before. The time/division I was using was 40 us.

Thanks,
JL

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jlotz,

I am not sure it is a thermal shutdown problem, but it could be because the chip dissipation (1.4 watts)required to make the 5 volts output from 19 volts at 90 ma (1.4 watts) calculates out to a pretty high junction temperature for the LM2940. More on this in my next post.

First though, let me get a clearer picture of what you are seeing.

A. How, exactly, do you "know" that the processor is "resetting"?

B. What do you mean by "no evidence" the 5 VDC is dropping? Scope trace? Other observation?

C. In your schematic which relay is this "power hold" relay and what is its purpose? What is the manufacturer and part number?
Do you know its pull-in and drop-out voltages?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Power hold relay is RTE24024 (18.8/2.4 on/off coil voltage). I use this to hold power from the battery to the ROV PCB. ROV cannot easily have an on switch since it is all within a pressure hull. The controller sends a small voltage down to a transistor that turns on the relay for a few seconds while the ROV PCB boots up. The ROV PCB once booted holds the relay itself, and the UTP line that was used to do this flips over to function as a the video feed. This means I used the same UTP for two functions and I get to maintain a smaller tether diameter. Thicker heavier tether = more drag on ROV. I don’t think this is the issue because remember when I plugged in my 5V external bench test battery it did the same thing. This bypassed the relay entirely.

I know it is rebooting because in my code before the main program loop, I flash some LEDs in a pattern that only happens upon boot up.

No evidence of 5VDC dropping is from scope trace...although I need to note that it was read at a 40 us time/div...maybe I need to change this to a quicker reading?

Thanks,
JL

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jlotz,

A:
OK. So, can you tell me definitively whether your system is "reseting" or "rebooting"? Do you understand the distinction? Both could exhibit similar or overlapping behavior.

Resetting means the micro's hardware is actually returning to its power-on start-up state. There are typically a few ways this can happen.

Rebooting means the program/software/firmware is "passing thru" it's starting point again - that is, executing the very first instruction of the normal boot sequence at reset/power-on time, and continuing on from there, instruction-by-instruction, as it would in a "reset" scenario. (Which is why you could easily confuse the two operations.) There are many ways a re-boot can occur.

This is, in fact, a classic micro-processor "illusion" that fools newbies all the time, and experienced micro guys occasionally as well.

There are various ways to sort out the two. I have to look at your specific micro data sheet before I render an opinion.

B:
As to the 5 volts not seeming to drop on the scope...
It seems from your videos that you are using the scope in "Auto-Trigger" Mode. In this mode the scope will simply begin the traces based on an internal clock rate related to the Horizontal Time Scale you have selected. You need to learn about "Normal Triggering Mode". In this mode the traces trigger according to voltage trip points on the input signal (in this case the +5 VDC . In a conventional O-scope you set this "Trigger Level" with a knob and then there's a switch to select which of the input traces is used for the "Trigger Source". On your USB scope these are probably menu settings.

Even if you understand and learn Normal Triggering Mode (in contrast to "Auto Triggering Mode"), you will still need experience and some more scope skills to catch a loss of voltage event on the 5 volt signal. So, practice with the "yellow" square wave signal I see in your video. When you get Normal Triggering working you will see the yellow square wave's leading edge locked to the left margin of the O-Scope screen. Then, you will be a lot closer skillwise to being able to trap a 5-volt event. If indeed, that is your problem.

C:
Here's the general outline for analysing the thermal situation of your LM2950 regulator.

In the LM2940 Data Sheet "Absolute Maximum Ratings" section find "Maximum Junction Temperature" spec - it's 150 degC. Also, read the associated "Note 2" at the bottom of Data Sheet Page 6. Take note of the "thermal shutdown" feature of this device.

In the "Thermal Performance" section find "Thermal Resistance Junction-to-Ambient" (so-called "Theta-JA"). Note for your TO-262 package it is 80 deg-C/Watt.

Now calculate the nominal internal power dissipation of your LM2940. It has two components:

1. A component related to your load current and output voltage. 19 volts in minus 5 volts out is a 14 volt difference across the LM2940. Multiply this by the 90 ma load current you stated in a previous post and you get 14 x .09 = 1.26 watts that needs to be dissipated by the LM2940's internal transistors, etc, into the case and out to the cooling air, PCB, etc.

2. In the "Electrical Characteristics" section of the data sheet find a parameter called "Quiescent Current". This is the current the LM2940 needs for it own "internal housekeeping" and is distinct from the load current we used in #1 above. You need to multiple this by the full battery voltage to determine how much heat this Quiesent Current "implies". The typical Q. Current given is 10 ma but it could go to 15 ma. Lets use 10 for a quick calc. 19 x .01 = .19 Watts.

So, your LM1940 must nomially dissipate 1.26 + .19 = 1.45 watts. How hot will the LM2940 get doing this? Specifically, how close will this level of dissipation get us to that critical Maximum Junction Temperature of 150 deg-C? That's where Theta-JA comes in. Theta-JA is a measure of how many degrees-C the "junction" (parlance for the actual silicon chip buried down inside the package) will rise above ambient for each watt it is forced to dissipate. That part of the analysis is pretty simple to calculate ( 80 degC/Watt x 1.45 Watts = 116 degrees-C). Which tells you the "junction" will run 116 degrees hotter than the temperature of the "ambient" surrounding the TO-263 package. Determining that "ambient temperature" is the hard part. What we usually do is play the numbers backwards from the maximum junction tempeature (150 degC) to find out what kind of "margin" we have. So, 150 - 116 = 34 degC of "margin". In other words if the "ambient" gets to 34 degC, the part is "toast". But in this case we are saved by the thermal shutdown, which presumably kicks in at a junction temperature low enough below 150 degC to save the chip from destruction.

So, how close is your "ambient" to 34 degrees C? I'd say if your running in a room temperature environment (25 degC) - too close for comfort. Start taking into account that you might have momentary currents that exceed 90 ma, or a "hot" LM2940 with a quiescent current closer to 15 ma than to 10 ma, etc, etc, etc, and you might conclude as I do that you are "flirting" with a thermal shutdown or destruction situation. Typically, we conservative EE's like to get about 20 to 30 degrees of margin on that junction temperature. To do that you need to use a bigger package or heat sinking. Which is the direction I think you have to go with your design even if your present #1 reset problem is NOT thermal related.

So for NOW, can you tell me if you are "resetting" or "rebooting"? I'll check the micro data sheet in the meantime.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Chuck,

Are you sure it's 80C/W. I have perhaps 1 in^2 ground plane behind it helping to dissipate heat. The data sheet makes this sounds more like low 70'sC/W. At any rate, I can increase this cooling.

Now I am a little confused on the uC reboot/reset issue. I am not sure how to tell which it is. What I know is one of three things will happen when this occurs:

1) circuit board resets/reboots(?) so fast that the power hold relay is maintained, my rs485 communication drops out for a few seconds while the code runs through my startup routine, and after this it reconnects and all is fine.

2) circuit board resets/reboots(?) but the power hold relay is released and therefore cannot continue to run. This is when I have to press the button to turn on the power relay and let the um take over. This is what you saw on the 16/46 second reboot/reset(?) video.

3) circuit board cramps up, and some of the I/O turn full on or full off. Thrusters normally are frozen full on, which means the enable outputs on my uC are high. They cannot be in a tri-state, because I use some 10K pull downs to ensure they are low when the uC is not in control of the pins.

Thanks,
JL

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jlotz,

I AM sure the data sheet says the TO-263 package has a Theta-JA of 80 degC/W. I don't know what Theta-JA is when I solder the thing to a PCB, or when I add some copper to an inner layer or the solder side and then add some vias of questionable and variable thermal conductivity and expect them to draw heat away from the part. For one thing I don't know how hot the PCB runs due to the heat contribution of other components around it, I don't know if the solder (opposite) side of the PCB has any significant air circulation, and I don't know how much heat is being drawn under the LM2940 by any thermally conductive ground and voltage planes from other hot components. See? Its all a very "mushy" situation which defies precise, mathematical analysis. That's why you have to leave a lot of margin. One test is to replace the LM2940's output voltage with a lab supply, disconnect its input and output pins from the PCB (which in itself alters the thermal environment), but leave the TO-263 package otherwise soldered to the board, exercise the system and see how hot the TO-263 package gets on its own without internal heating, then use that number as your "ambient temperature". It depends on how much time and money you want to spend to save putting a heatsink on the boards or taking other measures to dissipate the heat. It can get pretty involved, but you can cover a lot of shortcomings by having enough "margin".

By the way what is the operating ambient temperature of your product?

Rebboting-vs-Resetting - see what I mean by "illusion"? Its a classic chicken-&-egg problem. Simultaneous Cause & Effect - which are you observing the Effect or the Cause? In & by itself the observation can leave you bewildered. You need more information.

Read the chapter in the AtMega16 data sheet entitled "System Control & Reset" (Chapter 10 in my AtMega16A data sheet) and particularly the description of the MCUCSR register which has bits indicating the reset status of the device.

You need to read and somehow "annunciate" these bits so you can determine their status while your device is operating. Maybe thru a debug serial port, maybe on LEDs, maybe on extra I/O pins, etc. Read the register on a regular basis and relay the state of these bit to your means-of-annunciation as often as practical.

Note the state of these bits after a normal power-up, you'll probably want to then clear them with your program, then note them again as the processor is running and, of course, immediately after one of your reset/reboot events. You may get The Big Clue from this exercise.

Also, what are your Fuse Settings? Particularly the Brown-Out Reset bits.

At this point I would say the most important issue to resolve is whether you are observing a reset or a reboot as this will indicate (generally) a hardware or software problem. My original assumption was that you were seeing a "legitimate" but inadvertant hardware reset of somesort. Now, based on your added descriptions, I'm undecided.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jlotz,

I forgot to mentioned the three observed syndromes you described. My opinion is that #1 is the "root" or primary effect. #2 & #3 likely follow from an exagerated or extended instance of #1.

Can you simply short the contacts on the Power Hold relay (as a test), so it does not kill the power and cause an "avalanche" of symptoms resulting in syndromes #2 & #3? Do all instances of the problem look like #1?