Git Product home page Git Product logo

tiva-motion-module's Introduction

TIVA-Motion-Module

DC motor control with TM4C123. Each board controls 2 motors independently and can talk to other boards

Use Cases

  • A base module for a differential drive robot.
  • SCARA-like robot (combine two modules).

Features

  • TM4C123 MCU
  • TB6612FNG motor controller
  • 2 channel encoder interface
  • 2 channel 1A continuous, 1.3A max
  • CAN Bus interface
  • UART interface
  • PID control library

PID control library

The PID control library incorporates the use of an autotuning mechanism using the Nelder-Mead method whereby it searches through R3 space using a simplex model to reduce the scoring function, which in this case is the time it takes to settle.

There are some drawbacks using the Nelder-Mead method because the quality of the search depends on the initial values.

Modifiable Values

The modifiable values for the PID control library are:

  • gen_algo.c->testArray ~ This array stores 4 initial points (P,I,D) to search
  • gen_algo.h->TEST_PERIOD ~ This value is the length of time in cycles to measure the PID response
  • motor.h->MAX_PWM ~ the maximum PWM counts. The range of PWM is from 0 to this value
  • motor.h->TIME_TO_COUNT ~ the time to count the velocity. The encoder interface will wait this length of time to determine the velocity

Useful Function Descriptions

Gen_Algo

  • absolute_to_relative: takes a value from an absolute sensor (orientation/counts) and converts it to a relative value.
  • pid_controller: takes a sensed value and attempts to match it with a given desired value. Includes testing and autotuning algorithms.
  • pid_autotune: auto-tunes the PID values.

Motor

  • setSpeed: sets the speed of the motor based on the pwm counts given.
  • getMotorXCounts: gets the counts from the encoder interface, note that absolute_to_relative function is already applied here
  • getMotorXVelocity: gets the velocity in counts/time from the QEI interface
  • zeroMotorX: zeros the motors and the relative counts

System

  • initAll: calls all the configuration options

UART

  • uartRead: given a char pointer and length to read, reads from UART
  • uartWrite: writes from a char pointer

Known Problems

  • CAN bus interface not fully implemented yet

tiva-motion-module's People

Contributors

benlhy avatar

Stargazers

Nestor D. Pereira Neto avatar  avatar Paul Ludeking avatar

Watchers

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