Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
d660fb09
Commit
d660fb09
authored
8 years ago
by
Beat Küng
Committed by
Lorenz Meier
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
tap_esc: add RPMSTOPPED macro, make sure driver starts with stopped motors
parent
d6d3a561
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/drivers/tap_esc/drv_tap_esc.h
+1
-0
1 addition, 0 deletions
src/drivers/tap_esc/drv_tap_esc.h
src/drivers/tap_esc/tap_esc.cpp
+5
-5
5 additions, 5 deletions
src/drivers/tap_esc/tap_esc.cpp
with
6 additions
and
5 deletions
src/drivers/tap_esc/drv_tap_esc.h
+
1
−
0
View file @
d660fb09
...
...
@@ -78,6 +78,7 @@
#define RPMMAX 1900
#define RPMMIN 1200
#define RPMSTOPPED (RPMMIN - 10)
#define MAX_BOOT_TIME_MS (500) // Minimum time to wait after Power on before sending commands
...
...
This diff is collapsed.
Click to expand it.
src/drivers/tap_esc/tap_esc.cpp
+
5
−
5
View file @
d660fb09
...
...
@@ -417,8 +417,8 @@ void TAP_ESC:: send_esc_outputs(const float *pwm, const unsigned num_pwm)
if
(
rpm
[
i
]
>
RPMMAX
)
{
rpm
[
i
]
=
RPMMAX
;
}
else
if
(
rpm
[
i
]
<
RPM
MIN
)
{
rpm
[
i
]
=
RPM
MIN
;
}
else
if
(
rpm
[
i
]
<
RPM
STOPPED
)
{
rpm
[
i
]
=
RPM
STOPPED
;
}
}
...
...
@@ -678,7 +678,7 @@ TAP_ESC::cycle()
* This will be clearly visible on the servo status and will limit the risk of accidentally
* spinning motors. It would be deadly in flight.
*/
_outputs
.
output
[
i
]
=
900
;
_outputs
.
output
[
i
]
=
RPMSTOPPED
;
}
}
...
...
@@ -694,7 +694,7 @@ TAP_ESC::cycle()
if
(
test_motor_updated
)
{
struct
test_motor_s
test_motor
;
orb_copy
(
ORB_ID
(
test_motor
),
_test_motor_sub
,
&
test_motor
);
_outputs
.
output
[
test_motor
.
motor_number
]
=
900.
f
+
(
1100.
f
*
test_motor
.
value
);
//scale to [900, 2000]
_outputs
.
output
[
test_motor
.
motor_number
]
=
RPMSTOPPED
+
((
RPMMAX
-
RPMSTOPPED
)
*
test_motor
.
value
);
PX4_INFO
(
"setting motor %i to %.1lf"
,
test_motor
.
motor_number
,
(
double
)
_outputs
.
output
[
test_motor
.
motor_number
]);
}
...
...
@@ -702,7 +702,7 @@ TAP_ESC::cycle()
/* set the invalid values to the minimum */
for
(
unsigned
i
=
0
;
i
<
num_outputs
;
i
++
)
{
if
(
!
PX4_ISFINITE
(
_outputs
.
output
[
i
]))
{
_outputs
.
output
[
i
]
=
900
;
_outputs
.
output
[
i
]
=
RPMSTOPPED
;
}
}
...
...
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