130-28176 Parallax Inc, 130-28176 Datasheet - Page 310

KIT PARTS PROCESS CONTROL

130-28176

Manufacturer Part Number
130-28176
Description
KIT PARTS PROCESS CONTROL
Manufacturer
Parallax Inc
Datasheets

Specifications of 130-28176

Accessory Type
Education Kit
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
Board of Education Full Kit
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
LOOP
' -----[ Subroutines ]-----------------------------------------------------
' **** Sets ADC Span & Offset, Reads ADC Value, Calculates Temp F,
'
READADC:
RETURN
' **** Calculates the amount of Error based on setpoint and temperature
'
'
CalcError:
RETURN
' **** Adds bias to total drive
AddBias:
RETURN
' **** Calculates %proportional drive and adds to total drive
CalcP_Drive:
RETURN
' **** calculates Integral Drive.
'
'
GOSUB AddBias
GOSUB CalcP_Drive
GOSUB CalcI_Drive
GOSUB CalcD_Drive
GOSUB Control_Incubator
GOSUB ReadSP
PWM ADC_Vminus,Offset * 255/500,100
PWM ADC_Vref,Span * 255/500,100
LOW ADC_CS
SHIFTIN ADC_Dout,ADC_Clk, MSBPOST,[ADC_DataIn\9]
HIGH ADC_CS
TempF = ADC_Datain * Span /26 + (Offset*10)
DEBUG CR,DEC SetP,",",
Err =
SignBit = Err.BIT15
Err = ABS(Err) * (1000/Band) MAX 2000
IF Signbit = 1 THEN Err = Err * -1
DEBUG SDEC Err,","
DriveTotal = DriveTotal + (Bias * 10)
signBit = err.BIT15
TempDrive = ABS(Err)* Kp / Kp_Scalar MAX 2000
IF signbit = 1 THEN TempDrive = TempDrive * -1
DEBUG SDEC TempDrive,","
DriveTotal = DriveTotal + TempDrive
Updates StampPlot for temperature
Based on band calculates %Error, maximum 200% in tenths
Signbit saved and recalled to perform math on positive integers.
Calculates integral sample based on error * time
Integrated error is accumulated in I_Et
DEC Band, ",",
DEC TempF,","
SetP - TempF
' Comment out to disable StampPlot interactivity
' Send %Error
' Send %Drive-P
' Send setpoint
' Send Band
' Send Actual Temp

Related parts for 130-28176