Git Product home page Git Product logo

candrive's Introduction

CANDrive CI Quality Gate Status Coverage

CANDrive

CANDrive is a brushed DC Motor Controller controlled via a CAN interface.

Features

  • Velocity control
  • Torque control
  • CAN interface
  • Firmware updates over CAN
  • Emergency stop
  • 5 A output current
  • 12-24 V supply voltage

Getting started

Getting the Source

This project is hosted on GitHub. You can clone this project directly using this command:

git clone --recurse-submodules https://github.com/Andreasdahlberg/CANDrive.git

Building

scons build-opencm
scons build

Running Tests

Run all tests with valgrind:

scons test

Run a single test suite:

scons app/motor/test && build/motor/test/TestRunner

Run a single unit test:

scons app/motor/test && build/motor/test/TestRunner test_Motor_SetSpeed

Tools

Monitor

The monitor tool is a serial terminal which parses serial output from the device and formats the output to make it easier to read. It also incorporates a simple command line used for debug commands and device configuration. The debug commands are not intended for controlling the motors during normal operation since they bypass several of the safety features.

Features
  • Host timestamps
  • Color coded debug levels
  • Translation from addresses to file and line
  • Command line
  • Filtering[Not implemented]

Example of monitor output

Usage

The monitor is started by typing scons monitor. Serial port and baudrate can be configured here or on the command line, e.g. scons monitor SERIAL_PORT=/dev/ttyACM0 BAUD_RATE=921600

The serial port used by the monitor is available at JP1 and is disabled by default. It can be enabled by moving jumper J1.

Available commands
rpm

rpm [MOTOR_INDEX] [RPM]

Ex.

CANDrive> rpm 0 50
current

current [MOTOR_INDEX] [CURRENT]

Ex.

CANDrive> current 1 1500
run

run [MOTOR_INDEX]

Ex.

CANDrive> run 0
coast

coast [MOTOR_INDEX]

Ex.

CANDrive> coast 0
brake

brake [MOTOR_INDEX]

Ex.

CANDrive> brake 0
reset

reset

Ex.

CANDrive> reset
level

level [MODULE] [LEVEL]

Ex.

CANDrive> level App 10
store

store [PARAMETER] [VALUE]

Ex.

CANDrive> store number_of_motors 1

Hardware

BOM

candrive's People

Contributors

andreasdahlberg avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

koson

candrive's Issues

Segmentation fault when running a single console test

Description
Segmentation fault occurs when running a single console unit test.

Steps to reproduce

  1. scons app/console/test
  2. build/console/test/TestRunner test_Console_InvalidArguments

Expected result
A passed test.

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.