Temperature Controller Problem - Page 2


+ Reply to Thread
Page 2 of 5 FirstFirst 1234 ... LastLast
Results 16 to 30 of 72

Thread: Temperature Controller Problem248 days old

  1. #16
    Senior Member Stephen Moss's Avatar
    Join Date
    Jan 2006
    Posts
    517
    Thumbs Up
    Received: 31
    Given: 7
    Total Downloaded
    3.87 GB

    0 Not allowed!

    Default Re: Temperature Controller Problem

    Here is some pseudo code to get you started, between that and the information in the manual on arrays and for-Next loops you should be able to get it working.
    Code:
      
    Dim Data_Array [10] as Byte   'Create a 10 element Array, use Word if ADC result is 10 or 12 bits
    Dim Data_Total as Word        'Create a variable to hold the sum of array data, use Dword if ADC result is 10 or 12 bits
    Dim Data_Average as Word      'Create a varaible to the average vaule of the data samples - use Dword if ADC result is 10 or bits or float if you want the extra precision   
    Dim Index as byte = 1         'Create a index for accessing array elements within the population and totalling/averaging loops
    
    For-Next loop to populate array with data samples
    
    Sub Routine or procedure for totalling & averaging samples  - because you will be using this a lot 
    For-Next loop to add all 10 array samples together to get Data_Total 
    Data_Average = Data_Total / 10   'Divide the sum of the Array data samples by the number of samples
    End Sub/Proc
    
    Index = 1   'Reset Array element access index
    
    Main: 'Somewhere within main execute the following once per loop (unless you need to update samples quicker in which case put it in a subroutine or procedure and call it several times within main)
    Data_Array[Index] = ADCIn.0   'Rolling replacement of old data with new samples
    Call Totalling & Averaging Sub/Proc to get new average
    Inc Index   'Increment index to reference the next element in the array
    If Index = 11 then Index = 1   'Loop Array element Index back to first element after all 10 have been updated with new samples.
    You may be thinking that you could just do the section before main, add your new sample to it and then divide by two as a simpler option within main but you would then be averaging an average which is not what you want.

Attention

This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

The advertisements we display are relevant to this web site and your browsing history

Please consider supporting us by disabling your ad blocker.


Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

If you can, please report issues in the forum area WebSite / Forum Issues


Thank you for your attention.

  • #17
    Member amod's Avatar
    Join Date
    Mar 2018
    Posts
    119
    Thumbs Up
    Received: 38
    Given: 5
    Total Downloaded
    10.35 MB

    0 Not allowed!

    Default Re: Temperature Controller Problem

    I want to create a settings menu in temperature controller.When i press a two buttons then a programming menu should open where i can save settings like Hysteresis,thermocouple selection etc.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #18
    Member amod's Avatar
    Join Date
    Mar 2018
    Posts
    119
    Thumbs Up
    Received: 38
    Given: 5
    Total Downloaded
    10.35 MB

    0 Not allowed!

    Default Re: Temperature Controller Problem

    I have displayed VER.1 on seven segments for only for 4 seconds when device is power on.Code is given below

    for I=0 to 999

    DG=$C7

    PORTB=DG
    PORTC.3=0
    PAUSEus 4000
    PORTC.3=1

    DG=$61

    PORTB=DG
    PORTC.2=0
    PAUSEus 4000
    PORTC.2=1

    DG=$F4


    PORTB=DG
    PORTC.1=0
    PAUSEus 4000
    PORTC.1=1

    DG=$9F

    PORTB=DG
    PORTC.0=0
    PAUSEus 4000
    PORTC.0=1



    NEXT I



    Is there is another and simple way of doing this.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #19
    Prolific Poster John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,838
    Thumbs Up
    Received: 90
    Given: 34
    Total Downloaded
    4.60 GB

    0 Not allowed!

    Default Re: Temperature Controller Problem

    Amod, which compiler are you using? You have "PAUSEus 4000".
    Delays in PDS use delayus or delayms.
    John
    Last edited by John Drew; 4th June 2019 at 01:18. Reason: Phone changed command.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #20
    Member amod's Avatar
    Join Date
    Mar 2018
    Posts
    119
    Thumbs Up
    Received: 38
    Given: 5
    Total Downloaded
    10.35 MB

    0 Not allowed!

    Default Re: Temperature Controller Problem

    I tried my code in Picbasic pro also.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #21
    Prolific Poster John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,838
    Thumbs Up
    Received: 90
    Given: 34
    Total Downloaded
    4.60 GB

    0 Not allowed!

    Default Re: Temperature Controller Problem

    It's better to stick to one compiler otherwise everyone including yourself will get confused.
    John

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #22
    Member amod's Avatar
    Join Date
    Mar 2018
    Posts
    119
    Thumbs Up
    Received: 38
    Given: 5
    Total Downloaded
    10.35 MB

    0 Not allowed!

    Default Re: Temperature Controller Problem

    I got it.i was only trying.pls help me for my problem.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #23
    Senior Member Stephen Moss's Avatar
    Join Date
    Jan 2006
    Posts
    517
    Thumbs Up
    Received: 31
    Given: 7
    Total Downloaded
    3.87 GB

    0 Not allowed!

    Default Re: Temperature Controller Problem

    How could you get anything resembling a V and R on a 7 segment LED display? I would think the closest would look more like U and A.
    Do you need the display size and visibility at distance you get from a 7-segment display?
    If not then consider an alphanumeric display instead as you only need to update it once per loop or when you have new data to display, whereas with a 7 segment display you have to update the entire display at least once every 20mS for persistence of vision. So for a 4 digit display you need to update a digit every 4ms, consequently if you program execution time is shorter you can update within your main loop, if it takes longer than 4ms then you will have to use a timer interrupt to ensure the display is updated and the correct intervals.

    As for the Code have you looked the the Dig command?
    You could use that to extract a value and then Select Case statement to set the ProtB values, i.e.
    Case = 1
    PortB = $06 'Display 1
    Case = 2
    PortB = $5B 'Display 2

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #24
    Member amod's Avatar
    Join Date
    Mar 2018
    Posts
    119
    Thumbs Up
    Received: 38
    Given: 5
    Total Downloaded
    10.35 MB

    0 Not allowed!

    Default Re: Temperature Controller Problem

    Need example for DIG command.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #25
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,465
    Thumbs Up
    Received: 305
    Given: 145
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: Temperature Controller Problem

    There already is an example on this thread of using Dig. For the seven segment multiplexing.

    Also, a search on the forum come back with a few threads concerning Dig, and this one is the most helpful:

    http://www.protonbasic.co.uk/showthr...79-Dig-Command

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #26
    Member amod's Avatar
    Join Date
    Mar 2018
    Posts
    119
    Thumbs Up
    Received: 38
    Given: 5
    Total Downloaded
    10.35 MB

    0 Not allowed!

    Default Re: Temperature Controller Problem

    I tried many times but can't make a peak hold temperature.need help.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #27
    Prolific Poster John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,838
    Thumbs Up
    Received: 90
    Given: 34
    Total Downloaded
    4.60 GB

    0 Not allowed!

    Default Re: Temperature Controller Problem

    Amod, put your best effort In a post and there may be someone who can see where you are going wrong.
    John

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #28
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,479
    Thumbs Up
    Received: 72
    Given: 30
    Total Downloaded
    6.54 GB

    0 Not allowed!

    Default Re: Temperature Controller Problem

    Amod,

    I would suggest that you first write a small code that prints to an LCD. As LCD's are widely used, there is more chance that forum users can do test of your code and come up with a solution. Speaking for me I am not able to setup 7-segment display hardware to test your code.

    I would also suggest that if your final code will be large, do write parts of the code separately, then implement them in your final code once you are happy with the results.

    This will also enable users to tackle parts of the code that are giving you trouble.
    Regards

    Joseph

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #29
    Member amod's Avatar
    Join Date
    Mar 2018
    Posts
    119
    Thumbs Up
    Received: 38
    Given: 5
    Total Downloaded
    10.35 MB

    0 Not allowed!

    Default Re: Temperature Controller Problem

    Code for peak hold which I tried.

    Dim value as word 'raw ADC value
    Dim newvalue as word. ' peak hold value

    Main:
    If newvalue > value then
    Gosub display ' display subroutine for seven segment display
    Gosub digitcalc ' subroutine for seven segment display
    Last edited by amod; 13th June 2019 at 19:30.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #30
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,479
    Thumbs Up
    Received: 72
    Given: 30
    Total Downloaded
    6.54 GB

    0 Not allowed!

    Default Re: Temperature Controller Problem

    Again Amod,

    You are missing to give a small program code which you think it works.

    Please forget the 7-segment display and instead write a small code that it prints to an LCD so I can track what you are doing. Once that small piece of code, which will hold the peak value is tried and tested then implement it in your full code.

    What you have given is very vague, so fir example I cannot see what your 7-segment will look for to print.

    I have done, very successful, a battery monitor which holds the peak value, and believe me it is very simple, but please, make a small code which you think it will work.
    Regards

    Joseph

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

    Thread Information

    Users Browsing this Thread

    There are currently 1 users browsing this thread. (0 members and 1 guests)

       

    Similar Threads

    1. Temperature Sensor
      By chuckieboy in forum The Lounge
      Replies: 9
      Last Post: 26th May 2012, 06:17
    2. [SOLVED !] temperature controller trying to implement PI terms of PID need giudance with I term
      By gogsmack01 in forum Proton Plus Compiler v3
      Replies: 4
      Last Post: 23rd September 2010, 13:33
    3. temperature sensor
      By chuckieboy in forum Proton Plus Compiler v3
      Replies: 3
      Last Post: 30th June 2010, 20:10
    4. Temperature Question
      By fanie in forum The Lounge
      Replies: 12
      Last Post: 30th June 2010, 17:05
    5. [SOLVED !] Temperature Controller using PIC16F628A
      By bentech4u in forum Proton Plus Compiler v3
      Replies: 9
      Last Post: 29th October 2008, 18:39

    Posting Permissions

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