-
-
Notifications
You must be signed in to change notification settings - Fork 8
Actuators
An Actuator
is a controller object that can perform a function on something in the physical world. Examples include pumps, heaters, fans, and others. Actuators primarily are concerned with engaging a device at some driving intensity, direction, and optionally for a set time, a lot of which is typically managed by the feeding Scheduler or one of its Balancers.
Actuators come in a variety of types: relay-based binary (on/off, e.g. water heater), relay-based pump (on/off, e.g. water/peristaltic pumps), and PWM-based analog (pulse width modulation, e.g. speed-variable exhaust fan).
- Grow lights: used to bathe the plants in artificial sunlight given their unique zone properties.
- Water pump: primary way of moving liquid around from one reservoir to another.
- Peristaltic dosing pump: used for balancing alkalinity and proper nutrient levels during feedings.
- Water heater: used to warm feed water up to an acceptable temperature (for tropical zoned plants or colder climates).
- Water aerator: used to aerate the feed water before and during feedings.
- Water sprayer/sprinkler: used in the mornings, before grow lights turn on, to dose the plant's leaves in water.
- Fan exhaust/circulation: used for managing the CO2 and/or air temperature of grow tents.
To enable an actuator, you must first grab a proper ActivationHandle
object, which defines that particular activation's setup parameters, and can be thought of as a hallway pass - don't lose it. An ActuatorAttachment
object is helpful in this case since it manages just such an object, but regardless, a call is expected to setupActivation()
prior to enabling that activation with enableActivation()
. A call to disableActivation()
can also be used to deactivate that activation.
Any Actuator
object is free to choose how to respond to activation handles, as there can be numerous different objects that are requesting activation at once, possibly at different driving intensities/directions. Actuators use their enableMode
setting to determine how to resolve these multiple-handle request situations, with the default option being to run all activations in parallel at the highest driving intensity value. Other options include being able to serialize activation, and responding one-by-one in different orderings.
Actuator objects typically will respond to activations on their next update cycle, and will update the activation handle as it runs. Using activations this way instead of directly providing access to the actuator's direct pin outputs allows activations to stack in different ways depending on usage dynamic. Additionally, actuators may have to wait for a chance to enable if there are many devices on a shared power line (e.g. 16 dosing pumps engaging at once is going to give you a bad electrics day), or based on other system dynamics.
Brought to you by the generous support of our Patreons. Please consider a subscription if you find this software useful.