bonsai-vplink

Simple Tank VP Link model

The Simple tank model demonstrates the basics of a level control loop with Bonsai. While Bonsai is often used to provide setpoint guidance in a real-world deployment, this example assumes that Bonsai will be doing the direct control of the final element. A coming example will show how Bonsai can work with an existing controller to improve or modify its performance over a range of target control philosophies.

The process is illustrated below. Your mission, should you choose to accept it, is to build a brain that controls the two Action tags in order to bring the level as measured in LI100 close to the setpoint as given in LI100_SP for any given setpoint between 5% and 95% without overflowing the tank or letting it get empty. Use the supplied VP Link loadable to create your Bonsai Simulator. Read the supplied process description for more information about how the process works. This may give you some ideas about how to design your brain.

If you just want to see something working, use the supplied Inkling file and follow the instructions below to train a brain.

State Tags

Action Tags

Creating a simulator

Upload the loadable to create a sim

Create a brain

A very simple lesson (for people) that covers the entire state of interest

lesson StartFromRandomLevel { # Scenarios set the values in the SimConfig to drive the starting state scenario { # configNumber: < 1, 2, 3, > _configNumber: 0, # deprecated _initialConditions: “”, _timeStep: 5, _reportEvery: 15, LI100: number <20..90 step 2>, # BRAIN needs to see all sorts of starting levels… LI100_SP: number <20..80 step 1>, # …and a variety of starting sepoints. } } ```

For VP Link Users

If you have VP Link installed locally, you can use the SimpleTank.rev file to run the simulation locally. Ensure that the tools are installed and try the following to build a new loadable that can improve the training performance of the brain.

In the sample model, only the current level is sent in the state to the brain. It might be useful if the brain also knew if the level was going up or down. You can include some historical values from previous time steps in the SimState by simply setting a value in the History column of the Bonsai Interface page. Below are the steps to create a new loadable that has the current level and the level from the previous time step.

Further investigation

Once you have your brain trained, perform an assessment. Do you see any difference in how the Bonsai brain controls the valves vs. how a PID controller might do it? If you are a VP Link user, put the XV101 valve in manual during the assessment. This will remove the ability of Bonsai to control it. How does the brain perform when it has the proverbial “arm tied behind its back”?