Firmware Design

Point to Actuation Code

Overview

The firmware, developed using the Arduino IDE with the AccelStepper library, manages precise motor actuation based on target coordinates. It calculates cable lengths, translates them into motor steps, and ensures synchronized motion to keep the board within the frame boundaries. Key functions like setCurrentPosition and calculateLengths enable accurate control, while a structured pipeline handles initialization, coordinate input, and smooth movement execution.

External Firmware Dependencies:

  • AccelStepper
    Arduino library for controlling stepper motors.
  • MultiStepper (subsection of multi stepper)
    Arduino library for synchronized control of multiple steppers.

Detailed descriptions of their methods can be found at: https://hackaday.io/project/183279-accelstepper-the-missing-manual/details. Here is a description of the key functions from the AccelStepper and MultiStepper libraries.

Sets the current position of a stepper motor in steps. Used in setup to define the initial positions of the motors.

Computes the target step positions for each motor to move the board to a specific (x,y) coordinate. Takes targetX and targetY as inputs, and uses the pythagorean theorem to calculate the cable length from each motor to the target position, considering the dimensions of the board.

Moves the motors to their specified target positions at a constant speed. Handles acceleration and deceleration as motors approach their targets, preventing overshooting.

Firmware Pipeline

Mobirise Website Builder

Initialization

1

Initialize Motors

Stepper motors are defined and added to a Multistepper object for synchronized motion
2

Set Max Speed

Maximum speed is set for all motors to 3000 steps per seconds
3

Zero Motors

Motors are zeroed by setting their initial positions (in steps) corresponding to their starting locations)

Point to Actuation

1

Monitor Serial

Continuously check for coordinate input from the serial monitor
2

Constrain Coordinates

Validates and constrains the target coordinates to keep the board within the frame’s boundaries
3

Calculate Cable Lengths

Calculate the lengths of the cable required for each motor based on the target coordinates using the Pythagorean theorem.
4

Convert to Steps

Convert the cable lengths to motor steps using a pre-configured steps-to-inch ratio
5

Motor Actuation

Move the motors synchronously to the calculated cable lengths

6

Pause

Pause for 2 seconds at target position
7

Calculate Cable Lengths

Calculate the step positions for the motors to move the board to the center of the frame
8

Recenter Actuation

Move the motors synchronously to the center position

© Copyright 404: Swish Not Found. All Rights Reserved.

Website Builder Software