Skip to content

Setup and Calibration_Actuators

Jason von Nieda edited this page Nov 8, 2022 · 1 revision

Actuators

Actuators are generic devices you can attach to your machine to do additional tasks not covered by Nozzles and Cameras. For instance, you can use a solenoid with a pin attached to the head to drag a tape forward to feed it. You can also use Actuators to read values from sensors attached to the machine.

Some of the things OpenPnP uses Actuators for are:

Using the Scripting system you can use Actuators to extend OpenPnP to control a wide array of devices and sensors.

Adding Actuators

  1. Open the Machine Setup tab.

    • If you are adding a head mounted actuator, find the head in the tree on the left. Under the head look for Actuators and select it. Head mounted actuators are often attached to devices such as down-looking camera lights, vacuum valves, drag feed solenoids and nozzle change tools.
    • If you are adding a machine mounted actuator, find Actuators under the root of the tree and select it. Machine mounted actuators can be used for things like up-looking camera lighting and conveyors.
  2. Add an actuator by pressing the green plus button:

    Add Actuator

  3. Select an actuator implementation from the provided list and press the "Accept" button.

    Select Actuator Type

  4. The newly added actuator will show up in the actuators list. Click on new actuator to open its properties.

    newly Created Actuator

  5. Best immediately set the actuator Name.

Actuator Settings

Driver Assignment

This only applies to the ReferenceActuator.

Driver selects which driver i.e which connected controller is executing the commands needed to actuate or read the Actuator.

Actuator Value Type

Each Actuator has a Value Type field.

Actuator value type

Actuator value type help

The Value Type mostly controls how values are edited in the GUI. It does not force the actuator function to actually use that value type. If existing functional actuator assignments in the Machine Setup, or Scripts or G-code use different or even mixed actuator value types, it should still work as before. The Value Type will automatically be proposed when an actuator is first used in a functional assignment.

For the Double or String value type, a pair of ON and OFF default values appear:

Default ON OFF values

These will be actuated, when Boolean semantics is used to control an actuator e.g. for an actuator that can be set to a specific scalar value (e.g. a LED light intensity), but also can be switched ON/OFF to specific preset ON/OFF values.

Actuator Machine Coordination

Theses settings determine how actuator actuation/reading is coordinated with machine motion. The options are best explained in the context of their application on the Motion Planner page.

Actuator Machine States

Actuator Machine States

The Enabled, Homed, Disabled machine state actuation settings can be used to assume or actuate specific ON/OFF values when these machine states are entered.

  • LeaveAsIs leaves the actuator state at its previous state (maybe the unknown state).
  • AssumeUnknown sets the actuator state to unknown. OpenPnP will not know the state until it has first actuated the actuator.
  • AssumeActuatedOn or AssumeActuatedOff assumes that the machine state has changed the actuator state to ON / OFF respectively (as a definitive side effect of the machine state change or perhaps via custom G-code).
  • ActuateON or ActuateOFF bring the actuator to a desired defined ON / OFF state when the machine state is entered.

NOTE: Enabled and Homed actuation happens after the new machine state is reached i.e. after all the enabling or homing commands have beed executed. However, the Disabled actuation happens before the new machine state is reached, i.e. before any disabling commands are executed.

Actuator with Profiles

The Profile actuator value type is typically used when you want to control multiple other actuators in concert. As an example consider a camera light that can control the Red, Green, Blue channel intensities separately. A set of predefined profiles can be used to control such a multi-channel actuator in a consisent way across the application e.g. in many Pipelines (see the usage in computer vision i.e. the ImageCapture Pipeline stage).

Once you have selected the Profile actuator value type, press Apply. A new "Profiles" Wizard tab will appear:

Profiles Wizard tabl

You can assign up to 6 target actuators to be controlled by the profile. Again press Apply for new target actuators to appear as columns in the table.

New profiles can be created using the Plus button, or deleted using the Delete button.

A Profile will become active once you assign a Name.

The Default ON and Default OFF checkboxes control which profile will be selected when the actuator is driven using Boolean semantics. Obviously, the checks are (mutually) exclusive.

NOTES:

If the target Actuator is itself a Profile type actuator, it will be driven as a String value (to prevent endless recursion). Using the actuator itself as a target actuator is therefore explicitly supported. Using this technique, you can create self-contained multiple choice actuators. One application example would be a scalar actuator e.g. a light actuator with intensity control (perhaps by PWM). Using a limited set of profile entries you can drive it to specific step values, a bit like the f-stops in photography. Usage becomes more reproducible and values can be centrally maintained.

Stepped Profile Actuator

Even though a profile target actuator is driven as a String value, you can still effectively drive Double values as well. Just enter them as Strings. It won't make a difference in effective GcodeDriver or HttpActuator encoding, and in ScriptActuators you can convert the values inside the script.

Actuator Control Panel

Open the Actuator Control Panel on the Machine Controls/Actuators tab:

Actuators Tab

The Actuator Control Panels will now display Value Type specific GUI controls:

Double Actuator Dialog

Boolean Actuator Dialog

Profile Actuator Dialog

NOTE: if the Default ON and Default OFF values are defined as explained above, the On and Off buttons will appear in addition to the typed value field.

ReferenceActuator

This applies to the ReferenceActuator, for the other types please see the corresponding sections below.

Assigning Commands

Once you've created and assigned an Actuator, you will generally need to assign commands to it. Some actuators may also have been created for you automatically (e.g. by the Nozzle Solution). The most common case is using GcodeDriver/GcodeAsyncDriver and boolean actuators to control something like a switch, a solenoid, a pump, a valve, etc.

In newer versions of OpenPnP, you get support by Issues and Solutions to interactively set the Gcode commands. As of this writing, G-code command and regex support is enabled for Vacuum Valve, Blow-Off, Vacuum Sense, Pump, Z-Probe, Camera Light actuators. Make sure the actuator is already assigned in its role, so Issues & Solutions knows which functions are needed. Press Find Issues & Solutions to refresh the suggestions, if you just assigned a new actuator:

Actuator G-code Issues

Use the drop-down to select a template. Placeholders ❓ stand for G-code command numbers and regexes that cannot be fully suggested, because they are typically highly machine/controller/configuration specific:

Placeholder

Note, once set the solutions will disappear from the list. If you ever want to come back, you must delete (empty) the commands manually (as explained in the next section) and then press Find Issues & Solutions again.

Assigning Commands Manually

For manual setup or other actuators, follow the following procedures.

To set the Gcode for a Boolean Actuator:

  1. Go to Machine Setup -> Driver -> GcodeDriver/GcodeAsyncDriver -> Gcode.
  2. Select the Actuator from the dropdown menu.
  3. Select the ACTUATE_BOOLEAN command.
  4. Enter the Gcode fragment. An example would be {True:M801}{False:M800}. This will send M801 when the Actuator is turned on, and M800 when it is turned off. The text after True: or False: is what will actually be sent.

Here is an example for the vacuum valve:

Example for cmd assignment

To set the Gcode for a Double Actuator:

  1. Go to Machine Setup -> Driver -> GcodeDriver/GcodeAsyncDriver -> Gcode.
  2. Select the Actuator from the dropdown menu.
  3. Select the ACTUATE_DOUBLE command.
  4. Enter the Gcode fragment. An example would be M104 {DoubleValue}.

Reading Sensors

This applies to the ReferenceActuator, for the other types please see the corresponding sections below.

Another common use of Actuators is to read a sensor, with vacuum level sensors being the most common. To read a sensor using the GcodeDriver/GcodeAsyncDriver the steps are a little different than the above.

To set the Gcode for an Actuator that reads a sensor:

  1. Go to Machine Setup -> Driver -> GcodeDriver -> Gcode.
  2. Select the Actuator from the dropdown menu.
  3. Select the ACTUATOR_READ_COMMAND command.
  4. Enter the Gcode fragment. This should be whatever command you need to send to your controller to cause it to respond with the sensor value.
  5. Select the ACTUATOR_READ_REGEX.
  6. Enter a regex that matches the response that will come from the controller.

GcodeDriver

(and GcodeAsyncDriver)

See actuate-boolean-command

See actuate-double-command

See actuator-read-command

See actuator-read-regex

HttpActuator

The HttpActuator can control actuators by sending/reading HTTP requests.

If the Actuator has Boolean value type, the On URL and Off URL can be separately defined:

grafik

If the Actuator has Double or String value type, it has a Parametric URL field with a placeholder {val} that can encode the value into the URL. You can use formatting in the form of e.g. {val:%.4f} (like in the GcodeDriver):

HttpActuator

NOTE: no URI-escaping is performed on String values, you can therefore enclose complex URI fragments such as multiple parameters at once.

Script Actuator

The ScriptActuator can execute a script with the given value as a parameter. The parameter is made available as actuateBoolean, actuateDouble or actuateString global, according to the Value Type.

ScriptActuator

For more info on ScriptActuators and an example click here

Head Offsets

See Setting Head Offsets for the general process. It is basically the same for Actuators.


Previous Step Jump To Next Step
Nozzle Setup Table of Contents Vacuum Setup
Clone this wiki locally