- Joined
- Jan 14, 2011
- Messages
- 3,816
- Points
- 63
Hey everyone. I figure that I should have done this sooner rather than now, but I wasn't sure how much interest this would garner.
In my I "C" Red entry, I used a very unique driver design that allows me to have power modes (eight modes total) without the use of a PIC or microcontroller. While this may not seem spectacular, it is if you consider that these modes are controlled only by two momentary-on buttons!
I'd appreciate it if you'd vote for me, but I will use this driver regardless (may just end up having to use it for a standard red though - oh no!). Post here to vote!
So, without further ado, here is a detailed explanation of its operation!
Before I go into the operation, here is the layout.
Here is the schematic.
So, an explanation.
We begin by looking at the big block on the upper left hand corner. This is the main current regulator. The way this driver functions is that there is a constant current (50uA) feeding out from the Vfb pin (bottom pin of the regulator). So, having a various currents there will determine the voltage on that pin. For example, if I had a 10k resistor there, we could apply Ohm's Law to find the voltage at that pin.
Vfb = IR = (50uA) * (10k Ohms) = 0.5V.
I will call the resistance at that pin Rset from now on. So,
Vfb = (50uA) * (Rset Ohms).
So, adjusting the resistance here changes the current. We'll get into how I change that resistance later. But, for now, assume that I can change the resistance at that pin.
Why is that pin useful? The regulator takes that exact voltage and applies it to the output pin (the pin on the right of the regulator). Because I have a sense resistor on that output pin, the voltage there is directly proportional to the current. So, we can apply Ohm's Law again and solve for the current at the output.
I = V/R = Vfb / Rsense.
Substituting in the equation we used to find Vfb, we have
Iout = (50uA) * (Rset Ohms) / (Rsense Ohms).
What does this output current have to do with the laser diode current though? The laser diode is on the input, not the output! Well, because this is a LINEAR regulator, the input current is exactly equal to the output current! Because this regulator requires an input control voltage (the left pin) higher than the power input voltage (the top pin), we simply put the laser diode between the input rail and the power input voltage! After all, that is where most of the input current is drawn. So, now we have a power input voltage that is lower than the control voltage (V_pwr-in = Vin - V_fw), and the current being pulled through the power input pin is exactly equal to the current pushed out through the output current. So, finally, we have that
I_diode = (50uA) * (Rset Ohms) / (Rsense Ohms).
If you're observant, you'll notice some circuitry between the battery contacts and the diode. This circuitry is simply an off-momentaryOn switch. The MOSFET is used a switching mechanism so that not much current needs to pass through the switch.
Now comes the question of how do I change the resistance of Rset by pressing two buttons? Usually, you could use a potentiometer to adjust the resistance, but that wasn't the goal of this project. The phaser already had two built in buttons, so I wanted to use those!
That raises the question: how do I select a different number of resistors in the series array for different modes? So, I came up with the idea of using a binary counter.
At its most basic, an up/down binary counter is a simple IC that has a certain number of outputs, one for each bit, a few controlling inputs (input voltage, GND input, etc.), and then two other inputs, one for counting up and one for counting down.
The binary counter I chose was a 4-bit binary counter, because I needed at least three bits to have eight modes (2^3 = 8). Further, the counter I used requires that both the up and down pins have 3-5V on it at all times, and will raise the count by one each time one of those pins goes to 0V and then back up to 3-5V.
So then the question comes up of how I use standard buttons to make this happen. I initially thought I would just have two buttons, each one connected to the pin on one leg and the other connected to GND on the other end. But that didn't work. Using a standard button doesn't work! There is a thing called "bounce" which causes the button to switch on and off really quickly before it settles. This is a standard thing for most buttons. But, it always needs to be fixed. So, what I did was use a Schmitt trigger and a capacitor. When I pressed the button, it dropped the voltage at the pin to zero, and when I released it (or when it released on its own due to bounce), it would charge a capacitor and once the capacitor reached a certain voltage, the Schmitt trigger would activate and send 3-5V to the input pin again. This works to debounce the button because it takes TIME for the capacitor to charge. So, because bounce only occurs for a few miliseconds, if it takes longer for the capacitor to charge than it takes for the switch to stop bouncing, then the capacitor basically filters the bounce out! Sorry that was kind of wordy. Was hard to explain.
The next step is to take those binary outputs (bit 1, 2, and 3) and convert them to selecting outputs. This part was clever, I thought!
There is a type of integrated circuit called an analog switch. Imagine it as a standard, SPDT switch. Then, I have a ladder of these analog switches. Bit 3 controls the top of the ladder, bit 2 controls the next step, and bit 1 controls the final step. Here are some pictures depicting what exactly goes on.
Now, you may wonder, can I cycle through, i.e. go from state 7 to state 0 by going up? Yes, I can! The counter will actually automatically do it for me
So, because the resistance changes at each mode, so will the output power! I selected the resistors to be approximately right at the threshold voltage from state 1 onwards, up to around 3.3A.
I hope you guys learned something from this write-up! I thought it was informative
If you have any questions, feel free to ask.
In my I "C" Red entry, I used a very unique driver design that allows me to have power modes (eight modes total) without the use of a PIC or microcontroller. While this may not seem spectacular, it is if you consider that these modes are controlled only by two momentary-on buttons!
I'd appreciate it if you'd vote for me, but I will use this driver regardless (may just end up having to use it for a standard red though - oh no!). Post here to vote!
So, without further ado, here is a detailed explanation of its operation!
Before I go into the operation, here is the layout.
Here is the schematic.
So, an explanation.
We begin by looking at the big block on the upper left hand corner. This is the main current regulator. The way this driver functions is that there is a constant current (50uA) feeding out from the Vfb pin (bottom pin of the regulator). So, having a various currents there will determine the voltage on that pin. For example, if I had a 10k resistor there, we could apply Ohm's Law to find the voltage at that pin.
Vfb = IR = (50uA) * (10k Ohms) = 0.5V.
I will call the resistance at that pin Rset from now on. So,
Vfb = (50uA) * (Rset Ohms).
So, adjusting the resistance here changes the current. We'll get into how I change that resistance later. But, for now, assume that I can change the resistance at that pin.
Why is that pin useful? The regulator takes that exact voltage and applies it to the output pin (the pin on the right of the regulator). Because I have a sense resistor on that output pin, the voltage there is directly proportional to the current. So, we can apply Ohm's Law again and solve for the current at the output.
I = V/R = Vfb / Rsense.
Substituting in the equation we used to find Vfb, we have
Iout = (50uA) * (Rset Ohms) / (Rsense Ohms).
What does this output current have to do with the laser diode current though? The laser diode is on the input, not the output! Well, because this is a LINEAR regulator, the input current is exactly equal to the output current! Because this regulator requires an input control voltage (the left pin) higher than the power input voltage (the top pin), we simply put the laser diode between the input rail and the power input voltage! After all, that is where most of the input current is drawn. So, now we have a power input voltage that is lower than the control voltage (V_pwr-in = Vin - V_fw), and the current being pulled through the power input pin is exactly equal to the current pushed out through the output current. So, finally, we have that
I_diode = (50uA) * (Rset Ohms) / (Rsense Ohms).
If you're observant, you'll notice some circuitry between the battery contacts and the diode. This circuitry is simply an off-momentaryOn switch. The MOSFET is used a switching mechanism so that not much current needs to pass through the switch.
Now comes the question of how do I change the resistance of Rset by pressing two buttons? Usually, you could use a potentiometer to adjust the resistance, but that wasn't the goal of this project. The phaser already had two built in buttons, so I wanted to use those!
That raises the question: how do I select a different number of resistors in the series array for different modes? So, I came up with the idea of using a binary counter.
At its most basic, an up/down binary counter is a simple IC that has a certain number of outputs, one for each bit, a few controlling inputs (input voltage, GND input, etc.), and then two other inputs, one for counting up and one for counting down.
The binary counter I chose was a 4-bit binary counter, because I needed at least three bits to have eight modes (2^3 = 8). Further, the counter I used requires that both the up and down pins have 3-5V on it at all times, and will raise the count by one each time one of those pins goes to 0V and then back up to 3-5V.
So then the question comes up of how I use standard buttons to make this happen. I initially thought I would just have two buttons, each one connected to the pin on one leg and the other connected to GND on the other end. But that didn't work. Using a standard button doesn't work! There is a thing called "bounce" which causes the button to switch on and off really quickly before it settles. This is a standard thing for most buttons. But, it always needs to be fixed. So, what I did was use a Schmitt trigger and a capacitor. When I pressed the button, it dropped the voltage at the pin to zero, and when I released it (or when it released on its own due to bounce), it would charge a capacitor and once the capacitor reached a certain voltage, the Schmitt trigger would activate and send 3-5V to the input pin again. This works to debounce the button because it takes TIME for the capacitor to charge. So, because bounce only occurs for a few miliseconds, if it takes longer for the capacitor to charge than it takes for the switch to stop bouncing, then the capacitor basically filters the bounce out! Sorry that was kind of wordy. Was hard to explain.
The next step is to take those binary outputs (bit 1, 2, and 3) and convert them to selecting outputs. This part was clever, I thought!
There is a type of integrated circuit called an analog switch. Imagine it as a standard, SPDT switch. Then, I have a ladder of these analog switches. Bit 3 controls the top of the ladder, bit 2 controls the next step, and bit 1 controls the final step. Here are some pictures depicting what exactly goes on.
State 0: This is the off state. Here, all the binary counts are low, which means, in decimal, the number it corresponds to is 0*2^2 + 0*2^1 + 0*2^0 = 0.
State 1: This is the lowest state, gotten by turning on the least significant bit, bit 3. You'll see a voltage up at the top, and this voltage is the voltage that Vfb sees. You can trace the resistance yourself!
State 2: Similar to before, except now bit 2 is on and bit 1 is off. You'll recognize the pattern as 000 -> 001 -> 010 -> and so on.
State 3: As before, except now bit 3 and bit 2 are on. You'll notice that the voltage Vfb will see is the sum of the voltage it saw from Bit 3 and Bit 2 being on separately.
State 4: Here is the first time that Bit 1 turned on. Again, it's the same process as before.
State 5: Now, Bit 1 and Bit 3 are on, yielding a voltage that is the sum of the two separate voltages.
State 6: The next state, almost to max power!
State 7: The final state! Here, all the bits are on, so the resistance at Vfb is equal to the entire resistance of the series array of resistors.
State 1: This is the lowest state, gotten by turning on the least significant bit, bit 3. You'll see a voltage up at the top, and this voltage is the voltage that Vfb sees. You can trace the resistance yourself!
State 2: Similar to before, except now bit 2 is on and bit 1 is off. You'll recognize the pattern as 000 -> 001 -> 010 -> and so on.
State 3: As before, except now bit 3 and bit 2 are on. You'll notice that the voltage Vfb will see is the sum of the voltage it saw from Bit 3 and Bit 2 being on separately.
State 4: Here is the first time that Bit 1 turned on. Again, it's the same process as before.
State 5: Now, Bit 1 and Bit 3 are on, yielding a voltage that is the sum of the two separate voltages.
State 6: The next state, almost to max power!
State 7: The final state! Here, all the bits are on, so the resistance at Vfb is equal to the entire resistance of the series array of resistors.
Now, you may wonder, can I cycle through, i.e. go from state 7 to state 0 by going up? Yes, I can! The counter will actually automatically do it for me
So, because the resistance changes at each mode, so will the output power! I selected the resistors to be approximately right at the threshold voltage from state 1 onwards, up to around 3.3A.
I hope you guys learned something from this write-up! I thought it was informative
If you have any questions, feel free to ask.
Last edited: