Page 14 of 41 FirstFirst ... 410111213141516171824 ... LastLast
Results 131 to 140 of 405

Thread: The big TEC driver thread!

  1. #131
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    3,734

    Default

    Triple post - so shoot me.

    For anyone else interested in tinkering with this BEER KEG TEC controller, I knocked up a few calcs for the ADC voltage/values based on the attached NTC spec sheet, confirmed accurate between 0c and 30c.

    ADC ref is 5.00V, ADC is 10 bit, 1023 FS.
    Attached Thumbnails Attached Thumbnails Thermistor_100K.pdf  

    Attached Files Attached Files
    This space for rent.

  2. #132
    Join Date
    Jun 2010
    Location
    Zweibrücken, Germany
    Posts
    605

    Default

    Excellent work dude! For applications aside for dpss this looks very promising.


    I just requested the schematic for the board and if minor changes on the PCB can improve performance then why not? Unfortunately I can’t do too much at the moment since I broke my freakin shoulder the end of last month (all them laser goodies lying around and can’t do shit with them! ).



    I’ve also spent a thought on eventually redesigning a new PCB to suit your code with basically the same layout but with the necessary improvements implemented. The board could probably end up half the size of what it is now.


    If I get the schematic I’ll send it to you, just don’t directly post it on the Forum, if someone else should need it then please only via E-Mail.

  3. #133
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    3,734

    Default

    Quote Originally Posted by Solarfire View Post
    Excellent work dude! For applications aside for dpss this looks very promising.


    I just requested the schematic for the board and if minor changes on the PCB can improve performance then why not? Unfortunately I can’t do too much at the moment since I broke my freakin shoulder the end of last month (all them laser goodies lying around and can’t do shit with them! ).



    I’ve also spent a thought on eventually redesigning a new PCB to suit your code with basically the same layout but with the necessary improvements implemented. The board could probably end up half the size of what it is now.


    If I get the schematic I’ll send it to you, just don’t directly post it on the Forum, if someone else should need it then please only via E-Mail.
    Cool. On the list for a new design are:

    1. Precision op-amp NTC front-end to opimise the ADC range with a small window.
    2. Dedicated ADC Voltage Reference.
    3. Output inductor LPF to produce true analog output for the TEC.
    4. Re-assignment of ATtiny13 I/O pins (TEC output on port B0).
    5. Possible change to another MCU, ATmega8 for example to provide adjustable set point trim pot.
    6. Mounting holes on the PCB.
    7. Screw terminals for power, TEC, fan and sensor.
    8. Possibly current limiting also.
    9. Possibly a trough-hole PCB to aid hand assembly.
    10. Analog monitoring output to read in either 100mV/C or 100mV/F.
    11. Standard 0.1" pitch 6-pin in circuit programmer connector.
    12. diode driver inhibit output if the temperature is outside of a predefined window.

    EDIT: Added point 12 (Dave) 25/01/11
    Last edited by dnar; 01-25-2011 at 04:47.
    This space for rent.

  4. #134
    Join Date
    Oct 2010
    Location
    Athens, Greece
    Posts
    1,930

    Default

    wow!! this is turning into a living thing!!!! growing and asking for more i like this a lot!!

    this tech-talk makes me feel a bit stupid, but then again, i'm no electronics guru, so better leave this to the lads that know what they are doing
    "its called character briggs..."

  5. #135
    Join Date
    Mar 2008
    Location
    Sydney, Australia
    Posts
    315

    Default

    Quote Originally Posted by Solarfire View Post
    Something else though, ya think one of those cheap 30$ ISP programmers on ebay are up to the job of flashing these controllers? You got any recommendations?
    This STK500 clone costs $14 and works indistinguishably from the original. I have used them for various projects. http://www.sureelectronics.net/goods.php?id=18

  6. #136
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    3,734

    Default

    I spent a few more hours coding and testing tonight, it's actually amazing what you can achieve with this board and with such little resolution.

    I changed the code from purely proportional (P) to a proportional/integral (PI) loop to remove the offset error. I also increased the ADC sample time to 100 samples per second, and increased the PWM frequency by a factor of 4.

    I tested with the 1250mA 445nm diode being switched on and off a regular periods of 1 minute and on CW for periods of 10-15 minutes, in an ambient of between 24 - 29c. The results are pretty good.

    Click image for larger version. 

Name:	TEC PI Loop Test Results.png 
Views:	7 
Size:	6.4 KB 
ID:	23154

    Still plenty of code space too! Program size: 232 words (464 bytes), 45.3% of FLASH
    Last edited by dnar; 01-23-2011 at 07:22.
    This space for rent.

  7. #137
    Join Date
    Nov 2005
    Location
    Melbourne, Australia
    Posts
    3,702

    Default

    Is your code based on the Atmel app note Wayne?
    KVANT Australian projector sales
    https://www.facebook.com/kvantaus/

    Lasershowparts- Laser Parts at great prices
    https://www.facebook.com/lasershowparts/

  8. #138
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    3,734

    Default

    Quote Originally Posted by dave View Post
    Is your code based on the Atmel app note Wayne?
    No, it's not, well not directly. Straight from the brain (tm). PI and PID are simply. As is PWM.

    I worked for years a controls engineer in industry & utilities.
    This space for rent.

  9. #139
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    3,734

    Default

    I completed my testing and PI tuning last night, I added anti-windup protection for the Integral term (only allowing I to accumulate within the proportional band) so the step response is pretty good, both when the system is powered up in an above set point state and under.

    Final variance is now 0.108C measured and I cant get better than that when the ADC resolution is only 0.080924ºC per ADC value.

    The whole PI loop is pretty simple, using integer math due to the low res ADC range.
    Code:
        //Read the ADC
        ADCSRA.4 = TRUE;
        uiNTC   = ADCW;  
                        
        //Calculate the error 
        iError = uiNTC;
        iError-= SETPOINT;    
                            
        //Only permit integral accumulation within the proportional band
        if ((iPV > MIN_PV) && (iPV < MAX_PV)) 
        {
            //Update the integral value 
            iAccumError+= iError;
                        
            //Avoid integral wind-up beyond PV range
            if (iAccumError / I_TUNE > MAX_PV) iAccumError = MAX_PV * I_TUNE;  
            if (iAccumError / I_TUNE < -MAX_PV) iAccumError = -MAX_PV * I_TUNE; 
        }
                        
        // PI calculation
        iPV = iError + (iAccumError / I_TUNE); 
                        
        //Range limit the Process Value   
        if (iPV > MAX_PV) iPV = MAX_PV;
        if (iPV < MIN_PV) iPV = MIN_PV;
                        
        //PWM = Process Value 
        uiPWM = iPV;
    The PWM is handled in a timer interrupt service routine.

    The Derivative term (PID) does appear to be necessary, although I can add it once people have tested using smaller TEC's and blocks if needed.

    I think it's ready for others to try. PM me if your interested. Frank - do you want me to ship you some boards now?
    Last edited by dnar; 01-25-2011 at 00:08.
    This space for rent.

  10. #140
    Join Date
    Jun 2010
    Location
    Zweibrücken, Germany
    Posts
    605

    Default

    Quote Originally Posted by dnar View Post
    I completed my testing and PI tuning last night, I added anti-windup protection for the Integral term (only allowing I to accumulate within the proportional band) so the step response is pretty good, both when the system is powered up in an above set point state and under.

    Final variance is now 0.108C measured and I cant get better than that when the ADC resolution is only 0.080924ºC per ADC value.

    The whole PI loop is pretty simple, using integer math due to the low res ADC range.
    Code:
        //Read the ADC
        ADCSRA.4 = TRUE;
        uiNTC   = ADCW;  
                        
        //Calculate the error 
        iError = uiNTC;
        iError-= SETPOINT;    
                            
        //Only permit integral accumulation within the proportional band
        if ((iPV > MIN_PV) && (iPV < MAX_PV)) 
        {
            //Update the integral value 
            iAccumError+= iError;
                        
            //Avoid integral wind-up beyond PV range
            if (iAccumError / I_TUNE > MAX_PV) iAccumError = MAX_PV * I_TUNE;  
            if (iAccumError / I_TUNE < -MAX_PV) iAccumError = -MAX_PV * I_TUNE; 
        }
                        
        // PI calculation
        iPV = iError + (iAccumError / I_TUNE); 
                        
        //Range limit the Process Value   
        if (iPV > MAX_PV) iPV = MAX_PV;
        if (iPV < MIN_PV) iPV = MIN_PV;
                        
        //PWM = Process Value 
        uiPWM = iPV;
    The PWM is handled in a timer interrupt service routine.

    The Derivative term (PID) does appear to be necessary, although I can add it once people have tested using smaller TEC's and blocks if needed.

    I think it's ready for others to try. PM me if your interested. Frank - do you want me to ship you some boards now?
    Excellent..



    Chris (LaNeK779) sent you the boards, I’ve got boards here so if you can E-Mail me the code I can do some testing on smaller TEC’s 3.9-30W.


    I’m currently redesigning the board into 3 versions..


    1.) An SMD version still based on the attiny13 with some of the changes mentioned above.
    2.) Same as 1 but no SMD’s (haven’t found a sub for the irf7413 as non SMD yet)
    3.) And a ATmega8 Version


    Cheers!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •