Stepper Acceleration Ramp Generator

Related tags

GUI ramp-maker
Overview

RampMaker - Stepper Acceleration Ramp Generator

crates.io Documentation CI Build

Please consider supporting this project financially. More information below.

About

RampMaker provides implementations of stepper motor acceleration profiles, as well as a trait to abstract over them. Right now only a trapezoidal profile (plus a flat profile for testing) is supported.

RampMaker is part of the Flott motion control toolkit. Also check out Step/Dir, the universal stepper motor interface.

If you're looking for an alternative to this library, you might like stepgen.

Status

RampMaker is under active development. Its API is going to change, as more features are added and existing ones are improved.

The library is usable, but far from mature. Please open an issue on the GitHub repository, if you find any limitations.

RampMaker is maintained by @hannobraun.

Usage

RampMaker is a library written in Rust and designed for use in Rust projects. It will run on any platform supported by Rust, including microcontrollers.

Add Step/Dir to your Cargo.toml like this:

[dependencies.ramp-maker]
version = "0.2" # always use the latest version here

Funding

If you're getting value out of RampMaker or other libraries from the Flott toolkit, please consider supporting us financially. Your sponsorship helps to keep the project healthy and moving forward.

Hanno Braun, maintainer and original creator of this library, is accepting sponsorship.

License

This project is open source software, licensed under the terms of the Zero Clause BSD License (0BSD, for short). This basically means you can do anything with the software, without any restrictions, but you can't hold the authors liable for problems.

See LICENSE.md for full details.

Comments
  • Make trapezoidal ramp generation more flexible

    Make trapezoidal ramp generation more flexible

    Right now, the ramp generation algorithm can only start and end at a speed of zero, which limits the use cases to movements that are completely pre-planned. It should be possible to abort a movement mid-ramp and switch to a different speed, or target a different position.

    I currently don't know how to best approach this. Supporting this capability would definitely require a redesign of the AccelerationProfile trait.

    type: enhancement 
    opened by hannobraun 2
  • Add additional iterators to `MotionProfile`

    Add additional iterators to `MotionProfile`

    In addition to the iterator over delay values, add new iterators over velocity and acceleration values. This is mostly useful for debugging and testing, and makes some utility code used by the tests publicly available.

    opened by hannobraun 0
  • Make `MotionProfile` more powerful and flexible

    Make `MotionProfile` more powerful and flexible

    Updates and extends the MotionProfile trait, making it more powerful and flexible. This is a step towards addressing #5.

    This pull request leaves Trapezoidal in a bit of a weird state, as it now has a more powerful interface without actually being able to support that. It's no worse than before though, so the previous usage patterns will keep working with the new API. I am going to make Trapezoidal more flexible (and address #5 fully) in a follow-up PR.

    opened by hannobraun 0
  • Improve accuracy of trapezoidal motion profile

    Improve accuracy of trapezoidal motion profile

    This uses a more expensive computation, but I think that's the best trade-off for now. I'm currently working on making the motion profiles more flexible, and I'm running into accuracy problems with the trapezoidal ramp. I think it's better for now to just make it accurate and deal with optimization later (if necessary).

    Close #3

    opened by hannobraun 0
  • stopping in the middle

    stopping in the middle

    What if we want to immediately stop while on motion, and respect the acceleration constraint?

    Calling enter_position_mode(0,0) won't work. It will stop the motor abruptly.

    opened by nviennot 1
  • Add support for velocity mode

    Add support for velocity mode

    The current MotionProfile trait only supports moving to a specified position. There should be an additional interface that allows moving at a specific velocity, without a target position:

    pub trait MotionProfile {
        // ...
        fn enter_velocity_mode(&mut self, target_velocity: Self::Velocity);
    }
    

    The trapezoidal ramp generation algorithm should already be able to support this, with some minor prodding. In fact, I think velocity mode can be simulated using position mode, by setting a far-away target step:

    profile.enter_position_mode(target_velocity, 100_000);
    

    And then making sure to repeat that call often enough, so the target step is never actually reached.

    type: enhancement help wanted topic: api 
    opened by hannobraun 2
  • Add testing to verify support for numeric types

    Add testing to verify support for numeric types

    The unit tests use f32, for the sake of convenience (and because it works pretty well on the platforms these unit tests run on). This is fine, but it makes it pretty easy to accidentally introduce trait bounds that are not supported by the fixed-point types, and manual testing is required to catch this.

    #4 proposes a testing approach that would address this, but as an intermediate step, it would be fine to have some code that just tries to instantiate the motion profile implementations with each supported type, so we'll at least know at compile time if something breaks.

    type: enhancement good first issue topic: development 
    opened by hannobraun 0
  • CI doesn't build with any optional features

    CI doesn't build with any optional features

    Currently, the CI build only builds using the default features (i.e. no features, since all are optional). There should be additional builds to make sure the std and libm features build correctly.

    The example (which requires the std feature) is also not built.

    type: bug good first issue topic: development 
    opened by hannobraun 0
  • Improve fixed-point accuracy of `Trapezoidal`

    Improve fixed-point accuracy of `Trapezoidal`

    The current approach Trapezoidal uses is rather naive. It uses the same numeric type for all parts of the computation. This works well enough for floating-point numbers, but requires incredibly large fixed-point numbers to get the required accuracy. There probably are ways to handle this much better. stepgen, for example, uses different fixed-point numbers for different parts of the computation.

    The question is how to best implement this in a way that users can still override according to their needs. Especially since choosing the correct fixed-point types can be difficult to get right. So far, this is the best I've come up with:

    • Instead of adding multiple type parameters, one for each number type used, add a single type parameter that is bound on a trait that defines the type parameters as associated types.
    • Document that trait extensively, explaining how each type is used, and how to choose the right one.
    • Provide some pre-built implementations of the type: One optimized for using seconds as the unit of time, another optimized for using timer ticks as the unit of time, one using f32, etc.

    The test suite should be run for each provided type bundle. It would probably be best to move the test code to a separate public module under trapezoidal, so anyone defining their own types can re-use the test code.

    type: enhancement 
    opened by hannobraun 0
Owner
Flott - Motion Control in Rust
A toolkit for motion control software in Rust.
Flott - Motion Control in Rust
This is a rewrite of the RAMP (Rapid Assistance in Modelling the Pandemic) model

RAMP from scratch This is a rewrite of the RAMP (Rapid Assistance in Modelling the Pandemic) model, based on the EcoTwins-withCommuting branch, in Rus

Dustin Carlino 3 Oct 26, 2022
Arduino Uno 9 axis acceleration sensor (BMX055) reader implemented in Rust.

Arduino Uno Accelaration reader in Rust Components Arduino Uno (Probably possible with other AVR microcontrollers) BMX055 (Japanese website) Datasheet

Katsu Uchiyama 3 Dec 15, 2022
A simple example showcasing how to use Bevy to display a square with acceleration (controllable with your keyboard) that wraps around the screen!

Bevy Wrapping Square example A simple example showcasing how to use Bevy to display a square with acceleration (controllable with your keyboard) that

Luciano Mammino 3 Oct 23, 2022
LLaMa 7b with CUDA acceleration implemented in rust. Minimal GPU memory needed!

LLaMa 7b in rust This repo contains the popular LLaMa 7b language model, fully implemented in the rust programming language! Uses dfdx tensors and CUD

Corey Lowman 16 May 8, 2023
Sūshì is a simple but customizable static site generator / blog generator written in Rust

sūshì Sūshì is a simple but customizable static site generator / blog generator written in Rust. Installation Install with Cargo (Recommended) cargo i

MrNothing233 2 Mar 20, 2022
Full fake REST API generator written with Rust

Weld Full fake REST API generator. This project is heavily inspired by json-server, written with rust. Synopsis Our first aim is to generate a fake ap

Seray Uzgur 243 Dec 31, 2022
Procedural engine sound generator controlled via GUI or CLI

enginesound GUI Application used to generate purely synthetic engine sounds with advanced options written in Rust loosely based on this paper Reading

null 198 Dec 30, 2022
Custom Ethereum vanity address generator made in Rust

ethaddrgen Custom Ethereum address generator Get a shiny ethereum address and stand out from the crowd! Disclaimer: Do not use the private key shown i

Jakub Hlusička 153 Dec 27, 2022
Parsing Expression Grammar (PEG) parser generator for Rust

Parsing Expression Grammars in Rust Documentation | Release Notes rust-peg is a simple yet flexible parser generator that makes it easy to write robus

Kevin Mehall 1.2k Dec 30, 2022
LR(1) parser generator for Rust

LALRPOP LALRPOP is a Rust parser generator framework with usability as its primary goal. You should be able to write compact, DRY, readable grammars.

null 2.4k Jan 7, 2023
A typed parser generator embedded in Rust code for Parsing Expression Grammars

Oak Compiled on the nightly channel of Rust. Use rustup for managing compiler channels. You can download and set up the exact same version of the comp

Pierre Talbot 138 Nov 25, 2022
A fast static site generator in a single binary with everything built-in. https://www.getzola.org

zola (né Gutenberg) A fast static site generator in a single binary with everything built-in. Documentation is available on its site or in the docs/co

Zola 10.1k Jan 5, 2023
static site generator from markdown files.

Mdblog Static site generator from markdown files with features: TeX style math support file path is the post url file name is the post title post can

Fu 51 Dec 6, 2022
A fast uuid generator in Python using Rust

ruuid A fast UUID generator for Python built using Rust. Its a simple wrapper on top of Rust's UUID crate. How to use? Installation: pip3 install ruui

Rahul Nair 19 Jul 13, 2022
Image density/height map to mesh generator

Image density/height map to mesh generator About Crates used to generate 2D mesh from images representing density/height map. Algorithm gets source im

Patryk Budzyński 69 Nov 9, 2022
A fast static site generator in a single binary with everything built-in. https://www.getzola.org

zola (né Gutenberg) A fast static site generator in a single binary with everything built-in. Documentation is available on its site or in the docs/co

Zola 10.1k Jan 10, 2023
Custom Ethereum vanity address generator made in Rust

ethaddrgen Custom Ethereum address generator Get a shiny ethereum address and stand out from the crowd! Disclaimer: Do not use the private key shown i

Jakub Hlusička 153 Dec 27, 2022
An LR parser generator, implemented as a proc macro

parsegen parsegen is an LR parser generator, similar to happy, ocamlyacc, and lalrpop. It currently generates canonical LR(1) parsers, but LALR(1) and

Ömer Sinan Ağacan 5 Feb 28, 2022
A layout generator for river

A layout generator for river kile is a layout client for river. It comes with a few layouts like tabbed, vertical and horizontal split and dwindle. Yo

snakedye 21 Nov 26, 2022
the best static site generator

the best static site generator you've ever seen

Anirudh Balaji 14 Jan 24, 2022