Giter VIP home page Giter VIP logo

motor_control's Introduction

Motor Control Project

Prototype that controls a motor, get environment information and send it to an online database (firebase).

This project is a turnkey automation of a hopper in a industry. It consists of hardware development of the board, development of the firmware that manages the system, and a web app that supervise and control the operation. Basically, the board is able to control the motor, gather temperature and humidity information and send/receive data to/from a firebase database. How the system works is better explained in firmware section.


1. How to get things running

1.1. Hardware

First it is necessary to fabricate and mount the board:

  1. Send GERBER files provided in hardware section to a PCB factory;
  2. Buy components listed in BOM files;
  3. Solder components in the board;

P.S.: It will be also necessary to buy a 5V power adapter (micro USB) to provide power to the board.

1.2. Web

Concurrently with hardware fabrication we can create a firebase project. We chose firebase because of its scalability and the built-in functions such as authentication and hosting. There are some limitations in free plan, as shown here. For MVP purposes, we will not be even closer to those limitations, but we can upgrade our plan if necessary.
To create a project we need to have a google account, if you use Gmail, you already have one. Then access this page, log in and create a Realtime Database (ust follows the steps in the tutorials, Google documentation is pretty awesome). Then, add Firebase to your web app following these instructions. Attention! In step 3, the HTMLs already have the SDKs. However, it is necessary to copy the snippet of our app's Firebase config object in the first line of /web/js/main.js. After deploying the web app, we are ready!

1.3. Firmware

After mounting the hardware and deploying the web app, we are ready to build and flash the program in the ESP32.

1.3.1. Build

  1. Install the Espressif IoT Development Framework or link
  2. Make sure that the USB to UART driver of the development board is installed. In our case, the board uses CP2102
  3. Clone this repo: git clone ...
  4. Inside the firmware folder, configure: make menuconfig
  5. Build: make all
  6. Flash: make flash
  • Build & flash & monitor: make flash monitor

P.S.: If you get an error like: "make" is not recognized as a internal or external command. Try to use idf.py instead of make command.

Note: In step 3 you need to change some config values, for example:

  • Serial flasher config.
    • Default serial port: Type the port at which the ESP32 is connected (e.g. COM3). If this option does not appear, just ignore it, the port will be automatically detected.
    • Default baud rate: Select 921600 for a faster flashing time.
  • Motor Configuration.
    • Motor Value: Type the firebase child at which this ESP32 will send its data (e.g. motor_2).
    • Firebase address: Type the firabase address without 'http://' (e.g. name_project.firebaseio.com).
    • (Optional) Change the SP Time in seconds value (It can be changed later via web app).
    • Timezone: Select the time zone accordingly to your region.
    • (Optional) Log prints for Debug, check it only if you want to see debug logs using the command prompt.
  • Example Connection Configuration
    • Connect using: Select WiFi.
    • WiFi SSID: Type the SSID of your WiFi station.
    • WiFi Password: Type the password of your WiFi station.

Save the changes and proceed to step 4.

1.4. Future Implementations

  • Update the daily and continuous operating times upon booting. Useful if the systems crashes during the day, because when it restarts it resets these values.
  • Every night at midnight, send the daily operating times to the server. Create a page on web app to display these values in bar graph format.
  • Implement a supervisor to reset the system if have problems with WiFi connection.

motor_control's People

Contributors

clfregis avatar

Stargazers

 avatar  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.