-
Notifications
You must be signed in to change notification settings - Fork 7.3k
drivers: stepper: introduce rudimentary trapezoidal ramp control #88564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2025 Jilay Sandeep Pandya | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
zephyr_library() | ||
|
||
zephyr_library_sources_ifdef(CONFIG_STEPPER_RAMP_TRAPEZOIDAL ramp_trapezoidal.c) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2025 Jilay Sandeep Pandya | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
menuconfig STEPPER_RAMP | ||
bool "Ramp control" | ||
help | ||
Enable ramp control for stepper drivers. | ||
|
||
if STEPPER_RAMP | ||
|
||
config STEPPER_RAMP_TRAPEZOIDAL | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer a dt-binding instead to allow for a per stepper-controller decision on using ramps or not. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. However, you would need one such variable for the source to be included, or is there a better way? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there is a Kconfig extension for checking if a property is present on a compatible:
but nothing like dt_any_of_driver_class_has_prop, which would be neat. |
||
bool "Trapezoidal ramp control" | ||
help | ||
Enable trapezoidal ramp control for stepper drivers. | ||
The trapezoidal ramp control is implemented as a state machine | ||
and can be used with any stepper driver. | ||
|
||
endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need
max_velocity
, you already haveset_microstep_interval
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to find a consensus on how to rename that function, set_microstep_interval imo signifies more like a tick time, could be compared with for instance , can_set_bitrate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say, once this PR is merged, the CONFIG_STEPPER_RAMP can be deleted and all motors should support ramping by default.