DendoStepper icon indicating copy to clipboard operation
DendoStepper copied to clipboard

Change public API

Open cedricwritescode opened this issue 6 months ago • 9 comments

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

cedricwritescode avatar Dec 06 '23 11:12 cedricwritescode