Coder Social home page Coder Social logo

ball-beam-pid-control's Introduction

BALL AND BEAM PROJECT

DESCRIPTION

SETPOINT MODES

    1. Static: programmed (first )
    1. Sequence 2 point: programmed
    1. Sequence slow wave: programmed
    1. potentiometer:
    1. hand mirroring:
    1. serial port read

Programming course

  • read distance from laser VL53L0X and printout to serial

Servo motor

Laser distance sensor

Hardware, Software, Simulation for Ball Beam PID Control. FreeCAD, Arduino, Python, Jupyter, Binder

nastavljanje servo motorja

  • servo motor ima možnost gibanja med 0 in 180°

  • servo motor je nastavljen, da ima 90° za izhodiščno točko. to pa zato, ker bo krmiljen v + in v -. Zato ne sme biti na 0°. ker potem, če bi mu ukazali, premakni se v minus. se ne bi mogle.

  • napiše se funkcija, da bo imel gibanje med -20° < angle < +20°

ARDUINO CODE

  • #include "Adafruit_VL53L0X.h"

    PROGRAMSKE SPECIFIKACIJE ZA KNJIžNJICO https://documentation.help/VL53L0X-API/index.html

  • Using Serial Monitor to Control Servo Motor

  • moving avarage library

  • arduino library: FastPID - A fast 32-bit fixed-point PID controller for Arduino

    https://github.com/mike-matera/FastPID

    Moving avarage library example

    // Include lib:
    #include <MovingAverage.h>
    
    // Create an Arithmetic Moving Average object of unsigned int type,
    // 10 in size
    // and initialize it with value 2
    MovingAverage<unsigned> test(10, 2);
    
    // This variable just generates input for average test
    unsigned delta_x = 0;
    
    void setup() {
      // Initialize serial interface
      Serial.begin(9600);
    }
    
    void loop() {
      // Pushes the input in the moving average object
      test.push(delta_x);
    
      // Generates the next input
      delta_x += 5;
      if (delta_x > 1000) delta_x = 0;
    
      // Prints each value stored in the moving average
      for (uint8_t i = 0; i < test.size(); i++) {
        Serial.print(test[i]);
        Serial.print(" ");
      }
      // Prints the result of the average
      Serial.print("= ");
      Serial.print(test.get());
      // Prints the value stored in the first and last indexes
      Serial.print(" | f: ");
      Serial.print(test.front());
      Serial.print(" b: ");
      Serial.println(test.back());
    
      delay(1000);
    }
    

Reading Distance: Sensor VL53L0X - OK

  • code

arduino code

Reading distance and smoothing avarage

ball-beam-pid-control's People

Contributors

crtomirjuren avatar

Stargazers

 avatar  avatar

Watchers

 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.