Author Topic: Pot controlled PWM generator  (Read 9047 times)

0 Members and 1 Guest are viewing this topic.

Offline Back2VoltsTopic starter

  • Supporter
  • ****
  • Posts: 495
  • Country: us
Pot controlled PWM generator
« on: March 02, 2017, 12:04:16 am »
I am want to drive two 150mA 8xLED strings with dimming control.  Using 12V wall adapter.   I am leaning towards using one TPS61165-Q1 LED switching booster per string, with dimming controlled with a common PWM signal.   
   
http://www.ti.com/lit/ds/symlink/tps61165-q1.pdf

The question is what to use to generate the PWM signal (other than an MCU).  I want to use a potentiometer to vary the duty cycle.   I have seen 555 based circuits, but I wonder if there are any specialized ICs that would be a better choice.

Another question is what frequency to use for the PWM.   The TPS61165 specs a range of 5KHz to 100KHz.   Is there an advantage in choosing a given value in that range ?   Could it be a factor that the pot will be wired 2"-3" away from the circuit board. 
 
As always, I will appreciate any comments.
 
 

Offline neko efecktz

  • Regular Contributor
  • *
  • Posts: 153
  • Country: au
Re: Pot controlled PWM generator
« Reply #1 on: March 02, 2017, 02:12:38 am »
Gidday.
There are lots of suggestions on line and the most popular would have to be using a 555 timer ic.

Google Search for        PWM WITH 555

attached is a small section of the found pages.

good luck with your project
BILL.
 

Offline Back2VoltsTopic starter

  • Supporter
  • ****
  • Posts: 495
  • Country: us
Re: Pot controlled PWM generator
« Reply #2 on: March 02, 2017, 05:27:43 am »
Gidday.
There are lots of suggestions on line and the most popular would have to be using a 555 timer ic.

Google Search for        PWM WITH 555

attached is a small section of the found pages.

good luck with your project
BILL.

Bill, thank you for the answer.   I have done quite a bit of googling, but most of the answers point to the 555 or multi-opamp (oscillator/saw tooth/comparator).   For simplicity, if I had to choose between those options, I would take the 555.   But my question is about any existing ICs designed to play in PWM generation.   Something like the LTC6992 that I have just found, (a bit pricey) 

http://www.linear.com/product/LTC6992-1

There have to be other ICs like that one from other brands.  (I tend to buy from Mouser, but for some odd reason they don't seem to carry LT products.)

Tony
 
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Pot controlled PWM generator
« Reply #3 on: March 02, 2017, 11:09:08 am »
If you wanted to do some simple coding a PSOC 4 can be had
for < $ 2, the real low end of family < $ 1, gives you onboard
reference, A/D, DAC, PWM, Serial, Logic Fabric, OpAmps, Com-
oparator......Software free, tons of examples

http://www.cypress.com/products/32-bit-arm-cortex-m0-psoc-4

Check Design Support tab above link, code examples.

For me what stands out is -

1) Routability
2) Fast 12 bit SAR A/D and slow 20 bit DelSig
3) DFB (Digital Filter Block) that is dual channel, handle FIR or IIR filters, or DFB
can be used as a GP fast processor block, similar to RISC block
4) MSI logic elements GUI based and/or the UDB Verilog capability. Eg. the FPGA
like capability
5) Onboard Vref
6) IDAC, VDAC, OpAmps (up to 4), comparator, mixer, switch cap, analog mux....
7) LCD,  COM, UART, I2C, I2S, One Wire, SPI, Parallel, LIN, CAN, BLE, USB
9) Custom components capability, create with schematic capture or Verilog
10) DMA to offload processes like filters, COM, Display
11) ARM M0 (PSOC 4) or M3 (PSOC  5LP) or 8051 core(PSOC 3)
12) Extensive clock generation capabilities
13) All components supported by extensive prewritten APIs

https://www.element14.com/community/thread/23736/l/100-projects-in-100-days?displayFullThread=true

http://www.cypress.com/documentation/code-examples/psoc-345-code-examples

Great video library

Attached component list.  A component is an on chip HW resource.

Free GUI design tool with schematic capture, "Creator". Components have rich API library attached
to each component. Compilers free as well.

PSOC 4 is low end of family, consider 5LP parts as well. PSOC 4 also has arduino footprint boards (pioneer) as well

https://www.elektormagazine.com/labs/robot-build-with-cypress-psoc

http://www.cypress.com/products/32-bit-arm-cortex-m-psoc



Regards, Dana.
« Last Edit: March 02, 2017, 11:16:00 am by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline Back2VoltsTopic starter

  • Supporter
  • ****
  • Posts: 495
  • Country: us
Re: Pot controlled PWM generator
« Reply #4 on: March 02, 2017, 03:41:58 pm »
Dana,  I do have the PSoC 4/5 prototyping kits on hand, but I want to keep this as an analog only project.   I was just hoping that one of you guys which (seems) have been at this forever might have been familiar with an obscure specialized part.  Since this is a one of project, I may end using the LTC6992 or I may use a 555 with the least possible parts around. 

Thanks for the suggestion,
Tony
« Last Edit: March 02, 2017, 03:55:54 pm by Back2Volts »
 

Offline Back2VoltsTopic starter

  • Supporter
  • ****
  • Posts: 495
  • Country: us
Re: Pot controlled PWM generator
« Reply #5 on: March 03, 2017, 06:54:06 pm »
After digging further into the TPS61165 driver, it seems that there is an alternate way to drive it directly with a plain DC setting from the potentiometer.    I'll give it a try when I get the parts. 
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Pot controlled PWM generator
« Reply #6 on: March 03, 2017, 07:13:54 pm »
I've used the TL434 (I think that's the right number) SMPS controller as a simple PWM generator before. It has other features but you don't have to use them.

A dual op-amp and a handful of passive components can give you a ramp oscillator and comparator, I recall building one of those to play with on a breadboard once.
 

Offline Back2VoltsTopic starter

  • Supporter
  • ****
  • Posts: 495
  • Country: us
Re: Pot controlled PWM generator
« Reply #7 on: March 03, 2017, 11:05:52 pm »
I've used the TL434 (I think that's the right number) SMPS controller as a simple PWM generator before. It has other features but you don't have to use them.

I wonder if you are taking about the TL494 (Could not find 434).

http://www.ti.com/lit/ds/symlink/tl494.pdf
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Pot controlled PWM generator
« Reply #8 on: March 03, 2017, 11:08:46 pm »
Oops, yeah that's the one, TL494, it was used in loads of computer power supplies back in the day.
 

Offline Back2VoltsTopic starter

  • Supporter
  • ****
  • Posts: 495
  • Country: us
Re: Pot controlled PWM generator
« Reply #9 on: March 08, 2017, 11:53:49 pm »
Dana,  I do have the PSoC 4/5 prototyping kits on hand, but I want to keep this as an analog only project.   I was just hoping that one of you guys which (seems) have been at this forever might have been familiar with an obscure specialized part.  Since this is a one of project, I may end using the LTC6992 or I may use a 555 with the least possible parts around. 

Thanks for the suggestion,
Tony

Dana, I have changed my mind.   Sooner or later I planned to play with the forgotten PSoC 4/5LP prototypes and doing some reading I have just realized that the 5LP KitProg can be used as programmer/debugger for all PSoCs.   So I am going to order some low end 4000 parts and build that pot PWM.

Thanks, Tony
   
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Pot controlled PWM generator
« Reply #10 on: March 09, 2017, 01:32:08 am »
While it's hard to argue with that cost, it always bugs me a little to use such a powerful part for something that could so easily be handled by a dual op-amp and a handful of passives with no firmware to worry about.

 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
Re: Pot controlled PWM generator
« Reply #11 on: March 09, 2017, 04:34:19 am »
You really can't get much simpler than the 555 for this application.

The easiest person to fool is yourself. -- Richard Feynman
 

Offline Back2VoltsTopic starter

  • Supporter
  • ****
  • Posts: 495
  • Country: us
Re: Pot controlled PWM generator
« Reply #12 on: March 09, 2017, 06:36:08 am »
You really can't get much simpler than the 555 for this application.

Agreed when you look at it as the 555 circuit by itself.   It becomes harder when you want to share the duty cycle pot for two identical circuits.   Most 555 solutions use the pot inserted in the circuit, not as a voltage setting which could be sent two ways.   The LTC6992 is simpler and could do it, but at $4 a piece.

I could go for a single circuit board with the 555 and the two boosters. 
   

 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Pot controlled PWM generator
« Reply #13 on: March 10, 2017, 01:18:57 pm »
Quote
While it's hard to argue with that cost, it always bugs me a little to use such a powerful part for something that could so easily be handled by a dual op-amp and a handful of passives with no firmware to worry about.

Think of it this way, nowadays low end mixed signal micros are like an OpAmp in
terms of simplicity, capability (more), usability, reliability. There are gobs of simple
transistors that cost more than some of these low end micros. Yes firmware does have
to be written, but there are some tools, like sketch, forth, basic, C......where this is so
trivial to get a basic task done its like brushing ones teeth. Virtually effortless.

In fact many jellybean parts these days have embedded sequencers, micros in effect,
that augment and control analog without any user generated firmware, you just do
not know its there.


Regards, Dana.
« Last Edit: March 10, 2017, 01:22:13 pm by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Pot controlled PWM generator
« Reply #14 on: March 10, 2017, 03:24:03 pm »
Until you try to reverse engineer or repair somebody else's design years later, or even your own project if you have lost the code you wrote. I've been bitten by both of those scenarios more than once.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19523
  • Country: gb
  • 0999
Re: Pot controlled PWM generator
« Reply #15 on: March 10, 2017, 08:29:24 pm »
You really can't get much simpler than the 555 for this application.

Agreed when you look at it as the 555 circuit by itself.   It becomes harder when you want to share the duty cycle pot for two identical circuits.
Then don't. Use the same circuit to drive multiple LEDs.
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Pot controlled PWM generator
« Reply #16 on: March 10, 2017, 10:00:37 pm »
Quote
Until you try to reverse engineer or repair somebody else's design years later, or even your own project if you have lost the code you wrote. I've been bitten by both of those scenarios more than once.

In this design maybe 10 - 20 lines of code needed.

But independent of that, analog designs, capacitor / passive types and choices, design considerations
can also bite one in the arse. Reverse engineering often a bit of a minefield no matter what its made of.
I have seen mechanical design where wrong bolt material substitution wrapped up folks in a failure.
Can't get much simpler than that.

Guess I am too much of a mixed signal processor addict.


Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Pot controlled PWM generator
« Reply #17 on: March 10, 2017, 10:14:40 pm »
Well it's a general thing, not necessarily this circuit. It's very frustrating to try to repair an old piece of equipment and then find that the bad part is a microcontroller or PLD and I have no access to the source that created it. Yes if it's something very simple I can maybe reverse engineer the purpose and come up with an approximation, but if it's a simple jellybean part like a 555 or op-amp I can simply drop in a replacement.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19523
  • Country: gb
  • 0999
Re: Pot controlled PWM generator
« Reply #18 on: March 10, 2017, 10:50:59 pm »
While it's hard to argue with that cost
Actually a programmable IC isn't cheaper in this case. I don't know why people think an MCU is always cheaper than any alternative, when it isn't necessarily the case. A 555 timer plus a dual diode and a few passive components is much cheaper than any programmable device.

If cost is a factor, then I'd recommend dropping the 555 timer and using logic gates or a Schmitt inverter, which is cheaper than the 555.

 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Pot controlled PWM generator
« Reply #19 on: March 10, 2017, 11:11:42 pm »
I dunno, you can buy microcontrollers for under $1 in single quantities, that may work out cheaper than a 555 and the required passives.

I consider both to be useful tools, the trick is to decide when it makes sense to use one over another. The uC does have the advantage that with different code you can completely alter the function of the device.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19523
  • Country: gb
  • 0999
Re: Pot controlled PWM generator
« Reply #20 on: March 10, 2017, 11:26:59 pm »
I dunno, you can buy microcontrollers for under $1 in single quantities, that may work out cheaper than a 555 and the required passives.
But it doesn't work out cheaper. $1 is very expensive for a 555 timer and the passives are cents. If you go for a logic gate IC it's cheaper still.

I had a look at my local supplier's site.

MCUs: Cheapest: £0.264
http://uk.rs-online.com/web/c/semiconductors/processors-microcontrollers/microcontrollers/#sort-by=P_breakPrice1&sort-order=asc

Timers: Cheapest 555 £0.059
http://uk.rs-online.com/web/c/semiconductors/clocks-timing-frequency-control-circuits/timer-circuits/#sort-by=P_breakPrice1&sort-order=asc

Schmitt trigger: Cheapest £0.022
http://uk.rs-online.com/web/c/semiconductors/standard-logic/schmitt-trigger-inverters/#sort-by=P_breakPrice1&sort-order=asc

One thing I have noticed is the significantly larger minimum order quantities on the cheaper parts (I suppose it's not profitable to sell small numbers of low cost items) which may offset any savings if you're only making a one off. In that case, I agree go for the MCU but if you're producing 100s then go for the 555 or logic gate solution.
« Last Edit: March 10, 2017, 11:52:04 pm by Hero999 »
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Pot controlled PWM generator
« Reply #21 on: March 11, 2017, 12:53:03 am »
It's pretty much universal that if you buy a large quantity the price is lower. Often a company like Digikey will list the same part under multiple stock numbers, one will be individual cut tape with a min order of 1, and one will be a full reel or tray with a minimum order of however many is in the package. To be fair you need to compare the same part in the same quantity.
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Pot controlled PWM generator
« Reply #22 on: March 11, 2017, 02:41:30 am »
27 cents, Digikey, low end micro, distributor price. Their franchised lines.

OEM price I know for low end high volume designs (not Microchip)
approached 11.xx cents in designs, time period 2008.

555 timer 9.5 cents, Digikey, same comments for OEM would apply.

Die size, package, process yield, test time, inventory/supply set price.

US prices.



Regards, Dana.
« Last Edit: March 11, 2017, 02:51:39 am by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline Back2VoltsTopic starter

  • Supporter
  • ****
  • Posts: 495
  • Country: us
Re: Pot controlled PWM generator
« Reply #23 on: March 11, 2017, 06:11:23 am »
You really can't get much simpler than the 555 for this application.

Agreed when you look at it as the 555 circuit by itself.   It becomes harder when you want to share the duty cycle pot for two identical circuits.
Then don't. Use the same circuit to drive multiple LEDs.

As always I do appreciate the advice.    The project is a hack of a lamp which had an original design for 8 strings of two LEDs, running with 4xAA batteries.   Converted to 2 8-LED strings  with eBay 12V to 28V booster and 20mA CCR (diode like) for each string.   It is hard to find  small, low cost, 60V boosters for single 16-LED string.   Now planning a second round with current regulation up to 150mA.   

As an aside, I am retired, doing this just for fun.    I have already played with 555s but not touched  PSoC.   It may be time for it.    I may end up stuffing the PSoC 4200 prototyping kit inside the lamp  :)    If I don't get bored with the project, I could even use CapSense for the intensity control   :)   
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19523
  • Country: gb
  • 0999
Re: Pot controlled PWM generator
« Reply #24 on: March 12, 2017, 12:16:08 am »
It's pretty much universal that if you buy a large quantity the price is lower. Often a company like Digikey will list the same part under multiple stock numbers, one will be individual cut tape with a min order of 1, and one will be a full reel or tray with a minimum order of however many is in the package. To be fair you need to compare the same part in the same quantity.
I agree, you  need to compare the same part in the same quantity. The trouble is this can be difficult to do for small volumes, because cheaper parts such as 555 timers and logic gates, tend to be difficult to buy in small quantities, where as more expensive ICs, such as MCUs, are easier to get hold of in single units.

Cheapest MCU in quantities of 100: £0.23
http://uk.rs-online.com/web/p/microcontrollers/8149184/

Cheapest 555 in quantities of 50: £0.078 each
http://uk.rs-online.com/web/p/timer-circuits/1219248/

Cheapest Schmitt trigger in quantities of 100:: £0.034
http://uk.rs-online.com/web/p/schmitt-trigger-inverters/8054349/

So if you're making 100 off, the discrete Schmitt trigger IC is lowest cost option.

If all you want is to make one, there's less of a price difference:
MCU: £0.31
http://uk.rs-online.com/web/p/microcontrollers/7153921/

555: £0.45
http://uk.rs-online.com/web/p/timer-circuits/0638942/

Schmitt trigger: £0.13
http://uk.rs-online.com/web/p/schmitt-trigger-inverters/1840629/

If you're making the one off, the Schmitt trigger is still the lowest cost option but the MCU is no longer the most expensive, replaced by the 555.
 

Offline Back2VoltsTopic starter

  • Supporter
  • ****
  • Posts: 495
  • Country: us
Re: Pot controlled PWM generator
« Reply #25 on: March 12, 2017, 03:59:50 pm »
Changing the rules...  The above price considerations go away...  I could save the cost of the pot by using  CapSense.   Small potentiometers are not cheap.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19523
  • Country: gb
  • 0999
Re: Pot controlled PWM generator
« Reply #26 on: March 12, 2017, 05:36:07 pm »
Changing the rules...  The above price considerations go away...  I could save the cost of the pot by using  CapSense.   Small potentiometers are not cheap.
Yes, capacitive sensing would be cheaper, at the expense of usability. Not everyone likes capacitive controls. A potentiometer gives a visual indication of the setting, in my opinion, is easier to use.
 

Offline Back2VoltsTopic starter

  • Supporter
  • ****
  • Posts: 495
  • Country: us
Re: Pot controlled PWM generator
« Reply #27 on: March 12, 2017, 05:58:43 pm »
Changing the rules...  The above price considerations go away...  I could save the cost of the pot by using  CapSense.   Small potentiometers are not cheap.
Yes, capacitive sensing would be cheaper, at the expense of usability. Not everyone likes capacitive controls. A potentiometer gives a visual indication of the setting, in my opinion, is easier to use.

That is a valid point.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Pot controlled PWM generator
« Reply #28 on: March 13, 2017, 12:16:24 am »
Pots are cheap if you only need a few, under a buck for something passable.

I *hate* capacitive touch controls, uhg! They never work well for me, one of the products I worked on used them and I always find myself mashing the panel repeatedly trying to get it to sense my touch.
 

Offline Back2VoltsTopic starter

  • Supporter
  • ****
  • Posts: 495
  • Country: us
Re: Pot controlled PWM generator
« Reply #29 on: March 13, 2017, 06:01:56 am »
Pots are cheap if you only need a few, under a buck for something passable.

Unfortunately more like $5 between pot and know in the size I need it

http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail&itemSeq=220496725

http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail&itemSeq=220496325

But still may be worth it for usability
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf