Skip to content

Function description

MoudyAshi edited this page Jun 23, 2026 · 1 revision

Functions to control luke

This page serves as a technical reference API detailing the internal classes, modules, and functions used to control the Luke Robot Arm.


Luke Class Reference

#include "Luke.h"

Function & Syntax Returns Description
Luke(uint16_t LeadScrewLength) Constructor Instantiates the core class framework and caches the physical millimeter travel range of the vertical lead screw.
initialize(uint8_t GripperType) bool Powers up the system and registers the active tool attachment style (1DOF for standard gripper, 2DOF advanced gripper).
homeDC() bool Drives the vertical linear lead screw down to its physical seat to zero out its reference point.
calibrateDC() void Drives the vertical carriage up to the top mechanical limit, then down to the bottom, counting raw pulses to calculate the exact pulses-per-millimeter scaling.
calibrateServos() bool Scans structural servo rotation boundaries by driving them to their physical limits and automatically calculating their midpoints.
moveRobotCartesian(float requiredX, float requiredY, float requiredZ) bool Drives the arm carriage to absolute 3D coordinate space targets (X, Y, Z in mm) relative to the base center using inverse kinematics.
moveRobotJoints(byte numberOfServos, byte id[], float angles[], float displacement) bool Low-level access method targeting manual multi-servo angles and raw lead screw linear displacement steps simultaneously.
dcUpDown(float mm, float speed, bool dir) bool Explicitly targets the vertical linear motor to travel a set millimeter distance along its 20-degree inclined layout at a set speed (0-1) and direction (0 for up, 1 for down).
grip(int openLimit = -1, int gripTorque = grippingTorque) void Controls end-effector closure boundaries (0 for fully closed, higher for open thresholds) and sets maximum holding torque profiles to prevent crushing objects.
isRobotMoving() bool Queries real-time hardware tracking lines to verify active motor workloads. Returns true if any servo is disconnected or currently moving.
getPosition(byte id) float Returns the real-time physical step positioning metric (0 to 4096) for a targeted motor address.
ledStrip(int r, int g, int b) void Manages the on-board RGB indicator status lighting configuration values (0-255 scaling per color channel) for error tracking and states.
fanControl(bool state) void Directly toggles structural system cooling and thermal dissipation fans on (true) or off (false).

Clone this wiki locally