Electronic – Display a rotating vector on four LEDs

displayledpwm

Asked here because EE's are familiar with concepts of rotating vectors…
Have as input inside a microcontroller, two signed numbers which correspond to rectangular coordinates. These numbers are related as the two rectangular components: a real and imaginary similar to R + jI.

4-LED display of 360 degree circleIntend to have as output a display on four similar LEDs which would be interpreted by eye to indicate a vector angle…similar to atan2(real,imaginary). Light intensity will be done via Pulse-width-modulation (PWM). For example an input of (140,0) would light up LED 00 fully, while the other three would be off. An input of (38,0) would display similar full brightness on LED 00, since the display is for angle, not amplitude.
Symmetry reduces the full circle into eight similar segments. It is obvious that at 0, 90, 180 and 270 degrees, only one-of-four LEDs should be fully lit with 100% PWM. And at 45, 135,225,315 degrees, two adjacent LEDs should be partially lit an equal amount.
But lit how much? relative to full 100% PWM.
Should it be 50%/50%? Should it be \$ \frac{100}{\sqrt{2}} \$%/\$\frac{100}{\sqrt{2}} \$%?
Probing into intensity perception of human eye presents a morass of scenarios, each of which has a different non-linear transfer function between input and perceived brightness. It is unclear to me which scenario applies here.

Display update rates will be close to, or just past persistence-of-vision, in the 20-40 Hz area. Background would be darker than LEDs, and LEDs would be observed directly.
Edit – added goals:
I hope to discern whether a vector rotates clockwise vs counterclockwise – it will be rotating quite slowly (period of one second or far more), but in a potentially noisy environment (phase noise). At some point, a PLL will be applied, and the vector should settle near LED00. This PLL will have a l-o-n-g time constant. I would be happy to be able to tell if it is locked in the presence of noise.

At angles of 0,90,180,270 degrees, PWM would be 100% for one-of-four LEDs.

At angles 45,135,225,315, PWM for two-of-four adjacent LEDs should be ???, considering the crazy erratic intensity perception of human eyes? Once nailed, I can probably work out a sane transition for intermediate angles (0-45 degrees).

Best Answer

Well, you've got the core thing correct:

Perception is non-linear. For \$n\cdot 90° + 45°,\,n\in\mathbb N\$, yes, the brightness of the adjacent LEDs should be identical, but that's about it.

Yes, we generally model perceived brightness to be logarithmic to irradiation. That doesn't mean the base of that logarithm is known for any color, for any human.

It also isn't clear that at the very low end of your PWM duty cycle, this will really be a sufficient model; so, I'm afraid, you'll have to do some characterization yourself, if you want to do this "properly".

Luckily, I think that if you're aiming for direction visualization with four LEDs of which you at most use 2 at the same time, you won't lose much "perceived accuracy" if you just try out one or two exponents, and settle for one that you deem "good enough". No magic involved, just try it out.