Shop OBEX P1 Docs P2 Docs Learn Events
Issue with Chapter 6 of Process Control Text — Parallax Forums

Issue with Chapter 6 of Process Control Text

vhatfieldvhatfield Posts: 3
edited 2014-04-04 10:13 in BASIC Stamp
I'm currently working on the Process Control text and am running into an issue that could possibly impact the rest of my project. I'm having an issue where the StampPlot is not reading the correct output temperature in Activity 6-3. I've gone over the same lab for 2 weeks now, bought all new parts, had multiple people check my circuit, and even had my professor sit down with me for an hour to see if he could figure out the issue, but nothing has changed my issue.

Issue:
When I use the StampPlot macro sic_pc_incubator_manual.spm, and the IncubatorManual.bs2 code, the output value will only show 70 degrees or 168 degrees. When I plug in the device and turn on the heater, the LM34 will start to read often below 70F (the lower limit, I know this because I plugged in a voltmeter to the LM34-V slot and GND), and the StampPlot will plot 70F. Once it heats up to about 70F, often 68/69F, the StampPlot will jump up to ~168F and continue to plot 168F.

Troubleshooting:
What I've done so far is to check each component on my board, replacing all the parts with new ones and checking that each one reads some voltage.
I've checked the LM34 with a voltmeter to ensure it's reading the correct temperature, and used a voltmeter on the other components to ensure they're getting voltage.
I've tried changing the ADC_Dout pin to see if the data output pin was blown, but it still read the same.
I've tried on two different computers, same results
Checked circuit and component values multiple times.

Extra Info:
I'm using a BS2, Rev J, with a BOE, Rev D. I'm also using a 9V power supply, that is rated 800 mA.

If you have had the same issue or can think of anything that would help, please leave a comment.

Comments

  • BeanBean Posts: 8,129
    edited 2014-03-26 05:41
    Can you post your code ?

    Use the Parallax Serial Terminal or HyperTerminal to capture the text of what your program is sending. Please post that too.

    Also if you can post a schematic that would help.

    Most people probably don't have the "Process Control" text, so they have no idea what you have hardware or software wise.

    Bean
  • vhatfieldvhatfield Posts: 3
    edited 2014-03-26 16:58
    The Process Control text is available here, for free, from Parallax: link. All the stuff below is from inside the manual, in Activity 6-3.

    The circuit looks like this:
    circuit.JPG


    And this is my code:

    ' Process Control - IncubatorManual.bs2
    ' Allows manual control of incubator heater and fan via StampPlot
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    '
    [ Declarations ]
    ADC_ByteValue VAR Byte ' Analog to Digital Converter data
    V_Offset VAR Byte ' Offset voltage read from StampPlot
    V_Span VAR Byte ' Span voltage read from StampPlot
    TempF VAR Word ' Calculated temp. in hundredths of degree F
    ADC_CS PIN 13 ' ADC Chip Select pin
    ADC_Clk PIN 14 ' ADC Clock pin
    ADC_Dout PIN 15 ' ADC Data output
    ADC_VRef PIN 10 ' Pin for PWM to set ADC voltage span
    ADC_Vminus PIN 11 ' Pin for PWM to set ADC Offset
    Heater PIN 5 ' Pin for heater control
    Fan PIN 0 ' Pin for Fan control
    '
    [ Initialization ]
    LOW Heater ' Heater off
    LOW Fan ' Fan off
    PAUSE 1000 ' Connection stabilization
    GOSUB ReadSP_Temps ' Get temp span and offset from StampPlot
    '
    [ Main Routine ]
    DO
    GOSUB ReadSP_Controls
    GOSUB SetADC
    GOSUB ReadData
    GOSUB CalcTemp
    GOSUB PlotTemp
    PAUSE 500
    LOOP
    '
    [ Subroutines ]
    ReadSP_Temps:
    DEBUG CR,"!READ (txtTMin)",CR ' obtain min temperature (offset)
    DEBUGIN DEC V_Offset
    PAUSE 50
    DEBUG "!READ [(txtTMax),-,(txtTMin)]",CR ' obtain temperature span
    DEBUGIN DEC V_Span
    PAUSE 50
    RETURN
    ReadSP_Controls:
    DEBUG CR,"!READ (swHeat)",CR ' obtain state of heater control
    DEBUGIN DEC Heater
    PAUSE 50
    DEBUG "!READ (swFan)",CR ' obtain state of fan control
    DEBUGIN DEC Fan
    PAUSE 50
    RETURN
    SetADC:
    PWM ADC_Vminus, V_Offset * 255/500,100 ' PWM ADC offset voltage
    PWM ADC_Vref, V_Span * 255/500,100 ' PWM ADC Span voltage
    RETURN
    ReadData: ' Read ADC 0831
    LOW ADC_CS ' Enable chip
    SHIFTIN ADC_Dout, ADC_Clk, MSBPOST,[ADC_ByteValue\9] ' Clock in ADC data
    HIGH ADC_CS ' Disable ADC
    RETURN
    CalcTemp: ' Calculate temp in hundredths
    TempF = (V_Span * 100)/255 * ADC_ByteValue + (V_Offset * 100)
    RETURN
    PlotTemp:
    DEBUG "[", DEC TempF,",/,100]",CR ' Plot temperature/100
    DEBUG IBIN Heater,BIN Fan,CR ' Plot state of fan as digital
    RETURN
    791 x 612 - 52K
  • vhatfieldvhatfield Posts: 3
    edited 2014-03-26 17:00
    Bean wrote: »

    Use the Parallax Serial Terminal or HyperTerminal to capture the text of what your program is sending. Please post that too.

    I don't know what that is.
  • GenetixGenetix Posts: 1,754
    edited 2014-04-03 20:16
    The Parallax Serial Terminal (PST) is used by the Propeller chip.
    Process Control uses the BASIC Stamp 2.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-04-04 10:13
    Genetix wrote: »
    The Parallax Serial Terminal (PST) is used by the Propeller chip.
    Process Control uses the BASIC Stamp 2.

    You can use the PST with the BASIC Stamp Modules (or any serial device connected to the PC) as a generic terminal or for debugging purposes. You could also open a DEBUG window from within the BASIC Stamp Editor.
Sign In or Register to comment.