Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
modular-motion-head
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jake Read
modular-motion-head
Commits
a642e4ca
Commit
a642e4ca
authored
3 years ago
by
Jake Read
Browse files
Options
Downloads
Patches
Plain Diff
checks for exceptional rates
parent
3bbda1f3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
firmware/motion-head/src/smoothie/SmoothieRoll.cpp
+7
-2
7 additions, 2 deletions
firmware/motion-head/src/smoothie/SmoothieRoll.cpp
with
7 additions
and
2 deletions
firmware/motion-head/src/smoothie/SmoothieRoll.cpp
+
7
−
2
View file @
a642e4ca
...
@@ -49,8 +49,13 @@ void SmoothieRoll::checkMaxRates(void){
...
@@ -49,8 +49,13 @@ void SmoothieRoll::checkMaxRates(void){
// we also have per-axis steps per unit, and max rates,
// we also have per-axis steps per unit, and max rates,
// if rate * spu exceeds the tick frequency, we are in trouble:
// if rate * spu exceeds the tick frequency, we are in trouble:
for
(
uint8_t
m
=
0
;
m
<
SR_NUM_MOTORS
;
m
++
){
for
(
uint8_t
m
=
0
;
m
<
SR_NUM_MOTORS
;
m
++
){
if
(
actuators
[
m
]
->
get_max_rate
()
*
actuators
[
m
]
->
get_steps_per_mm
()
>
SR_TICK_FREQ
){
float
maxTick
=
actuators
[
m
]
->
get_max_rate
()
*
actuators
[
m
]
->
get_steps_per_mm
();
sysError
(
"motor "
+
String
(
m
)
+
" exceeds max rate"
);
if
(
maxTick
>
SR_TICK_FREQ
){
sysError
(
"motor "
+
String
(
m
)
+
" exceeds max tick, "
+
String
(
maxTick
));
// new rate should be old rate * rate /
float
newMax
=
actuators
[
m
]
->
get_max_rate
()
*
(
SR_TICK_FREQ
/
maxTick
);
sysError
(
"old max velocity: "
+
String
(
actuators
[
m
]
->
get_max_rate
())
+
" new: "
+
String
(
newMax
));
actuators
[
m
]
->
set_max_rate
(
newMax
);
}
}
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment