GithubHelp home page GithubHelp logo

weizx208 / mechaduino-firmware Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jcchurch13/mechaduino-firmware

0.0 2.0 0.0 10.84 MB

Hardware available here:

Home Page: http://tropical-labs.com

License: Other

C++ 88.72% C 11.28%

mechaduino-firmware's Introduction

image

New release 11/26/2018! The calibration table is now stored in flash memory! (Many thanks to osresearch!) We've also fixed a couple of small bugs. Here are some preliminary instructions on how to get your Mechaduino up and running. For more details, see the Mechaduino Manual above!

image

Bootloader:

You will need to make sure your Mechaduino has the latest Arduino Zero bootloader. If you got your Mechaduino from Tropical Labs, it will already have this! Otherwise you will need an Atmel-ICE or similar SWD programmer...

Firmware:

Compile the Mechaduino firmware in the Arduino IDE and upload to your Mechaduino. (Mechaduino will appear as an Arduino Zero.)

New firmware is in the default "master" branch. Older versions are available here.

Calibration Routine:

The first thing you will need to do is run the encoder calibration routine.

With the Mechaduino connected to your computer, open a serial monitor (115200 baud) in the Arduino IDE. You will need to provide V+ to the Mechaduino to power the motor drivers (needed to calibrate). A menu should appear explaining the basic commands (you can call the menu up at any time by typing 'm'). Type "s" and press enter a couple times to verify that everything is working. The Mechaduino should step like a stepper. It is currently in open loop mode. press "d" and the stepping direction will change.

Now, make sure nothing will touch the Mechaduino’s shaft during the calibration routine. If possible, completely disconnect any load that is attached to the Mechaduino’s shaft. Type "c" to start the calibration routine. The Mechaduino will now step through all full steps to calibrate the encoder. In the latest version of the firmware, the calibration table will automatically be stored in non-volatile flash memory. When this routine is complete, your Mechaduino is now calibrated!

Basic Commands:

As long as you have "serialCheck();" in your main loop, you can use the following built in commands to control the mechaduino from a serial monitor:

s - step (steps one full step in open loop mode)

d - dir (changes step direction in open loop mode)

p - print angle [step count] , [assumed angle] , [encoder reading]

c - calibration routine

e - check encoder diagnostics

q - parameter query (prints current PID values and cal table)

x - position mode

v - velocity mode

t - torque mode

y - enable control loop (enter closed loop mode)

n - disable control loop (go back to open loop mode)

r - enter new setpoint (new setpoint for control loop)

j - step response

k - edit controller gains*

g - generate sine commutation table

m - print main menu

...see serialCheck() in Utils for more details

##License

All Mechaduino related materials are released under the Creative Commons Attribution Share-Alike 4.0 License

mechaduino-firmware's People

Contributors

jcchurch13 avatar osresearch avatar

Watchers

 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.