Coder Social home page Coder Social logo

timebot's Introduction

Timebot: The 2-DOF Parallel Plotting robot

Here you will find the program used to write the time to a whiteboard using a 2-DOF Parallel robot created in Boston University's ME360 course.

Plotter Configuration

You can find the configuration file which controls various parameters and settings based on the geometry of the robot and the electronics setup in src/config.h. The following parameters can be modified to suit various configurations:

#define CLOCK_NUM_DIGITS 4

#define EFFECTOR_PIN 9
#define EFFECTOR_TRAVEL_DEGREES 20
#define EFFECTOR_OFFSET_DEGREES 20
#define EFFECTOR_TRAVEL_TIME 200

#define STEPPER_1_PIN_1 2
#define STEPPER_1_PIN_2 5

#define STEPPER_2_PIN_1 3
#define STEPPER_2_PIN_2 6

#define STEPPER_MAX_SPEED 100.0   // mm/s

#define PITCH_DIAM_PULLEY 12.7 // mm
#define STEPS_PER_REV 800.0

#define PLOTTER_LINK_LENGTH 125 // mm
#define IDLER_WIDTH 52.85 // mm
#define ERASER_OFFSET 32.0 // mm

#define DIGIT_WIDTH 10.0 // mm
#define DIGIT_HEIGHT 20.0 // mm
#define DIGIT_SPACING 1.74 * DIGIT_WIDTH // mm
#define DELIMITER_HEIGHT 15.0 // mm
#define NUM_SEGMENTS 7

Program Overview

The Plotter class (found in src/plotter.h) controls the motion of the robot. The methods contained in the Plotter class are listed below:

Plotter();
bool moveDone();
void setSpeed(float);
void home(float);
void move(float, float);
void moveTo(float, float);
bool run();
bool runSpeedToPosition();
void drawDigit(Digit, float, float);
void eraseDigit(Digit, float, float);
void drawClock(Clock *, float, float);
void eraseClock(Clock *, float, float);
void eraseBoard(float, float, float, float);
void drawDelimiter(Delimiter *, float, float);

The Clock class (found in src/clock.h) stores geometric information that describes the layout of the alphanumeric clock which is plotted by the robot. The member variables stored in the Clock class are listed below:

class Clock {
    public:
    Clock();

    Digit digits[CLOCK_NUM_DIGITS];
    Delimiter delimiter;
    
};

The Delimeter and Digit classes (found in src/clock.h) are used to define the geometry of the delimiter and digits in the clock alphanumeric display. The Digit and Delimiter classes are defined as follows:

class Digit {
    public:
    Digit();

    public:
    void setDigit(uint8_t);
    void reset();
    Segment segments[NUM_SEGMENTS];
};

class Delimiter {
    public:
    Delimiter();

    public:
    Point bottom;
    Point top;
};

Digits are made of segments consisting of a Point class storing the x and y coordinate. The start point and end point define a line segment. The Point and Segment classes are found in src/clock.h and have the following structure:

struct Point {
    float x_mm;
    float y_mm;
};

struct Segment {
    Point start;
    Point end;
    bool isActive = false;
};

Copyright 2021 Peter Siegel [email protected]

timebot's People

Watchers

Peter Siegel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.