90 likes | 220 Vues
This guide focuses on implementing a closed-loop control for stabilizing the cathode temperature in an IOC environment. It outlines the creation of a sequence program that monitors the state of the stabilizer and adjusts cathode current based on the current temperature reading. The proportional control algorithm is explained, and debugging steps are provided to address potential errors encountered during the initial run. Additionally, instructions for setting up a new development environment and booting up the IOC are outlined to help familiarize users with the system.
E N D
Lab #3State Notation Language • Real Life Example #3 : It is apparent from previous studies that the cathode temperature requires stabilization. Although this has been accomplished via closed-loop control from the workstation, a better permanent solution is to implement the closed loop control on the ioc using the sequencer. • Create a sequence program that : • Monitors the state studnt_:OP:stabilizerC • When studnt_:OP:stabilizerC changes from 0 to 1, use the current reading of studnt_:cathodeTempM as the setpoint and maintain that setpoint by varying studnt_:cathodeCurrentC. Proportional Control Algorithm : CTL[T+1] = CTL[T] + (GAIN * (SETPOINT - MEASURED)) • Stop the algorithm when studnt_:OP:stabilizerC goes to 0. • Print messages to studnt_:OP:stabilizerMsg to inform the operator of sequence status. • Test your results using the StripTool.
SNL Development and Test • A skeleton program has been provided for you in ~/ioc/linac/linacApp/src/stabilizer.st . After editing this file, type gnumake to compile it. • Edit the startup file to remove the # in front of the following lines : #ld < stabilizer.o #seq &stabilizer, "user=studnt_" • The first time the sequence program runs, you will get the following error : 0xnnnnn (stabilizer): 3 of 4 assigned channels have connected • Use seqShow, seqShow <taskId>, and seqChanShow <taskId> to debug this problem
SNL Development and Test • To load a new version of the state program, use the following commands from the ioc console (instead of rebooting) : • seqShow • td <stabilizer_task_id> • ld < stabilizer.o • seq &stabilizer, "user=studnt_" • Additional helps for the vxWorks shell • Esc k/Esc j - cycles through previous commands • vi commands can be used to edit command line • i - insert; x - delete char • l - move cursor right; h - move cursor left • r - replace single character; R - replace characters
Development Environment • Create a new development area as follows : • Execute the commands cd ~/ioc mkdir example cd example <path>/makeBaseApp.pl -t example example <path>/makeBaseApp.pl -i -t example example where <path> = /usr/local/epics/baseR3.13.1.1/bin/solaris
Development Environment • The first command creates: <top>/ Makefile config/ ... exampleApp src/ ... Db/ ... • The second command creates: <top>/iocBoot Makefile iocexample/ …
Development Environment • Each command can be issued multiple times to create additional iocxxx or xxxApp directories • Examine the following … • example/config/RELEASE • exampleApp/src/baseLIBOBJS • exampleApp/src/base.dbd • exampleApp/src/exampleInclude.dbd • exampleApp/src/Makefile.Host • exampleApp/src/Makefile.Vx • exampleApp/Db/dbExample* • exampleApp/Db/ Makefile.Host
Development Environment • Boot your ioc from this area and familiarize yourself with the example databases and sequence program . • example/iocBoot/iocexample/st.cmd