Author Topic: PSOC4 based boost led controller  (Read 4886 times)

0 Members and 1 Guest are viewing this topic.

Offline ealexTopic starter

  • Frequent Contributor
  • **
  • Posts: 326
  • Country: ro
PSOC4 based boost led controller
« on: March 17, 2015, 03:04:33 pm »
Hello

I've got some of the "filament leds" - 80V, 10mA per led.
I want to be able to power 8 of them from a 12-24V supply - this implies a boost converter that can deliver ~ 90V at 80mA and have some sort of current control and limiting - peak current control for the switching  transistor and average current control for the LED's - should be dim-able and fully isolated - capacitive buttons.
Everything will be inside a glass tube with a plug on one end.

With these requirements i decided to use a PSOC4 chip for the on-board analog and digital blocks ( adc / cap-sense / analog and digital )

See the attached image for the "schematic" that i imagined:

The PWM_1 block is the pwm generator - it's duty is controlled by software and it's free running - the mosfet driver is not drawn on the schematic. Output period is 10uS - 240 ticks ( or 480 if i want to use a 20nS period )
The AND gate, SR flip-flop and Comparator form the cycle by cycle current limiting - the flip-flop is set on the rising edge of PWM and it's reset if the comparator generates a 1 at the output.
If the flip-flop output is not 1 the AND gate will send 0 to the PWM output and terminate the current cycle.
The comparator has a 10mV hysteresis enabled. The Sync block is used because PWM is clocked from 24MHz.
The 12MHz clock will generate some jitter - i can move the PWM clock to 12MHz and the everything should be aligned.
The reference sets the peak current - i can put it on the board with a zener / trimmer combination or derive it from the 3.3V supply and filter it.

The ADC block is used as the led current control - slow loop. A timer based software control loop will read the ADC value and update the PWM duty cycle with a period of tens of ms.

Not on the screen - the capacitive touch cotroller with 2 capacitive buttons ( brightness up / brightness down )

Could this work ? should i get some parts and implement it on a piece of copper clad ? or there is something wrong with my logic ?
 

Offline ealexTopic starter

  • Frequent Contributor
  • **
  • Posts: 326
  • Country: ro
Re: PSOC4 based boost led controller
« Reply #1 on: March 21, 2015, 10:45:15 am »
got the hardware ready:

The topology is simple - basic boost converter, some decoupling caps and a MIC4420 mosfet driver on the green expansion board.
most of the parts are "overkill" but will not easily blow in case the firmware will goes crazy - the plan is to make all the electronics fit in a 50mm diameter glass tube ( maybe making some circular boars ? but slim chance for a 1-off)

the leds are all wired in parallel. I might add some 10R series resistor on each led. the big blue resistors are 10ohm / 3W.
the big cap is 470nF / 300V and the small electrolytic is a 10uF / 100V

The analog signals pic-up is filtered with 1k / 1nF RC filter.
I'll post some measurements once i get a stm32 board to generate a blind 10-20% pwm ( forgot the psoc board at work ... )
also, got an idea of how to make a "hardware" safety system - use the digital blocks to make a falling edge detector / counter system - if there is no falling edge on the pwm output in more than xuS then the output will be forced low ( maybe force a micro reset ? )
 

Offline CM800

  • Frequent Contributor
  • **
  • Posts: 882
  • Country: 00
Re: PSOC4 based boost led controller
« Reply #2 on: March 21, 2015, 03:55:45 pm »
What are those little white squares with solder on them... I have never seen them before (and where did you get them)
 

Offline jeffaroo

  • Contributor
  • Posts: 11
  • Country: us
Re: PSOC4 based boost led controller
« Reply #3 on: March 22, 2015, 05:48:34 am »
What are those little white squares with solder on them... I have never seen them before (and where did you get them)

Do a search for "manhattan solder pads".   For another drool worthy example see https://aa7ee.wordpress.com/tag/manhattan-construction/.  I usually make my own pads but they don't look nearly as good as the ones ealex or aa7ee use. It would be nice to find some with castellated holes on the sides so I could tack them down with a bit of solder instead of glue.

Back to our regular scheduled program....  ealex, looking forward to how this works.
 

Offline ealexTopic starter

  • Frequent Contributor
  • **
  • Posts: 326
  • Country: ro
Re: PSOC4 based boost led controller
« Reply #4 on: March 22, 2015, 09:31:21 am »
got the pads from here: http://www.qrpme.com/?p=product&id=MES
they're made from thin pcb 0.5mm) and v-scored.
i also tried to make my own, but could not get hold of a punch tool / press and i found aa7ee web page - quite a lot of useful building techniques.

i'll try to power the board later today - put a hard-coded pwm and probe at some wave forms - to see if there is anything obviously wrong with it.
 

Offline ealexTopic starter

  • Frequent Contributor
  • **
  • Posts: 326
  • Country: ro
Re: PSOC4 based boost led controller
« Reply #5 on: April 04, 2015, 07:15:45 pm »
Got the thing up and running

The schematic is in the attached pdf file.

A short explanation:
Pwm block is the main signal generator. It's duty cycle is controller by a software loop that compares the voltage at the Iled_In input pin to a set-point.
The I_Input ADC measures the current from the led bank on a 10ohm current sense resistor.

The Current_Comparator receives on the + input the switching transistor peak current measured on a 1ohm resistor
On the - input it sees a fixed voltage set by the IDAC sourcing current in an external 10k resistor.
The analog IO pins on PSOC are bidirectional so the above reference voltage generator works properly and allows on the fly changing of the peak current

The analog comparator is configured with 10mV hysteresis and slow compare speed.
The 5 D flip-flops and AND gates form an extra glitch filter - if the output is stable for at least 5 clocks an over-current digital pulse is generated.

The Sync block, 2 flip-flops and additional gates form a rising edge detector that resets the peak current detector on each new PWM cycle.

The right-most S-R flip-flop and AND gate form the peak current detector - the PWM output is enabled 2 clock cycles after the rising edge of the PWM generator and goes low at the PWM compare match or over-current event.

This forms a cycle by cycle current limit - basically replicates an UC3843.

The CapSense block is not used now - it will create the user interface.

The software is "dumb" - it compares the led current to a set point and increases / decreases the PWM duty cycle by 1 step for each ADC update event. There is a top hard limit for the pwm duty but no low limit. It tends to oscillate if the input voltage steps from 10V - where the over current limit is engaged to 12V where duty cycle limit should engage. It stops oscillating if the input voltage is increased to 13V.

I've tested it up to 18V input voltage - voltage limit on mosfet driver ( maybe i'll add a zenner to limit mosfet driver input voltage )

Measured efficiency is ~ 75% - a lot of losses on the peak current sense resistor - 1 ohm on the prototype. Also, the inductor is not happy - it gets quite hot after some time

Light output is comparable to Philips 7W led lamp

 

Offline jboard146

  • Contributor
  • Posts: 38
  • Country: us
Re: PSOC4 based boost led controller
« Reply #6 on: April 07, 2015, 04:39:34 pm »
Mike of "mikes electric stuff" did a video on driving these from a pic micro. He did a clock with them.
He went into quite a bit of detail on driving them. Check out his webpage/video.

http://www.electricstuff.co.uk/ledfilclock.html
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->