Skip to content

Change public API #22

Description

@cedricwritescode

Is your feature request related to a problem? Please describe.
I find the structure of the library a bit unintuitive. Therefore I propose these changes:

Describe the solution you'd like

  • Separate linear movement functionality from actual motor control into different classes
    The linear movement class could inherit from the actual stepper class.

  • Change properties of motor and motors connected to linear axes
    Change microStepping and stepAngle to stepsPerRot. This would give the user more freedom to decide on microstepping values, as well as being a more descriptive property. The user could set it like (motor_steps_per_turn * controller_microsteps).
    Additionally, I think stepsPerMm mixes properties of linear and stepper functionality. I propose to use feedConstant instead (i.e. mm/turn).

  • Simplify initialization (i.e. init, init(params), config methods)
    Generally, there should be a single method the user calls for initialization. Right now there are 3 methods, which uses might be a bit ambigous.
    I think the best way would be to only use the init struct, as it is more concise and adaptable than passing every config value as a method parameter. I think performing initialization in the constructor is not optimal. The reason is that a possible error during a c'tor call would be less debuggable than a runtime error.

Describe alternatives you've considered

Additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions