High frequency (50kHz) 16 bit PWM - Page 1
Forum section: electronics / beginners

author: BennoG
author_rank: Frequent Contributor
timestamp: September 21, 2024, 07:14:55 am
content: For the led light of a camera setup I want to use a pwm signal to adjust the brightness of the led'sThe shutter time of the camera is between 1 and 10 ms. It is a camera with a global shutter and no trigger input.This is to have at least 50 led flashes during the 1 ms exposure. Because of the missing trigger input the PWM signal must be on for about 50 ms.The best I can do with pars I have is 10 bits at 48 khz (50 Mhz 10 bit counter input)Are there options besides using a variable DC (DAC -> Amplifier)Benno

author: ArdWar
author_rank: Frequent Contributor
timestamp: September 21, 2024, 07:36:35 am
content: The "normal" way to do this is to current control the first 3 or 4 MSB and PWM the rest. Even then you still need 100s of MHz clock.... Do you really need that much dynamic range? Why that high of a frequency? Why 50 flashes?

author: PGPG
author_rank: Frequent Contributor
timestamp: September 21, 2024, 07:39:35 am
content: I don't understand why you need LED flashes during exposure and can't drive LED with PWM passed through low pass filter?

author: BennoG
author_rank: Frequent Contributor
timestamp: September 21, 2024, 07:58:47 am
content: Quote from: ArdWar on September 21, 2024, 07:36:35 amI can get away with the 10 bits I have now, was curious if it was possible to extend.In the really low (pwm 1-5) the steps are very noticable. (even 10 or 20 % per step)Quote from: ArdWar on September 21, 2024, 07:36:35 amI 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.

author: BennoG
author_rank: Frequent Contributor
timestamp: September 21, 2024, 08:05:10 am
content: Quote from: PGPG on September 21, 2024, 07:39:35 amBecause I get a signal from the PLC and need to capture 2 images in fast sequence, with 2 different brightnesses.So at the moment I set the PWM value that will change in 1/50000 of a second after the command. And then start the camera trigger by software. Between setting the PWM value and the CCD exposure starting is about 1 ms or even shorter (and probably not constant, the trigger is send over USB)So the time is too short for LP filter to settle at a constant value during the exposure.P.S. I can get away with the 10 bits I have now. Always on the lookout for a better solution.

author: PGPG
author_rank: Frequent Contributor
timestamp: September 21, 2024, 08:33:13 am
content: I understand that having 50 pulses in exposure time and being not synchronized you have to assume 1 pulse error so 2%.You set PWM with 0.1% accuracy (10 bit) and you are trying to improve it to get 0.0015% accuracy (16 bit) and then use this light with 2% accuracy. Did I missed something?

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 21, 2024, 08:34:52 am
content: Did you do any calculations on this?50kHz carrier with 16 bit PWM resolution based on a timer needs a clock frequency of 65536 * 50000 = 3276800000Hz. That is 3.2768 GHz. Even for a FPGA not an easy thing to handle.Quote from: BennoG on September 21, 2024, 07:58:47 amIs this not due to properties of the LED's and might not improve with a higher resolution of the PWM granularity.

author: BennoG
author_rank: Frequent Contributor
timestamp: September 21, 2024, 08:42:18 am
content: Quote from: PGPG on September 21, 2024, 08:33:13 amYes at really low intensities (PWM value between 1 and 10) you get noticeable steps due to the nonlinearity of our perception of brightness.For the higher brightness this is accurate enough. (At the moment I do not need the lower PWM values, lowest in use now is 20 out of 1024). It is more to know there is a good solution when I need lower light values.Benno

author: tggzzz
author_rank: Super Contributor
timestamp: September 21, 2024, 09:17:49 am
content: If they are white LEDs intended for illumination, you may find the phosphor decay characteristics are important and work in your favour (for once!). Use a reverse biassed PIN diode, and observe the decay characteristics on a scope.PWM can be done naively and cleverly. MCU PWM outputs are naive. It may be worth you understandingdelta-sigma DACsripple cancellationhttps://www.edn.com/cancel-pwm-dac-ripple-with-analog-subtraction-revisited/But unless you need computer control, it is probably simplest to just use a PSU to set the current.

author: BennoG
author_rank: Frequent Contributor
timestamp: September 21, 2024, 09:54:36 am
content: Quote from: tggzzz on September 21, 2024, 09:17:49 amThat is the problem the PC needs to set the brightness and it should be stable within 1 ms.

author: tggzzz
author_rank: Super Contributor
timestamp: September 21, 2024, 11:02:12 am
content: Quote from: BennoG on September 21, 2024, 09:54:36 amApparently you only need two brightnesses, but to switch between them.Have two slow speed DACs each controlling separate "DC" currents. Use a fast digital signal to divert the currents into either the LEDs or a different load.Consider a long-tailed pair with the DAC controlling the emitter "tail" current. One collector would have the LEDs as a load, the differential signal on the base would direct the emitter current through one or other of the collectors.In this diagram one collector resistor would be replaced by the LEDs. Ignore the marked voltage "outputs"; your output is the current into the LEDThe current would be switched orders of magnitude faster than 1ms, so the LED response would dominate the timing.

author: tooki
author_rank: Super Contributor
timestamp: September 21, 2024, 11:11:46 am
content: Quote from: BennoG on September 21, 2024, 08:05:10 amYou could divide the LEDs into two or more banks that you can control independently, adding another level of brightness control without needing more bits of PWM. (For example, alternate every LED between 2 banks, so that for lower brightnesses, you just disable one bank.)Another thing you could consider is not using PWM, but some other encoding like PDM (pulse density modulation, which is almost the same thing as delta-sigma modulation). This would reduce the brightness error by spreading out the pulses within a 16-bit value.It also seems to me you could use a DAC to control a constant-current LED driver. Modern audio DACs, for example, are often 24-bit at 48, 96, and 192kHz, more than enough. The question I don’t know off the top of my head is how long the latency is.

author: MasterT
author_rank: Frequent Contributor
timestamp: September 21, 2024, 01:10:25 pm
content: stmH7, stmG4 have HRTIM. G4 equivalent clock is >4 GHz, so 16-bits at 83 kHz PWM.Nucleo-G474re is at mouser about $23 CAD.

author: BennoG
author_rank: Frequent Contributor
timestamp: September 21, 2024, 01:36:57 pm
content: that looks interesting. Will have a look at this when i have some spare time.

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 21, 2024, 02:48:08 pm
content: Quote from: MasterT on September 21, 2024, 01:10:25 pmThis HRTIM is also mentioned in thisthreadbut it comes with a lot of constraints, and is not a true high speed clock, but something with delay lines, so read the manual carefully before you decide to buy. A G474 board from weactstudio is ~7 euro on Aliexpress.

author: BennoG
author_rank: Frequent Contributor
timestamp: September 21, 2024, 03:44:44 pm
content: Quote from: tooki on September 21, 2024, 11:11:46 amThat would limit the flexibility of the device I want it to be. At the moment it is 2 recording with vastly different lightning settings.My experience is that if you develop something with limits you will run into them at a later moment when you want to reuse the same device then find it can not meet the requirements forcing you to do the same thing again.This post is for me a investigation if there are other possibilities using a microcontroller and a Fast Mosfet driver to drive the switching mosfet.This is to make the device as flexible as possible so it can be reused

author: tggzzz
author_rank: Super Contributor
timestamp: September 21, 2024, 04:37:00 pm
content: Quote from: BennoG on September 21, 2024, 03:44:44 pmYes there is at least one; see my earlier post.No fast MOSFETs needed. Only low-speed DACs/current sources, and ordinary BJTs operating in a mode that is known for its excellent high frequency performance. Turning the LEDs on/off only requires a <1V swing.Plus, since the current is constant (it goes through either one or the other BJT), there is minimal EMI/EMC. That's relevant if the LED current is high (you don't state the current).

author: DavidAlfa
author_rank: Super Contributor
timestamp: September 21, 2024, 04:58:09 pm
content: Why not use constant current control?I think it would be way easier, using a dac or digital interface to adjust the CC controller.Though 16 bit resolution seems overkill, I don't think you need so much fine control for lighting?

author: radiolistener
author_rank: Super Contributor
timestamp: September 21, 2024, 05:12:04 pm
content: 50 kHz PWM is very low frequency, not high.

author: langwadt
author_rank: Super Contributor
timestamp: September 21, 2024, 05:33:07 pm
content: Quote from: radiolistener on September 21, 2024, 05:12:04 pmit is if you want 16 bit resolution at the same time ...

author: DavidAlfa
author_rank: Super Contributor
timestamp: September 21, 2024, 06:18:06 pm
content: Yep, would need a crazy 3.2GHz base clock (50KHz * 65536 steps)

author: radiolistener
author_rank: Super Contributor
timestamp: September 21, 2024, 07:27:44 pm
content: Using 1-st order 1-bit Delta-Sigma Modulator you can get 16 bit with oversample 2048x. For 48 kHz sample rate it needs 98.304 MHz clock.Using 1-st order 4-bit Delta-Sigma Modulator you can get 16 bit with oversample 512x. For 48 kHz sample rate it needs 24.576 MHz clock.Using 2-nd order 1-bit Delta-Sigma Modulator you can get 16 bit with oversample 128x. For 48 kHz sample rate it needs 6.104 MHz clock.Using 2-nd order 4-bit Delta-Sigma Modulator you can get 16 bit with oversample 64x. For 48 kHz sample rate it needs 3.072 MHz clock.But 2-nd order DSM is unstable and can produce artifacts.Its better to use DSM with 4-bit DAC.

author: tooki
author_rank: Super Contributor
timestamp: September 24, 2024, 04:39:47 pm
content: Quote from: radiolistener on September 21, 2024, 05:12:04 pmNo it isn’t. You’ve clearly not noticed the many threads where people think an Arduino’s 490Hz default PWM is more than enough, because they remember that 60Hz is enough for moving images.As someone who is sensitive to slow PWM flicker, it always bugs me when people want to use anything below around 3KHz.Note that the PWM frequency isn’t the clock frequency used to generate the PWM. That is the PWM frequency multiplied by the number of bits.

author: MasterT
author_rank: Frequent Contributor
timestamp: September 24, 2024, 04:47:04 pm
content: Quote from: radiolistener on September 21, 2024, 07:27:44 pmTotaly agree. Have you mind to show a circuits/ schematics? Have you ever build DSM, or know somenone who did?Otherways copy/ paste wikipedia quatation is not really helpfull.

author: mtwieg
author_rank: Frequent Contributor
timestamp: September 25, 2024, 12:16:58 pm
content: Quote from: BennoG on September 21, 2024, 07:58:47 amI don't know much about photography and modern cameras, but is variation in luminous output within the exposure not a concern?Anyways, if all you need is high precision (as opposed to high accuracy), then I would suggest looking at using a microcontroller with special high precision pwm. C2000, STM32, and Kinetis V MCUs have such special peripherals (need to be careful though, not all devices have them). Though using these peripherals is generally far more complicated than your basic pwm on an arduino. The Nucleo board suggested by MasterT above may be a good start, hopefully they offer a good example project for setting up the HRTIM.

author: LinuxHata
author_rank: Frequent Contributor
timestamp: September 25, 2024, 12:46:20 pm
content: LT8500 by linear provides exactly what you need - very precise PWM control for LEDs.

author: BennoG
author_rank: Frequent Contributor
timestamp: September 25, 2024, 12:47:20 pm
content: Already ordered a Nucleo board capable of HRTIM, now find some time to experiment with it.Benno

author: BennoG
author_rank: Frequent Contributor
timestamp: September 25, 2024, 01:09:18 pm
content: Quote from: LinuxHata on September 25, 2024, 12:46:20 pmCan 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 taskBenno

author: ebastler
author_rank: Super Contributor
timestamp: September 25, 2024, 01:38:43 pm
content: Quote from: BennoG on September 21, 2024, 07:58:47 amCan it be asingleLED 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?

author: DavidAlfa
author_rank: Super Contributor
timestamp: September 25, 2024, 01:56:48 pm
content: 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.

author: BennoG
author_rank: Frequent Contributor
timestamp: September 25, 2024, 02:31:06 pm
content: Quote from: ebastler on September 25, 2024, 01:38:43 pmThan 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)

author: BennoG
author_rank: Frequent Contributor
timestamp: September 25, 2024, 02:35:36 pm
content: Quote from: DavidAlfa on September 25, 2024, 01:56:48 pmO 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.

author: ebastler
author_rank: Super Contributor
timestamp: September 25, 2024, 02:38:22 pm
content: Quote from: BennoG on September 25, 2024, 02:31:06 pmNot 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?

author: Siwastaja
author_rank: Super Contributor
timestamp: September 25, 2024, 04:23:13 pm
content: Quote from: pcprogrammer on September 21, 2024, 02:48:08 pmYeah, 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.

author: tooki
author_rank: Super Contributor
timestamp: September 25, 2024, 06:22:10 pm
content: Quote from: ebastler on September 25, 2024, 02:38:22 pmIndeed, this is precisely how modern camera flashes control flash power: altering the length of the xenon tube discharge.

author: LinuxHata
author_rank: Frequent Contributor
timestamp: September 26, 2024, 04:16:45 am
content: Well, if LT8500 is no match, then something like MBI5026 or other multiplexed led display drivers should work.

author: radiolistener
author_rank: Super Contributor
timestamp: September 27, 2024, 02:02:23 pm
content: Quote from: MasterT on September 24, 2024, 04:47:04 pmWell, I wrote a small and simple N-bit 1-st order DSM DAC model in Octave for you:Code:pkg load signal;% ParametersFs = 8000; % Sampling frequency of input signalBITS = 5; % Input signal resolution in bitsFsig = 1000; % Frequency of the input signal (1 kHz)OSR = 32; % Over Sample Ratio for DSMN = 1; % N-bit DSM% Derived parametersTs = 1 / Fs; % Sampling periodFosr = Fs * OSR; % Oversampled frequencyTosr = 1 / Fosr; % Oversampled period% Time vectors for input and oversampled signalst = 0:Ts:2/Fsig; % 2 periods of the input signalt_osr = 0:Tosr:2/Fsig; % Oversampled time vector for 2 periods% n-level quantizerfunction quantized_output = quantize(signal, range, n)min = range(1);max = range(2);scale = max-min;% Scale from [min, max] to [0, 1]normalized_signal = (signal - min) / scale;% quantize [0, 1] for n levelsquantized_output = round(normalized_signal * (n - 1)) / (n - 1);% Scale back from [0, 1] to [min, max]quantized_output = quantized_output * scale + min;end% Generate input sine wave (5-bit resolution)input_signal = sin(2 * pi * Fsig * t);% Quantize input signal according to AES17 standard (zero-symmetric)input_signal_quantized = quantize(input_signal, [-1, 1], 2^BITS - 1);% Delta-Sigma Modulator (First-order)error = 0;output_dsm = zeros(1, length(t_osr));for i = 1:length(t_osr)current_input = interp1(t, input_signal_quantized, t_osr(i), 'linear', 'extrap');signal = current_input - error;quantized_output = quantize(signal, [-1, +1], 2^N);error = quantized_output - signal;output_dsm(i) = quantized_output;end% Low-pass filter to reconstruct the analog output% Use 4th order Butterworth filter with cutoff at 1/OSR[b, a] = butter(4, 1 / OSR);output_filtered = filter(b, a, output_dsm);% Scale the filtered output to match the input signal amplitudeoutput_filtered = output_filtered * max(input_signal_quantized) / max(output_filtered);% Plot resultsfigure;hold on;grid on;plot(t_osr(1:length(output_dsm)), output_dsm, 'r', 'LineWidth', 1, 'DisplayName', 'DSM Output');plot(t, input_signal_quantized, 'b', 'LineWidth', 3, 'DisplayName', 'Input Signal');plot(t_osr(1:length(output_filtered)), output_filtered, 'g', 'LineWidth', 1.5, 'DisplayName', 'Filtered Output (DAC)');ylim([-1.05, 1.05]);legend('show');xlabel('Time (s)');ylabel('Amplitude');title(sprintf('Delta-Sigma Modulator DAC, N=%d, OSR=%d', N, OSR));hold off;You can play with it and see how quantizer resolution (N) and oversampling ratio (OSR) affects 1-st order DSM DAC output quality.The blue trace is input signal.The red trace is N-bit output of DSM.The green trace is a filtered result, it has some phase shift due to filter delay.Here is example in attachment for 1 kHz sine at 8 kHz sample rate converted with 1-bit DSM DAC and with 4-bit DSM DAC, with using 32x oversampling.As you can see, using 4-bit DSM is much better than 1-bit DSM.

author: MasterT
author_rank: Frequent Contributor
timestamp: September 27, 2024, 02:54:51 pm
content: I ask for "a circuits/ schematics".Octave, Python, LTSpice, MathLab etc. are all in my "parasite" list.I invented "multi-bit" SD technology, and know pretty well how intelectual property theft network is operating.

author: radiolistener
author_rank: Super Contributor
timestamp: September 27, 2024, 03:00:32 pm
content: Quote from: MasterT on September 27, 2024, 02:54:51 pmAs you can see, I haven’t used any MATLAB Designer tools or graphical components.The entire code is contained within a compact script, making it easy to implement in either software or hardware.I just used MATLAB language to describe the concept, as C++ would be less visually intuitive for this purpose. It is designed to support Octave which is a free tool, so you can use it on Linux/Windows/MacOS.It's not hard to write it in verilog, upload to FPGA and run on real hardware. I tried it and it works.Quote from: MasterT on September 27, 2024, 02:54:51 pmWhen you mention that you invented 'multi-bit' SD technology, could you clarify whether you are referring to your contributions in the context of advancements similar to those made by Jan Van der Spiegel, who is known for his work in this area?I would be interested to hear more about your specific innovations in this field.

author: BrianHG
author_rank: Super Contributor
timestamp: September 27, 2024, 04:13:56 pm
content: Quote from: pcprogrammer on September 21, 2024, 08:34:52 amThe FPGA part isn't hard. All you need is any bottom end FPGA with a 3.2768 Gbps serial transmitter. (Basically overclocking any Xilinx part which can do 3.2500gbps, well within range, or get a 6gbps LVDS transmitter capable part.)The real problem is converting that tiny almost 1v differential output to a meaningful analog signal retaining the full fidelity. Just amplifying it to a true over 3GHz switch with enough slew rate to hit your chosen rails and an analog reconstruction filter to properly discern that tiny single 305ps pulse when the DAC code is a 1 vs a 0. That is the true nightmare.

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 27, 2024, 05:42:49 pm
content: Quote from: BrianHG on September 27, 2024, 04:13:56 pmAh, that is a clever trick. You just have to load the shift register with the correct data so many bits at a time reducing the clock of the rest of the logic.I was thinking in the more traditional counter setup with a compare function.Quote from: BrianHG on September 27, 2024, 04:13:56 pmI can see that being a big problem indeed. To be able to use the full range of 1 on over 65534 off up to 65534 on over 1 off you need to preserve the full > 3GHz bandwidth. Transition any slower and you loose on resolution you wanted to have in the first place.

author: BrianHG
author_rank: Super Contributor
timestamp: September 27, 2024, 10:24:14 pm
content: Quote from: pcprogrammer on September 27, 2024, 05:42:49 pmUsing a 16:1 transmitter, you still are creating a 1/16th counter and compare function, it's just the bottom 4 bits which serve as a remainder, deciding how many low or high on the specific transition transmission 16bit byte.

author: BrianHG
author_rank: Super Contributor
timestamp: September 27, 2024, 11:27:41 pm
content: Through some clever trickery, I've managed to get the cheapest slowest Altera Cyclone IV and Max10 FPGAs to output 1gbps on their software LVDS regular IOs at 3.3v. Though, I also found a 1$ 4 channel 3GHz capable LVDS to 3.3v TMDS amp as well.I guess it is just about good enough for 60khz at 14 bit. With some dithering, maybe you can gain a pseudo 2 bits.

author: BennoG
author_rank: Frequent Contributor
timestamp: September 28, 2024, 07:11:03 am
content: So fare everything except for the fpga option is not a real solution to my problem. (the big steps in the low brightness of the led say 0 - 20 from the 1024 steps)A simple solution I just tought of is use 2 PWM output 1 for normal use and the 2nd with a resistor of 1k - 20k to get the brightness of 25 at the first PWM when the 2nd PWM is set to 100%So for 2.5 - 100% use the first pwm output without resistorand For 0.1 to 2.5% use the 2nd PWM with resistor. Now I find myself stupid because I did not think of this before.Benno

author: mikerj
author_rank: Super Contributor
timestamp: September 28, 2024, 07:35:12 am
content: Quote from: BennoG on September 28, 2024, 07:11:03 amYou didn't respond to ebastler's suggestion of running the LED at full power and varying the on time during the exposure period. This would be far simpler to implement than super high frequency PWM and would allow you to control the average illumination during an exposure, is there a reason this wouldn't work?

author: BennoG
author_rank: Frequent Contributor
timestamp: September 28, 2024, 09:46:28 am
content: Quote from: mikerj on September 28, 2024, 07:35:12 amThis is because I have no direct control over when the exposure starts. So it is a bit of russian roulette if the single pulse is during exposure. The camera has now hardware trigger input and both camera and pwm are controlled over USB from a linux running IPC.I have a other PCB for the more expensive systems where you have a hardware input for the trigger and global shutter there I use what you suggest by adjusting the ON time of the led.Because the problem for this project is make it as cheap as possible.Benno

author: tooki
author_rank: Super Contributor
timestamp: September 28, 2024, 10:14:51 am
content: Quote from: BennoG on September 28, 2024, 07:11:03 amYou didn't respond to themultiplesolutions I mentioned above.

author: mtwieg
author_rank: Frequent Contributor
timestamp: September 28, 2024, 12:50:25 pm
content: Quote from: BennoG on September 28, 2024, 09:46:28 amSo you're saying the camera has no sync/trigger functionality, either input or output? That's very surprising, I assumed all modern cameras had at least sync output capability (though it might be wireless in more modern cameras).

author: BennoG
author_rank: Frequent Contributor
timestamp: September 28, 2024, 01:33:33 pm
content: Quote from: mtwieg on September 28, 2024, 12:50:25 pmAfter your message I went looking at the camera documentation, and the camera has a trigger input (directly connected to the FPGA)And on a tiny header on the back of the board.So the reason I assumed it had nog trigger input, was I assumed the connector was the jtag programming connector.https://www.baslerweb.com/en/shop/daa3840-45uc-s-mount/The connector is that small and with direct lines to the FPGA I don't think it is wise to connect that to the PWM controlling board.Benno

author: langwadt
author_rank: Super Contributor
timestamp: September 28, 2024, 02:08:01 pm
content: Quote from: BennoG on September 28, 2024, 01:33:33 pmit has some protection and there's a supply so you could easily add an optocoupler to make it isolated

author: tooki
author_rank: Super Contributor
timestamp: September 28, 2024, 03:25:22 pm
content: Quote from: BennoG on September 28, 2024, 01:33:33 pmYou know what they say about assumptions: when you assume, youmake anassout ofuandmewaste everyone's time, including your own!

author: BennoG
author_rank: Frequent Contributor
timestamp: September 28, 2024, 04:26:39 pm
content: Quote from: tooki on September 28, 2024, 03:25:22 pmStill going for the PWM option because it is not as irritating as a full brightness flash. It is now a slight glow for the moment.And the first proto did not even use light so remote triggering was not needed.

author: KrudyZ
author_rank: Frequent Contributor
timestamp: September 28, 2024, 04:26:51 pm
content: Quote from: BennoG on September 21, 2024, 07:58:47 amSo you are OK with 2% variations, but want 16 bit resolution?This doesn't make much sense.Your problem is one of aliasing, not resolution. Your sample window is defined by the exposure time and the thing you are sampling is your LED drive waveform.One way to make your life easier is to use pulse density modulation rather than pulse width modulation. You should be able to get to unnoticeable brightness variations in your images with much lower clock rates than what would be required for PWM.

author: BennoG
author_rank: Frequent Contributor
timestamp: September 28, 2024, 04:30:39 pm
content: Quote from: KrudyZ on September 28, 2024, 04:26:51 pmThe problem is the bottom 2.5% of the dimming. And the big steps when below 1%, but as mentioned above the solution is simple use 2 PWM output 1 with and 1 without a resistor, and use the one with resistor for the 0-2.5% rangen and the one without resistor for the 2.5-100% range (if needed, so for now not needed)

author: mtwieg
author_rank: Frequent Contributor
timestamp: September 28, 2024, 07:59:17 pm
content: Quote from: BennoG on September 28, 2024, 01:33:33 pmAll this time I was assuming this was a typical point-and-shoot camera...Glancing at the documentation is seems like those GPIO pins can be configured either as inputs to trigger the shutter, or as outputs triggered by the shutter/flash. It should be perfect for your needs.