Author Topic: High frequency (50kHz) 16 bit PWM  (Read 1440 times)

0 Members and 2 Guests are viewing this topic.

Online LinuxHata

  • Frequent Contributor
  • **
  • Posts: 379
  • Country: us
Re: High frequency (50kHz) 16 bit PWM
« Reply #25 on: September 25, 2024, 12:46:20 pm »
LT8500 by linear provides exactly what you need - very precise PWM control for LEDs.
 

Offline BennoGTopic starter

  • Regular Contributor
  • *
  • Posts: 158
  • Country: nl
Re: High frequency (50kHz) 16 bit PWM
« Reply #26 on: September 25, 2024, 12:47:20 pm »
Already ordered a Nucleo board capable of HRTIM, now find some time to experiment with it.

Benno
 

Offline BennoGTopic starter

  • Regular Contributor
  • *
  • Posts: 158
  • Country: nl
Re: High frequency (50kHz) 16 bit PWM
« Reply #27 on: September 25, 2024, 01:09:18 pm »
LT8500 by linear provides exactly what you need - very precise PWM control for LEDs.

Can only do 6.1 kHz and not more at 12 bits. So no not by a long shot.

I did not say it was a easy task  :)

Benno
« Last Edit: September 25, 2024, 01:11:24 pm by BennoG »
 

Offline ebastler

  • Super Contributor
  • ***
  • Posts: 6921
  • Country: de
Re: High frequency (50kHz) 16 bit PWM
« Reply #28 on: September 25, 2024, 01:38:43 pm »
I don't have exact control over when the camera shutter starts and stops. So if I have at least 50 flashes during the 1 ms exposure I chan have max variation of 2% in brightness of the image. Between the individual camera captures.

Can it be a single LED flash per exposure? If you know "roughly" when the shutter opens, turn the LED full-on a bit after that and leave it on for as long as you need to get the right amount of light?
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6207
  • Country: es
Re: High frequency (50kHz) 16 bit PWM
« Reply #29 on: September 25, 2024, 01:56:48 pm »
A shot is a cumulative process, the total light captured during the frame time is what makes the final image, so in theory you could use lower pwm resolution, and create a pattern or sequence varying the duty cycle.

In a very simplified example, let's say you have 5 and 10% but you want 7%,  alternating the pwm outputs 50% of the time will make it.
« Last Edit: September 25, 2024, 01:58:32 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: BennoG

Offline BennoGTopic starter

  • Regular Contributor
  • *
  • Posts: 158
  • Country: nl
Re: High frequency (50kHz) 16 bit PWM
« Reply #30 on: September 25, 2024, 02:31:06 pm »
I don't have exact control over when the camera shutter starts and stops. So if I have at least 50 flashes during the 1 ms exposure I chan have max variation of 2% in brightness of the image. Between the individual camera captures.
Can it be a single LED flash per exposure? If you know "roughly" when the shutter opens, turn the LED full-on a bit after that and leave it on for as long as you need to get the right amount of light?
Than you need a DAC to control the brightness of the LED and if you need some power then you have a settle time of at least 10ms.
The camera exposure starts usually about 0.5 - 1.5 ms after setting the brightness. Waiting for the settling is not an option because we have only about 250 ms to make 4 images of 4 different brightness values. (and also process the 4 images within that 250 ms)

 

Offline BennoGTopic starter

  • Regular Contributor
  • *
  • Posts: 158
  • Country: nl
Re: High frequency (50kHz) 16 bit PWM
« Reply #31 on: September 25, 2024, 02:35:36 pm »
A shot is a cumulative process, the total light captured during the frame time is what makes the final image, so in theory you could use lower pwm resolution, and create a pattern or sequence varying the duty cycle.

In a very simplified example, let's say you have 5 and 10% but you want 7%,  alternating the pwm outputs 50% of the time will make it.
O that is something that I can do in the UC that is generating the PWM, this is only needed for 0.1% to 2% of the pwm range because only in the very dimmed state you have clear steps in brightness.
 

Offline ebastler

  • Super Contributor
  • ***
  • Posts: 6921
  • Country: de
Re: High frequency (50kHz) 16 bit PWM
« Reply #32 on: September 25, 2024, 02:38:22 pm »
Can it be a single LED flash per exposure? If you know "roughly" when the shutter opens, turn the LED full-on a bit after that and leave it on for as long as you need to get the right amount of light?

Than you need a DAC to control the brightness of the LED and if you need some power then you have a settle time of at least 10ms.
The camera exposure starts usually about 0.5 - 1.5 ms after setting the brightness. Waiting for the settling is not an option because we have only about 250 ms to make 4 images of 4 different brightness values. (and also process the 4 images within that 250 ms)

Not sure whether I made myself clear. I meant to run the LED at full brightness and just vary the LED on-time. No DAC needed. (That's assuming that you can live with variations of the effective exposure time, which will no longer be 1 ms always but shorter in situations where you want less light.)

More out of curiosity, but also to make sure I understand the challenges: Where does that 10 ms settling time come from? Why can the LED settle to a new intensity level faster when driven by PWM than when driven by a DAC?
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8724
  • Country: fi
Re: High frequency (50kHz) 16 bit PWM
« Reply #33 on: September 25, 2024, 04:23:13 pm »
This HRTIM is also mentioned in this thread but it comes with a lot of constraints, and is not a true high speed clock, but something with delay lines,

Yeah, but on the other hand this specific case would be exactly what the designers had in mind: high resolution PWM, so I would expect this is a very easy job with STM32F334 or the friends. Just be careful that some values close to min and max duty are illegal, in other words you can't output 1/65536 with HRTIM but you can output 16, 17, or 18/65536 just fine.

Then again, I also question the idea that 16bit accuracy on PWM is needed and then frame-by-frame variation depending on how the shutter and PWM happen to coincide is 1/50 or roughly 6 bits.

PWM is probably inaccurate anyway, what are you going to do with the PWM, control the LEDs from a voltage source using some MOSFET? Then the brighness will vary based on voltage and temperature variations. Constant current circuit is really needed, and then you could just adjust that current setpoint.

If both accurate amount of photons with short exposure (i.e., uniformity of light), and quick setpoint changes are needed, then maybe design two filtered constant current drivers and a quick switch between them. You can basically short-circuit the unused constant current driver while the other is connected to LEDs.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 12496
  • Country: ch
Re: High frequency (50kHz) 16 bit PWM
« Reply #34 on: September 25, 2024, 06:22:10 pm »
Can it be a single LED flash per exposure? If you know "roughly" when the shutter opens, turn the LED full-on a bit after that and leave it on for as long as you need to get the right amount of light?

Than you need a DAC to control the brightness of the LED and if you need some power then you have a settle time of at least 10ms.
The camera exposure starts usually about 0.5 - 1.5 ms after setting the brightness. Waiting for the settling is not an option because we have only about 250 ms to make 4 images of 4 different brightness values. (and also process the 4 images within that 250 ms)

Not sure whether I made myself clear. I meant to run the LED at full brightness and just vary the LED on-time. No DAC needed. (That's assuming that you can live with variations of the effective exposure time, which will no longer be 1 ms always but shorter in situations where you want less light.)
Indeed, this is precisely how modern camera flashes control flash power: altering the length of the xenon tube discharge.
 

Online LinuxHata

  • Frequent Contributor
  • **
  • Posts: 379
  • Country: us
Re: High frequency (50kHz) 16 bit PWM
« Reply #35 on: Yesterday at 04:16:45 am »
Well, if LT8500 is no match, then something like MBI5026 or other multiplexed led display drivers should work.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf