Vermont Energy Control Systems

Practical monitoring and control for the real world

Rule Programming

Introduction

This document is a guide to programming the Vesta controller: the process of creating, testing, and fine-tuning the rules that determine Vesta behavior. Before using this document, make sure you're familiar with the terms defined in the terminology section of the user's manual.

Important: How to get the most out of this manual (and your Vesta)

PLAY! This is both simple and critical - people learn by doing. Don't just read this manual - play with the Vesta. It's delivered with a sample rule set that's described in the Front Panel Example section of this manual. Try editing rules, deleting rules, and adding new ones. Rename inputs or variables. Delete some. Create new ones. Edit rules to use different inputs or variables. You can't break anything. Mess up everything and try to get back to where you were. Restore the Front Panel example from backup (it's called ledSample).

Rules and Programming

Rule programming is virtually identical for all Vesta models. Differences will be noted where they occur.

Vesta behavior is determined by rules that are created through the user interface. In the simplest case, a rule sets an output (or a variable) to a value when one or more conditions are met.

Here's a screenshot of a sample rule set similar to what's shipped with the Vesta:

A screenshot of simple default rules

Figure 1.1: Sample Rule Set

In the example above there are 8 rules, two of which are simply comments (in blue) to improve readability. The first actual rule is this one:

Set LED1 to TRUE if User Switch Left is true and LED Enable is true

This is an example of a type of rule called a logical rule. This one sets the first front panel LED to true (on) if two conditions are met: User Switch Left must be true and LED Enable must be true. The green dot indicates that this rule is 'triggered' - both conditions have been met, and LED 1 will be on (unless some subsequent rule turns it off). The other icons at the left allow editing and manipulation of the rule.

Note: The 'triggered' indication dot is green on the Vantage and Pro, but red on the Classic.

This example is covered in detail in the Front Panel Example section of this manual.

Rule Types

The Vesta controller has several types of rules:

  1. Math Rules, which set a data element based on a mathematical operation
  2. Differential Rules, which act on a difference between two values
  3. Logical Rules, which act on true/false conditions
  4. Timer Rules, which create timers that can be used with other rules
  5. Schedule Rules, which cause actions to occur on a specified schedule
  6. PID Rules, which allow precise control using variable speed or power.

Each rule type will be described in detail in the following sections.

Rule Editing

Rules are based on templates and are constructed using pull-down selections. The rule editing screen looks like this:

A screenshot of the rule creation tool

Each of the pulldown menus contains only valid choices for the associated field. There is no way to create an invalid rule.

Rule Engine

Rules are evaluated by a periodic task called the rule engine. The rule engine typically runs through the rule set with a frequency of once every minute to as fast as ten times per second. In most applications, once per second is plenty.