After 5 hours of torturing wolfram alpha with equations (that once I worked out, I could have just done myself), I managed to design a voltage divider for the feedback that will take the output signal to the same voltage range as the DAC outputs. this will reduce a bunch of complexities and save a lot of parts. I'd still like to have a dac that output a larger voltage range, oh well.
0-30V in, 1.25-1.75V out
I'm planning to put togethor another regulator circuit soon.
And it gets better, being that I worked out how to do it, I wrote a program to solve these offset votlage dividers for me.
int main(void) {
float R1, R2, Vin1, Vout1, Vin2, Vout2, I1, I2, Voffset;
printf(" Vin \n");
printf(" R2 \n");
printf(" Vout \n");
printf(" R1 \n");
printf(" Voffset \n");
printf( "Top resistor: ");
scanf("%f", &R2);
printf( "Input low value: ");
scanf("%f", &Vin1);
printf( "Output low value: ");
scanf("%f", &Vout1);
printf( "Input high value: ");
scanf("%f", &Vin2);
printf( "Output high value: ");
scanf("%f", &Vout2);
I1 = (Vin1 - Vout1)/R2;
I2 = (Vin2 - Vout2)/R2;
Voffset = ((I1*Vout2)-(I2*Vout1))/(I1-I2);
R1 = (Vout1 - Voffset)/I1;
printf(" Voffset is : %f\n", Voffset);
printf(" R1 is: %f\n", R1);
return 0;
}
Using that confirms last nights work, and to adjust the current signal, I use two 10k resistors with an offset voltage of 2.5V
root@blackie2:/files/programming/c/resistor# ./OFFSETDIVIDER
Vin
R2
Vout
R1
Voffset
Top resistor: 10000
Input low value: 0
Output low value: 1.25
Input high value: 30
Output high value: 3.75
Voffset is : 1.363636
R1 is: 909.090942
COOL!
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.