Flickering issue with darlington-buffered pwm output

JayAuckland

New Member
I am building a small lighting controller/fader system for a friend's miniature model theatre, using the adc on 10 x 08m2 chips to read 10 'channel' slider pot faders and outputting/buffering the pwm from each pic through two paralleled darlington pair inputs (ULN2803).

The paralleled outputs of the darlington pairs for each channel go via a header and very short ribbon cable to 'mimic' leds beside each channel's fader. The output of the darlingtons also go to a d-sub connector to feed the outputs via a 1metre ribbon cable to the theatre's LED 'spotlights'.

A master fader 08m2 chip operates much the same way but also calculates a 0 - 100% value from the adc and serial outputs this down a common bus to all the channel pics where it is used to modify the adc-to-pwm value. It has a mimic LED but the pwm is not used for anything else... it does not go to the ribbon cable.

Channel fader code:
Code:
setfreq m4
disconnect
pwmOut 2, 60, 0

Poll:
serin 5, N4800_8,("MF"),b6			'input master percentage into b6
ReadAdc 4, b2 				        'read channel fader level into b2
b7=b2*b6/100					'apply master percentage to fader level, store in b7

pwmduty 2, b7

goto poll
Other 08m2 inputs are reserved for functions to be added at a later date such as on/off switching and automatic fade up and down. For now those inputs are held low.

The paralleled outputs of each channel's darlingtons feed mimic LEDs on the control panel (via very short ribbon cables and headers) and will soon also feed the LEDs in the theatre 'spotlights' via a 15pin d-sub connector and about a metre of ribbon cable.

The controller unit itself works just fine with good output response to the channel and master faders and steady mimic LEDS.

PROBLEM:
When I connect the 1 metre ribbon cable (without anything connected at the other end at this stage) some of the mimic LEDs start to flicker to full brightness slightly, sporadically and apparently randomly. The flickering on each channel seems to be independent of the flickering on any other channels. And it becomes slightly more evident as more faders are moved 'up' away from zero level).

Physical layout: the channels with the worst flicker are furthest down the serial/percentage common line and nearest (electrically and physically) the power supply - which is stripped out of a standard +12v domestic switchmode plug-in psu. +12v powers the mimic and (eventually) theatre LEDs, as well as the pics via a simple 7805-&-capacitors +5v regulator circuit. The master fader (not attached to the ribbon and furthest away from the psu) does not flicker, nor do the four channel mimics nearest to it.

Does anyone have any suggestions on how to work out what is going wrong here? Inductance in ribbon cable? RF interference? Unit and case are earthed.

(This is my first seriously grunty PICAXE project so pretty much everything I am doing is at the very limit of my knowledge so far!)

Jay
 

hippy

Technical Support
Staff member
It does sound like some sort of external interference problem. I recall some odd behaviour with other 'unintended aerials' creating problems in the past.

An exact circuit diagram of the system, particularly output drives, mimic, connectors and cable may help identify potential problems or the cause.

I would also try temporarily replacing the 12v switch-mode supply with a car battery or linear supply to see if that improves things.
 

premelec

Senior Member
Could be floating input pin...? I'd put the PULLUP ON instruction at the beginning of the program see if that affects it.., Ribbon cable also has a lot of capacitance between adjacent conductors so re-arranging what wire is next to another could help - or use individual wires instead of ribbon... as hippy says schematic would help... and picture of layout...
 

JayAuckland

New Member
Could be floating input pin...? I'd put the PULLUP ON instruction at the beginning of the program see if that affects it.., Ribbon cable also has a lot of capacitance between adjacent conductors so re-arranging what wire is next to another could help - or use individual wires instead of ribbon... as hippy says schematic would help... and picture of layout...
Thanks hippy and premelec, over the next few days I'll try some experiments based on your suggestions... and one or two other throughts that have come to mind that are a bit more 'shot in the dark'! And if those don't work I'll upload a schematic etc.

J.
 

JayAuckland

New Member
Sorry it's taken a while to report back... other parts of life intervened!

Working on the parallel conductors creating interference theory I tried changing the ribbon cable for something more loose and unaligned. No improvement. Then installed a prototype pcb which is much less elegant and tidy but with way fewer parallel tracks and the problem disappeared.

Weird thing is that the now-missing paralleled pcb tracks were on the outputs... but I now seem able to add a heap of ribbon cable to those same outputs and the flicker/interference problem doesn't show up. 2 meters of ribbon cable as a trial at the moment and no flicker! As far as I can tell the two pcbs are electrically identical, just the track layout is different/simpler.

Not sure exactly what has caused the problem to disappear but it has - and for now that is enough!

Thanks for all the help guys.

J.
 

BeanieBots

Moderator
I would guess that the act of creating a breadboard version has "corrected" an un-noticed wiring error. Most probably a pull-up resistor that was not connected and hence left a floating input. Maybe even the serial download 10k resistor not connected before but now it is.
 
Top