Giter Site home page Giter Site logo

askmuhsin / car-controller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jabelone/car-controller

1.0 3.0 0.0 15 KB

A serial (UART) based firmware for an arduino that outputs a PWM signal for steering and motor control, also monitors battery voltage.

Home Page: http://jabelone.com.au/blog/make-autonomous-car-code-included/

Arduino 100.00%

car-controller's Introduction

Car Controller

This project provides firmware that runs on an arduino. This firmware, coupled with an arduino, provides a serial (UART) interface for outputting PWM signals. Something like a raspberry pi has lots of processing power and I/O; but it can't reliably drive PWM outputs for servos etc. Due to the PWM being done in software, any slight lag will effect the precise timing required.

By sending the steering and motor outputs over UART to a real time microcontroller, reliability can be ensured. This is because these microcontrollers are specifically designed for stuff like this with very precise timing. The firmware also reports the voltage of a battery; which is great for remote monitoring and safety. I created this for use in our machine learning car.

##Click the video below to see it in action! IMAGE ALT TEXT

Setup

It's fairly straight forward to use. The PWM output and voltage monitoring pins are in configurable variables at the start of the program. Specify which pins you're using; bear in mind the voltage monitor must be an analog input.

Voltage Monitoring

If the maximum voltage of the battery is less than your microcontroller's operating voltage no extra hardware is needed. Just splice a wire into where you want to measure and connect it to the arduino's pin. For LiPo and other multi cell batteries, it is generally only necessary to monitor a single cell. Simply tap into the first cell on the balance connector. If you need a higher voltage lookup how to make a voltage divider to measure battery on arduino.

Steering/Motor Driver

Steering

The steering pin will output a PWM signal using Ardiuno's built in servo library. It will drive practically any servo.

Motor Controller

The motor controller pin will output a PWM signal using the arduino servo library. This means it will drive most servos (ie throttle for an IC engine) or most ESC's.

Usage

You can send it two commands via UART, "motor,x" to control motor output and "steer,x". X is usually a value between 40 and 150 as the input centers around 90. Car-controller also continusously sends back a measured voltage over the UART when the correct flag is set. If the debug flag is set to true when uploaded, it sends debug messages over UART.

License

As with all my projects this is released under a GNU GPLv3 or later license in the hope it will be useful.

References

This is what we used in Kendricks Suiron project. Checkout my detailed blog post showing this in action! (link)

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.