Resetting problem

greencardigan

Senior Member
Hi there.

I'm finally back with an update on this problem.

I ran the full code until it crashed then loaded some simple test code that powers the fan only.

Code:
main:
inc b0
sertxd (#b0,13,10)
pwmout 3,255,1023
pause 100
goto main
This test code continued to crash. Sometimes resetting, sometimes pausing for a second, sometimes stopping altogether.

So it's definitely not a coding issue. I still suspect it's a power supply issue.

I'll try providing the picaxe with a separate supply and see if that helps.
 

Dippy

Moderator
Running your PICAXE circuit in isolation should have been one of your first tests.
Has your circuit changed from Post#1 ?
Taking the PICAXE regulator supply from the anode side of diode (picture2)will introduce more noise/spikes to regulator and hence PICAXE.
PICAXE has no decoupling on power pins aparently. This should be mandatory for noisy circuits.
Testing the PSU for noise/dips/spikes under various load should have been tested. If sw/mode this can vary hugely.

I don't know excactly your PSU type but maybe you are getting some ground loops which may explain different behaviour with download cable in/out.

It may just be a crappy PSU; unstable/noisy/feeble.
Maybe dodgy soldering or wiring.
You need to spend an hour or two testing. Maybe even use a 'scope.
But it certainly appears like it's down to your design/construction/component choice - a properly made circuit will not behave as described.
 

greencardigan

Senior Member
No, the circuit has not changed since post 1.

The power supply is a 24V 100W switchmode laptop supply with adjustable output voltage.

By decoupling on the power pins, do you just mean a capacitor between the +V pin and gnd? 0.1uF like I have on the Maxim chip?

I don't have access to a scope so it is difficult to check the supply.

I'll report back once I try a separate supply for the picaxe circuit.
 

inglewoodpete

Senior Member
By decoupling on the power pins, do you just mean a capacitor between the +V pin and gnd? 0.1uF like I have on the Maxim chip?
I use a 0.1uF capacitor mounted at cloase as possible to the PICAXE's power pins, with leads as short as possible. On 40 pin PICAXEs with 2 pairs of power pins, I use 2 x 0.1uF (obv. 1 on each pair).

I've got some photos somewhere: I'll have to dig them out.

Peter
 

Dippy

Moderator
Yes, on noisy circuits people often parallel a couple of caps e.g. a 22uF electro plus a 0.1u (100nF) CERAMIC.
As said above, as close to pins as poss. otherwise the 'point' can be lost.
(Fatty acts like a reservoir and skinny acts like a bypassing filter)

If really HF is an issue then some parallel a 3rd cap of a decade (at least) lower value e.g. a 1nF CERAMIC.
If this is an issue then Ceramic dielectric choice can be important.
Anyway, I digress.

Try the separate PSU. Batteries as suggested by MPep unless you have a top quality bench PSU.
Then the caps.

And hopefully you can get this sorted before we get to the London Olympics :)

This may, of course, be entirely down to your construction, component selection or s/mode PSU so the ball is firmly in your court for checking and testing.
Good luck.
 

John West

Senior Member
Thanks for the helpful info.

I've removed the 6A diode from inline with the supply and placed it in parallel with the 3A diode across the motor. They are no longer getting hot.

Somehow this has stopped the resetting problem also???? Any ideas why?
Beaniebot's post #14 gets to the heart of it. But I'll add my two farthings worth. I'm in a type-ative mood. :)

Your power supply diode was the likely culprit for the worst of the resets. Any spike voltage higher than the power supply voltage was isolated from the low impedance of the power supply output and was free to create what havoc it could with the rest of the circuit. Removing the diode in the power supply lead allows the supply to sink as well as source voltage/current, thus stabilizing the load and helping suppress noise spikes. It's necessary to stabilize BOTH sides of the circuit's power supply.

The paralleling of the snubber diodes merely helps spread the inductive energy dissipation chores - not a bad thing per se - but not the fix for the reset problem. BTW, if one diode is slightly faster than the other - almost certainly - it will pass more current, making it warmer than the other, dropping it's junction drop voltage below the other diode's and stealing more of the load - creating an imbalance problem. Which is why you don't see paralleled diodes in well designed circuits.

Using a Shottky diode for the snubbing job is a common practice and highly recommended, especially if you don't have access to a 'scope to see what the noise spikes look like. Shottky's have a lower forward V drop and faster reverse voltage recovery - they're just plain better at handling the inductive spike. When you can't see what the possible problems are it's best to use the components that are most likely to solve or avoid problems.

I'm in agreement with the suggestion to put a substantially larger capacitor on the input to the 5V regulator - not to provide more current to the regulator - but to absorb voltage spikes from elsewhere. I'd also suggest adding a low value cap on the input to the 5V regulator to catch high speed spikes. The larger a capacitor the worse it is at catching high frequency spikes. You might also consider adding a small resistor in front of the regulator input capacitors to further suppress any spikes that might be feeding the cap. One that dropped a tenth of a volt or so in normal operation should work well in conjunction with a large enough cap to spread the RC time constant over several pulse cycles.

That would effectively decouple the regulator from any likely input spike.

Without access to a 'scope - in a non-production build such as this - I'd put a fairly large value and a very small value cap at both the input and output of the regulator. (And anywhere else I thought it might help.) When you're working blind, overkill is good.

Finally, (as noted by others,) careful attention to an effective ground system with no loops is essential. Use a separate heavy ground on each high current load and take each lead all the way back to a common tie point at the power supply. Star grounds are your friend.

Time to stop my rant. I've already said more than I know. :)
 
Last edited:

greencardigan

Senior Member
Hi all.

Thanks for all the informative posts. I realise I need to read up more regarding good circuit design. Learning by tinkering can only get me so far.

Anyway, I have separated the picaxe from the 24V supply and am now feeding the 5V regulator from a small 12V plugpack. It seems to be working well so far without any resets.

Case closed. Thanks for everyones help. If you were here in person I would make you a cup of picaxe controlled freshly roasted coffee. :)
 

Dippy

Moderator
That's good news.
These sorts of issues are 99/100 down to circuit design , construction and component understanding.
As you get more experienced some of these things become a kind of 'second nature' and you will get a feel for it.

Maybe a paragraph in the Manual re: noise/spikes/decoupling would be handy.

"..cup of picaxe controlled freshly roasted coffee"
- sounds good. I just hope you get some more experience before designing the circuit or elese we'll be waiting months for the water to boil :)
 

BeanieBots

Moderator
As Dippy states, more often than not it comes down to layout and an appreciation that components are not perfect.

In this increasingly predominantly digital world, it is worth going back to early analogue designs for some insights. Consider the early record players. These had pickups which produced only a few 10's of microvolts which drove speakers at many hundreds of watts. With such massive amplification and large currents flowing around, any signals due to bad layout would be picked up and amplfied with horrible results. Put a finger on the input and listen to all that noise and mains pickup. Then ask yourself if 'floating' digital inputs should be grounded or not.
 
Top