Answered step by step
Verified Expert Solution
Question
1 Approved Answer
= , sp Control program for the water level in a tank. 'program in QUICKBASIC to apply a P+I control strategy to a level system
= ", sp Control program for the water level in a tank. 'program in QUICKBASIC to apply a P+I control strategy to a level system BA = SHIBO: porta = BA: portb = BA+1: portc = BA+2: cr = BA+3 OUT cr, &H91: 'set up ports as required OUT portb, O: OUT porto, O: 'switch off pump and close control valve CLS INPUT "setpoint level in mm INPUT "controller proportional band as a % pb INPUT "controller integral time setting in seconds =" Ti k = 100/pb: sum = 0: span = 400 dt= .5: 'discrete sample time for loop is 0.5 seconds start: 'this is the control loop t = TIMER GOSUB adc e = 100 * (sp - pv) / span sum = sum + e u% = INT((ke)+((k* dt/TI) * sum)) IF u% 100 THEN u% = 100 OUT portb, u%* 2.55 WHILE (TIMER -t) 100 THEN u% = 100 OUT portb, u%* 2.55 WHILE (TIMER -t)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started