JSPM

@villagekit/stepper-ramp

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q46946F
  • License Apache-2.0

stepper motor acceleration ramp generator

Package Exports

  • @villagekit/stepper-ramp
  • @villagekit/stepper-ramp/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@villagekit/stepper-ramp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@villagekit/stepper-ramp

install

npm install @villagekit/stepper-ramp

example

const createRamp = require('@villagekit/stepper-ramp')

const ramp = createRamp({
  targetSpeedInStepsPerSec: 50,
  accelerationInStepsPerSecPerSec: 50,
})

const movement = ramp.movement(100)

const stepPeriodsInMicrosecs = Array.from(movement)

console.log(stepPeriodsInMicrosecs)

api

createRamp = require('@villagekit/stepper-ramp')

ramp = createRamp(options)

options is an object with shape:

  • targetSpeedInStepsPerSec: max speed in (steps / second)
  • accelerationInStepsPerSecPerSec: acceleration in (steps / second^2)

stepPeriods = ramp.movement(steps)

steps is a number.

stepPeriods is an Iterable of step periods in microsecs.