[sdiy] Pots vs Encoders, was Re: [sdiy] dave smith *instruments*
Tom Wiltshire
tom at electricdruid.net
Thu Feb 4 12:12:51 CET 2010
Although I *was* suggesting using PWM to control the LED brightness,
I wasn't thinking of using a PWM module to do it.
Since PWM is a digital technique, you only need a digital output to
do it. If we've already got a controller which is controlling our LED
ring with just on and off signals, we've got all the hardware we
need. After that, it's just a question of speed, and having some
things switched on for longer than others.
The eye responds slow enough that above 50-100Hz this is perceived as
varying brightness.
So assume a 200Hz refresh rate (or perhaps the 500Hz that Antti was
scanning the encoder at) and let's say 16 levels for each LED.
200x16 = 3200Hz, 500x16 = 8KHz.
So if we update the LED status at >3KHz, we can have 16 levels of
brightness for each LED. And then we read the encoder on every 16th
loop.
T.
PS: Damian, I don't see why the light would speed up and slow down.
If the brightness levels are linear, so the movement will be too. It
takes 16 steps to move from position 0 to position 1, then 16 more to
move from 1 to 2, etc. That's linear.
On 4 Feb 2010, at 00:51, cheater cheater wrote:
> Amos,
> you can get away with one pwm per led ring. 0 means the 'lower' led, 1
> means the 'higher' led. Then you'd need some way of switching which
> leds are being addressed. But once you have this in place you would
> notice that when you arrive at the second led, i.e. the pwm signal is
> all 1's, then you'd have to synchronize the switch of which led is
> addressed by a 0, with changing the pwm to constant 0. So maybe an
> even better idea would be to start out on the first led and assign 0
> to it, and assign 1 to the second led, then slowly rise the pulse
> width value towards the signal being constant 1. Once this happens,
> switch the led addressed by the value 0 to the third led. This way
> every second led is only ever addressed by value 0, and every second
> by the value 1. This is a big improvement from the 'trivial' way I
> described in the beginning which required each value to address each
> diode (except for the first and last diode). This means that for 32
> leds, 16 of them would have to be addressed from the 0 and 16 from the
> 1, they are switched around separately, which would allow you to keep
> the complexity down to a similar level as with just switching around
> one lit diode across all 32 possible places. This would be, I think, a
> good idea.
>
> HTH
> D.
>
> On Thu, Feb 4, 2010 at 01:34, Amos <controlvoltage at gmail.com> wrote:
>> Very interesting idea! You could do the "interpolation" idea with no
>> extra hardware requirements. The brightness idea is interesting
>> also,
>> but you'd need to be creative... 15 pwm channels (one for each LED in
>> a ring) just for feedback from one pot, would be a bit extravagant.
>> :-)
>>
>> You could use one PWM for the whole ring assuming you still only have
>> one LED lit at a time... But what would brightness mean in this
>> context? It would make more sense to have a dim LED next to a bright
>> one, but the you're back into a more hardware-intensive situation.
>>
>> Excellent food for thought...
>>
>> -Amos
>>
>> On 2/3/10, Tom Wiltshire <tom at electricdruid.net> wrote:
>>> If you used PWM to control the brightness of the LEDs, the 'extra'
>>> resolution would be the resolution of the PWM - 8 or 10 bit is
>>> easily
>>> possible.
>>>
>>> You wouldn't be able to tell much beyond 16 or 32 levels though, I'd
>>> have thought. The effect would just get smoother looking. Still,
>>> it's
>>> a good idea.
>>>
>>> T.
>>>
>>>
>>> On 3 Feb 2010, at 23:39, cheater cheater wrote:
>>>
>>>> I wonder what is actually the maximum bit depth available with this
>>>> sort of approach. Anyone know what the accuracy improvement with
>>>> this
>>>> sort of... hmm.. how do we call this? Anti-aliasing? Interpolation?
>>>>
>>>> D.
>>>>
>>>> On Wed, Feb 3, 2010 at 21:26, Ingo Debus <igg.debus at t-online.de>
>>>> wrote:
>>>>>
>>>>> Am 02.02.2010 um 15:22 schrieb Tom Wiltshire:
>>>>>
>>>>>> you typically get 15 or 31 LEDs around the ring, which is 5-bit
>>>>>> accuracy
>>>>>> at best
>>>>>
>>>>> Only if you allow only one LED lit at a time. If you allow one or
>>>>> two lit
>>>>> (one = spot on, two = value is in between) you get almost twice
>>>>> the
>>>>> resolution. If you can control the LEDs' brightness you can get
>>>>> even more.
>>>>>
>>>>> Ingo
>>>>> _______________________________________________
>>>>> Synth-diy mailing list
>>>>> Synth-diy at dropmix.xs4all.nl
>>>>> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>>>>>
>>>>
>>>> _______________________________________________
>>>> Synth-diy mailing list
>>>> Synth-diy at dropmix.xs4all.nl
>>>> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>>>
>>> _______________________________________________
>>> Synth-diy mailing list
>>> Synth-diy at dropmix.xs4all.nl
>>> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>>>
>>
>> --
>> Sent from my mobile device
>>
More information about the Synth-diy
mailing list