The LCDuino-1 I/O processor
Mar 14, 2010 at 3:09 AM Post #331 of 403
When I was looking at rotary encoders awhile back, I stumbled upon laser mouse sensors which seem very powerful and adaptable to many tasks, including rotary encoding. I would like to revisit that idea sometime, but too busy right now.
 
Mar 14, 2010 at 3:16 AM Post #332 of 403
Quote:

Originally Posted by amb /img/forum/go_quote.gif
The board will have pads for resistors with 5mm, 10mm and 12.5mm spacings. You could also use a combination of these pads to fit additional intermediate sizes. This means it can support RN50, RN55, RN60 and other sizes too, including the Vishay-Dale PTF series. Or if you want to get really fancy, the Vishay S104 foil resistors (that is, if you could find them and don't mind the price).
wink.gif



Will it support SMD resistors?
 
Mar 14, 2010 at 4:03 AM Post #333 of 403
Quote:

Originally Posted by amb /img/forum/go_quote.gif
The board will have pads for resistors with 5mm, 10mm and 12.5mm spacings. You could also use a combination of these pads to fit additional intermediate sizes. This means it can support RN50, RN55, RN60 and other sizes too, including the Vishay-Dale PTF series. Or if you want to get really fancy, the Vishay S104 foil resistors (that is, if you could find them and don't mind the price).
wink.gif



I looked around and didn't see the S-series anywhere, but after seeing the prices for the PTF series, I'm not going to bother looking anymore lol. For a 1/8W, .01% PTF resistor, you are looking at $5.95 each
eek.gif


How many of these would we need? Looks like 34 per board in the pic. So, 68 for a balanced config? That's over $400 just for resistors.....If that's correct, I think I'll stick with the RN series
rolleyes.gif


Edit: Turns out Mouser does carry a few of the S series...$32 a piece lol.

http://www.mouser.com/ProductDetail/...0kmFDO9y0sI%3d
 
Mar 14, 2010 at 4:39 AM Post #335 of 403
another peek at the CGI, in progress:

4430493931_c40021067a_o.gif


this was a silly example but it shows that you can plug in fractional values and it will still work.

its still in C code (it took almost 2000 lines of C code to get that to run, live) but will be converted to perl when we get a chance and then hosted on a public server so that people can get at it.
 
Mar 14, 2010 at 7:06 AM Post #339 of 403
Quote:

Originally Posted by MASantos /img/forum/go_quote.gif
Will it support SMD resistors?


No, there are no SMD parts anywhere on this board, and there are plenty of excellent through-hole resistors to choose from.
 
Mar 14, 2010 at 12:50 PM Post #340 of 403
Quote:

Originally Posted by linuxworks /img/forum/go_quote.gif
this was a silly example but it shows that you can plug in fractional values and it will still work.


I know that the TPA Joshua tree has a fixed output impedance, and variable input impedance. How does this attenuator work in that respect?
 
Mar 14, 2010 at 1:56 PM Post #341 of 403
Quote:

Originally Posted by Beefy /img/forum/go_quote.gif
I know that the TPA Joshua tree has a fixed output impedance, and variable input impedance. How does this attenuator work in that respect?


I think its the opposite way, isn't it? the TPA is constant on the input side whereas this is constant on the output side.
 
Mar 14, 2010 at 2:01 PM Post #342 of 403
Quote:

Originally Posted by linuxworks /img/forum/go_quote.gif
I think its the opposite way, isn't it? the TPA is constant on the input side whereas this is constant on the output side.


"The kit's input impedance varies between 2.2K and 10K, with a fixed output impedance of 750R."

From here.
 
Mar 14, 2010 at 2:30 PM Post #343 of 403
I had in and out reversed in my mind, I think
wink.gif
(go get coffee BEFORE you post first thing in the AM, lol).


here's an expanded run of the CLI tool that now shows effective dB stage attenuation (based on actual resistor values; not ideal ones) as well as the actual calculated input z. so yes, its input z that is kept constant:

./r2r_cli 8 .5 25000
using bits=[8] stepsize=[0.5] z=[25000]
max_atten=[127.5]
bit 0 dB -0.5 Rs=[1400] Rp=[422000] acutal dB=[-0.500523] actual Zin=[25001.8]
bit 1 dB -1 Rs=[2740] Rp=[205000] acutal dB=[-1.00733] actual Zin=[25022.6]
bit 2 dB -2 Rs=[5110] Rp=[95900] acutal dB=[-1.99144] actual Zin=[24940.4]
bit 3 dB -4 Rs=[9310] Rp=[43200] acutal dB=[-4.01651] actual Zin=[25145.8]
bit 4 dB -8 Rs=[15000] Rp=[16500] acutal dB=[-7.99033] actual Zin=[24939.8]
bit 5 dB -16 Rs=[21000] Rp=[4750] acutal dB=[-15.9329] actual Zin=[24991.6]
bit 6 dB -32 Rs=[24300] Rp=[649] acutal dB=[-31.9131] actual Zin=[24932.6]
bit 7 dB -64 Rs=[24900] Rp=[15.8] acutal dB=[-63.9618] actual Zin=[24915.8]


this is my semi standard run using 8 bits, half db steps and 25k target Z. the last 2 columns show the effect of using e96 resistors.

to constrast, if we used ideal resistors and not standards-based values, the run shows this:

./r2r_cli 8 .5 25000
using bits=[8] stepsize=[0.5] z=[25000]
max_atten=[127.5]
bit 0 dB -0.5 Rs=[1398.48] Rp=[421914] acutal dB=[-0.5] actual Zin=[25000]
bit 1 dB -1 Rs=[2718.73] Rp=[204887] acutal dB=[-1] actual Zin=[25000]
bit 2 dB -2 Rs=[5141.79] Rp=[96552.9] acutal dB=[-2] actual Zin=[25000]
bit 3 dB -4 Rs=[9226.07] Rp=[42742.8] acutal dB=[-4] actual Zin=[25000]
bit 4 dB -8 Rs=[15047.3] Rp=[16535.6] acutal dB=[-8] actual Zin=[25000]
bit 5 dB -16 Rs=[21037.8] Rp=[4708.48] acutal dB=[-16] actual Zin=[25000]
bit 6 dB -32 Rs=[24372] Rp=[644.152] acutal dB=[-32] actual Zin=[25000]
bit 7 dB -64 Rs=[24984.2] Rp=[15.7839] acutal dB=[-64] actual Zin=[25000]

and for those that want to check me, here's the logic:


Rp = ( pow(10, (db/20)) * output_z / (1 - pow(10, (db/20)) ) );

Rs = ( output_z - (1 / ( (1/Rp) + (1/output_z))) );

actual_db = 20 * log10(output_z * computed_Rp / (output_z + computed_Rp) / (computed_Rs + output_z * computed_Rp / (output_z + computed_Rp) ));

actual_z = computed_Rs + ( output_z * computed_Rp) / (output_z + computed_Rp);


...for those that care
wink.gif
 
Mar 14, 2010 at 7:12 PM Post #344 of 403
As promised, here are more details about the δ1 relay-based stepped attenuator.

First, a 3D render update to show the latest version (v0.6).

delta1_006_povray_sml2.jpg


Here is the PCB layout, for a larger version click here:

delta1_006_pcb_sml2.png


Here is the schematic diagram:

delta1_006_sch_page1.png

delta1_006_sch_page2.png


The board has two sections, a "Driver" section and an "Attenuator" section. Each section is on a separate page of the schematic diagram shown above.

The two sections will come as one board, but it will be grooved so that you can optionally snap it apart to mount the two sections separately. A ribbon cable with IDC dual-row sockets on each end can be used to connect the two sections (J4 and J5).

These boards are designed to be stackable. One board supports two channels (stereo), two boards support four-channel balanced. You can stack even more boards if desired, up to a limit imposed by the number of available I2C addresses (see below).

Attenuator section

The attenuator section contains the relays and resistors for the resistive ladder, as well as input/output Molex connectors for each channel (J6 and J7). There are separate analog double ground planes for each channel. There are also positions for optional ground loop breaker resistors and caps, which could be populated if your build needs this. Two of the attenuator section mounting holes can be used as a contact to the chassis through metal standoffs and screws. If you do not populate the ground loop breaker parts, then the onboard analog signal grounds are left floating.

As discussed before, up to 8 relays are supported, giving us up to 256 steps of control. You may configure the last relay (K8) as a "mute" relay by installing wire jumpers across RS8 and RP8, which will reduce the number of steps by half. When all relays are used as attenuators (rather than having the last one serve as "mute"), and choosing 0.5dB steps, you will still be able to reach -127.5dB of attenuation, which is "mute" for all practical purposes.

You can also choose to populate less than 8 relays, one less relay results in halving the number of steps. Also as mentioned, the step size (number of dB per step) and attenuation range will also be configurable, so you could build an attenuator for specialize applications. A special web-based calculator will be available to help you select the optimum resistor values for your requirements.

The board supports through-hole resistors of 200, 400 and 500 mils lead-spacing (5mm, 10mm and 12.5mm). Other intermediate sizes are also possible by using the pads between those three sets. This lets δ1 accommodate a wide range of resistor types, including RN50, RN55, RN60 and PTF types from Vishay-Dale.

The relays are latching type, which means that the driver circuit only needs to send the coil a pulse to set the state, and then no more coil current is needed to maintain that state. To change states, a reverse polarity pulse is applied. This means that the relays will draw no current when the volume is not being changed, and will maintain their states even when power is turned off.

Driver section

The driver section has a 6P Molex connector (J1) that serves as the "Interface" connector to the LCDuino-1's I2C bus as well as for +5V power supply and digital/logic ground. There is also an ALT_POWER pin which may optionally be used to connect a separate power supply for the relay coils, rather than using the "regular" +5V supply (this is jumper-configurable with JP2). ALT_POWER can be something other than 5V, if you use this then choose your relay coil voltage specs accordingly.

If more than one driver section boards are stacked together, 6P headers and receptacles (J2 and J3) on the board may be added to propagate the I2C bus signals, power and ground to all stacked boards without the need for separate wiring from the LCDuino-1 or the power supply. There are pads for two such "stacking" connectors, so that you may, for instance, populate a male header in J2 on the component side of the 1st (bottom) board, and a female receptacle in J2 on the solder side of the 2nd board. If you need to stack more boards, then populate a male header in J3 on the component side of 2nd board and a female receptacle in J3 on the solder side of the 3rd board. And this could be repeated in J2 for the 4th board, etc.

The driver section board has holes for "normal" chassis mounting, but also has holes for mounting behind the LCDuino-1. It is taller than the LCDuino-1, so this method would only be feasible if there is sufficient height in the case.

Each driver section contains two PCF8574 I2C port expander chips which gives us 8 bits each (to drive up to 8 relays). Since the relays are single-coil latching type, they need coil voltage polarity reversal to change states, so we use two port expander chips, which allows the firmware full control of the relay coils. Each PCF8574 port expander chip must occupy a unique I2C address, which is configured by JP1 and JP2, respectively. There are 3 bits each, so there are 8 possible addresses to choose from. Since each board uses two addresses, that means only up to four boards are possible. However, there is a PCF8574A chip (note the A suffix) that will give us a different address space, so there could be up to eight δ1s on the bus (not counting any other I2C devices that may be sharing the address space, of course).

Two ULN2803 darlington array chips provide the actual "drive" of each end of the relay coils. Two 10-segment LED arrays can be populated to display the state of the relay coil drive, and a spare LED on each one of these serve as the power indicator. There are two remaining unused LEDs, one on each array (TST0 and TST1), which are pulled up by the resistor network R1+ and R1- and can be optionally used to provide some other state indication if you want. All LEDs can be disabled or enabled with a jumper (JP3).

Current status

We will be prototyping δ1 very soon, updates will be posted here.
 
Mar 14, 2010 at 10:50 PM Post #345 of 403
Quote:

Originally Posted by Juaquin /img/forum/go_quote.gif
I'd be interested in putting together a Rotary Encoder implementation of some sort, if no one else would like to, because I'm interested in using one. If you use a knob without a mark on it, you don't have those out of sync problems - turn clockwise for more volume, counter-clockwise for less. Combined with an LCD for feedback as to where you are on the scale, it's just as precise as using up/down buttons or IR control. I'll take a look over spring break.


I've implemented some very simple code and used capacitors for debouncing. Works 100% reliable for me. H I F I D U I N O: Arduino Code for Rotary Encoder
 

Users who are viewing this thread

Back
Top