Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Analog Line Level Preamplifiers , Passive Pre-amps, Crossovers, etc.

A precision LED/LDR-based Attenuator
A precision LED/LDR-based Attenuator
Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 24th August 2011, 08:26 PM   #141
wapo54001 is offline wapo54001  United States
diyAudio Member
 
Join Date: Nov 2008
A precision LED/LDR-based Attenuator
OK, this board is going to press, I can't see how I can make it any better with what I know right now.

Received some parts a few days ago that allowed me to actually test some perceived needed changes:

1) changed Vadj from single turn to multi-turn, and reference voltage is now very solid at 4.999~5.000 volts.

2) changed half of Vref voltage divider for each PIC from a fixed resistor to a multi-turn pot. This pot will allow me to set max ADC count to exactly the maximum resistance I want from the shunt LDR in a given LDR pair configuration. That will give me maximum ADC counts available within the useful range at the low current (high LDR resistance) end of the range.

3) changed the resistor driving the mosfet gates from 1 meg to 3 meg, and control is greatly improved, with much less change in LDR resistance when the mosfet is fed a correction pulse. Thus smaller pulses for finer control.

One remaining change: The current limiting resistor for the series LDR can be much greater than 150 ohms, because the series LDR will never be asked to operate at 40 ohms. I will have to find the appropriate value as the target resistor values become known, but probably will be in the range of 150 ohms for the LDR which should mean several hundred ohms in series with the LED to limit current. Again, this is in aid of ensuring the maximum number of ADC steps are available for control in the useful zone by increasing the available count at the high current (low LDR resistance) end of the range.

Moved IR control chip off the board; it was silly to divide the circuitry for that function between two locations. It'll all fit on one board together with the necessary regulator for the motor.

Now have the software running smoothly, controlling two separate LDRs simultaneously. It's obvious that the LDRs are not consistent because when the mosfets are matched delivering exactly the same current to two LDR devices, the resistance of the LDR is considerably different between devices. This is not new information, but it's interesting for me to see two devices running simultaneously with exactly the same drive current showing such different resistances on the output side.

Time to build the new board and modify the code for the new chips, and see four devices running simultaneously, responding to a single input. Once that's done, it'll be time to start writing the code to first determine the correction required for each device, then figure out how to code that correction into the drive algorithms.
Attached Images
File Type: jpg ScreenShot003.jpg (184.1 KB, 607 views)

Last edited by wapo54001; 24th August 2011 at 08:42 PM.
  Reply With Quote
Old 26th August 2011, 12:26 AM   #142
gootee is offline gootee  United States
diyAudio Member
 
Join Date: Nov 2006
Location: Indiana
Excellent thinking on the multi-turn pots. And everything else seems to be maturing nicely. It'll be interesting to see what happens next.
  Reply With Quote
Old 26th August 2011, 01:42 AM   #143
gootee is offline gootee  United States
diyAudio Member
 
Join Date: Nov 2006
Location: Indiana
Quote:
Originally Posted by wapo54001 View Post
I am retired Air Force. During Viet Nam, I was a pilot. Afterwards, I became an air traffic control officer and part-time pilot and managed ATC facilities. Later, I commanded communications and computer systems organizations (because in the Air Force, comm, computer, and ATC are combined together). Am now 66 and in my dotage. My intentions, so far as they go, is to stay above ground for as long as I can, and play with electronics and my toy airplane. :-)
Coool! What did you fly during Viet Nam? I remember guys I knew talking about how they freaked out when they first arrived at Bien Hoa and realized that there were two three-mile-long (or whatever they were) runways that were paved with brass shell casings, and laughed (or maybe grimaced would be more accurate) at the idiots who would say things like, "Wow. Who's been shootin-off all these rounds?".

I have always been in love with aviation and aerospace. I had an uncle who flew P-47s in WWII, and another uncle (his brother) who was a brilliant self-taught engineer at McDonnell Douglas from before it was McDonnell in the 1930s until the late 1970s. I worked at their McDonnell Aircraft division, straight out of Purdue EE school, in the Guidance and Control department, from late 1980 until ealy 1984, when I resigned to start a software company. I got onto the F/A-18 project as we were completing Ship #3, in November of 1980. I remember hearing about the ceremony for the 5000th F-4 Phantom, although I never worked on that program. I did do some cool stuff for the F-15, though. (I also learned that it was pretty-much impossible to win an argument with our test pilots.)

Here's a cool story I remember: The uncle who flew P-47s had his plane go down on Dec 23rd, 1944, during The Battle of the Bulge (unable to switch from takeoff tank to main tank). He hit the stabilizer on his way out and was rendered unconscious. He regained consciousness while freefalling and pulled his ripcord. He said that the instant his canopy popped his feet touched the ground! Talk about just plain lucky. I should have gone to Vegas with him, I guess.

Dotage is such a funny word, in that context.

Cheers,

Tom

Last edited by gootee; 26th August 2011 at 01:50 AM.
  Reply With Quote
Old 26th August 2011, 05:35 PM   #144
wapo54001 is offline wapo54001  United States
diyAudio Member
 
Join Date: Nov 2008
A precision LED/LDR-based Attenuator
This project has hit what appears to be an insurmountable brick wall.

The problem is the combination of a) the sensitive logarithmic current response of the LDR requiring very fine adjustment steps at higher resistance values and b) the resolution limitations caused by the combination of limited internal math capability of the PICs together with the relatively coarse 10-bit (linear) resolution of the PIC's internal ADCs. At the low end below 200 ohms I can control LDR resistance to within a tenth of an ohm. However, at the upper end around 10K ohms, resolution is down to several hundred ohms between steps which is nowhere near close enough.

Need to think this through, perhaps take a different approach to the problem. But the specific approach I've been following here probably isn't going to work without considerable modification.

Going to take the rest of the summer off and go flying . . .
  Reply With Quote
Old 26th August 2011, 10:17 PM   #145
jackinnj is offline jackinnj  United States
diyAudio Member
 
jackinnj's Avatar
 
Join Date: Apr 2002
Location: Llanddewi Brefi, NJ
A precision LED/LDR-based Attenuator
Quote:
Originally Posted by wapo54001 View Post
This project has hit what appears to be an insurmountable brick wall.

The problem is the combination of a) the sensitive logarithmic current response of the LDR requiring very fine adjustment steps at higher resistance values and b) the resolution limitations caused by the combination of limited internal math capability of the PICs together with the relatively coarse 10-bit (linear) resolution of the PIC's internal ADCs.
Easy to control linear voltage to logarithmic current converter:

Click the image to open in full size.
  Reply With Quote
Old 27th August 2011, 05:30 PM   #146
wapo54001 is offline wapo54001  United States
diyAudio Member
 
Join Date: Nov 2008
A precision LED/LDR-based Attenuator
Quote:
Originally Posted by jackinnj View Post
Easy to control linear voltage to logarithmic current converter:
Interesting circuit. I had not been aware of the LM1971, and it does look as though it might handle the range of currents required to control the LDR.

The problem with my circuit is not in the control of the LDR -- control of the current passing through the mosfet is infinitely variable with no steps; however, the ADC which reads the mosfet and guides it to a specific resistance is limited to 10 bits resolution. Further, the math done by the chip will only work with whole integers, so rounding errors in some places can be very serious.

Since the output of the 1971 is in defined steps, it may be possible to program a PIC to select a compensated output for a given level based upon previous measurements and without the need for feedback. I'll definitely look at that, thank you for pointing out the possibility.
  Reply With Quote
Old 31st August 2011, 11:26 AM   #147
wapo54001 is offline wapo54001  United States
diyAudio Member
 
Join Date: Nov 2008
A precision LED/LDR-based Attenuator
I have been looking all over the internet, trying to figure out what are "optimal" potentiometer values for this application.

I think I've been heading in the wrong direction -- trying to build a potentiometer with resistance values that deliver matching impedances to the source and the load at all rotation points. This results in LDR resistance values as high as 60K for the shunt at 1db attenuation.

I'm beginning to suspect that the best values here are close to a simple mechanical potentiometer, with the top half resistance and the bottom half resistance, when added together, equaling the value of the pot and the value of the pot is (approximately) equal to the input impedance.

I gather that output impedance is at a maximum when the pot is at midpoint and the upper and lower resistances are equal. This results in an output impedance which is 1/4 the value of the pot.

So, for a 10K pot, output impendance will always be below 2.5K; is this low enough? Should the pot resistance curves be tweaked so that the upper and lower resistances are still equal but somewhat lower in value? Like, for a 10K pot, change the curve so that the two values are 3K+3K at midpoint instead of 5K+5K?

If the maximum LDR resistance I have to deal with is around 7K or less at all times, this job gets a lot, lot easier.

Any input welcome . . .
  Reply With Quote
Old 31st August 2011, 02:52 PM   #148
oenboek is offline oenboek  Belgium
diyAudio Member
 
Join Date: Apr 2005
Location: Sint Katelijne Waver
Hi
I simulate a mechanical pot in my design. Total resistance of shunt+series remains constant at 40k. This gives a nearly constant load to the source which is important for my DAC.
At the output I have a buffer, the Salas DCB1. The combination sounds really great. In theory the DCB1 has e very high impedance, but in practice it's quite sensitive to the output impedance before as it's a high capacitive load. But it sounds great. As I can do automatic calibration, I could try other impedances but I've done other things lately. I prefer the basic pot function, called KISS.
  Reply With Quote
Old 31st August 2011, 06:52 PM   #149
jackinnj is offline jackinnj  United States
diyAudio Member
 
jackinnj's Avatar
 
Join Date: Apr 2002
Location: Llanddewi Brefi, NJ
A precision LED/LDR-based Attenuator
If you are "simulating" a mechanical potentiometer with a 15A taper, you can separate the analysis into two equations of resistance vs travel. Also, you can use Excel to calculate the effect of the parallel resistance of the load when coming up with the final set of equations.

Don't lose sight of the fact that for low listening levels you need less precision than high listening levels.
  Reply With Quote
Old 31st August 2011, 09:47 PM   #150
MiiB is offline MiiB  Denmark
diyAudio Member
 
Join Date: May 2005
Location: Denmark
Don't think in practical terms that it matters that the load varies a bit....as to drift from app 20K to 10K during different volume settings.. as most equipment has a rather low output impedance..

It could also be possible to make a combination of fxed resistors and LDRS to get a practical acceptable solution...
  Reply With Quote

Reply


A precision LED/LDR-based AttenuatorHide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
LDR photoresistor attenuator preamp, in general romana Analog Line Level 54 14th December 2013 02:32 AM
TUBEpre and Lightspeed LDR attenuator tinitus Analog Line Level 5 31st January 2010 05:08 PM
LDR attenuator questions Carlp Analog Line Level 15 21st January 2010 01:01 AM
LED to LDR amplifier electro samurai Analogue Source 8 21st March 2004 05:07 PM
Spectrol, high precision, 10k attenuator. Peter Daniel Swap Meet 3 4th February 2004 05:15 PM


New To Site? Need Help?

All times are GMT. The time now is 07:03 AM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 14.29%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Copyright ©1999-2018 diyAudio
Wiki