Giter Site home page Giter Site logo

laytoder / micromouse Goto Github PK

View Code? Open in Web Editor NEW

This project forked from teslalakshya/micromouse

0.0 1.0 0.0 76 KB

Code written in a micromouse project. Includes techniques used for multithreading arduino and modified flood fill implementations.

C++ 100.00%

micromouse's Introduction

Micromouse(Jerry)

This code was written for a micromouse contest held in a World Robotics Festival called Technoxian. The project was written in a hurry and so the code is very unorganized, extremely sorry for that.

Initially during the development, stepper motors were used along with an arduino uno as the microcontroller. The arduino had to be multithreaded in order to control the acceleration of the steppers simultaneously. This required the creation of two continuous PWD(Pulse Width Modulation) signals that can be controlled seperately. This wasn't directly possible using an arduino uno because the arduino runs on a single looping cycle which is sufficient for generating only a single PWD signal. Software multithreading techniques were definitely a solution here but, after implementing them promising results weren't obtained. Finally, I discovered that the arduino itself comes equipped with PWD pins which can be manipulated using some registers and concepts related to interruptions. Basically, manipulation in the bits stored in some registers controlled the interruptions which were responsible for generating the desired frequency mapped to acceleration for a particular PWD signal. Finally, I was able to use this concept to establish simultaneous control over my stepper.

Moving on, I implemented the popular flood fill navigation technique to map out the maze and eventually figure out the shortest traversal path. My micromuse was finally ready, I just needed to replace my test steppers with a smaller version of them so as to be in the size constraints. I had ordered the smaller steppers online which were supposed to arrive 8 days before the competition. Unfortunately, one of my smaller steppers turned out to be defected putting me in extreme trouble.

I had 7 days left but still, very unrealistically, I restarted the project. I decided to use the usual, small DC motors readily available in my local market. Usage of steppers eliminates the requirement for the implementation of a PID(Praportional Integral Derivative) control mechanism because they are already precise and accurate in their movement. PID, essentially, helps in maintaining a straight path for the robot and because steppers are precise two simultaneous steppers scarcely differ in movement. For a DC motor, however, a slight variation in current could produce significant differences leading to an imbalance between the two motors controlling the wheels, ultimately deviating the robot from its path. Subsequently, over the course of 7 days, I learnt the PID algorithm and tried to implement it. Unfortunately, I ran out of time and the results produced were not that promising. Nevertheless, we learn a lot and I guess that's what matters in the end.

micromouse's People

Contributors

teslalakshya avatar laytoder avatar

Watchers

James Cloos 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.