Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MechaRaptor - Arduino Controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Aerospace and Mechanical Engineering
tlambert
MechaRaptor - Arduino Controller
Commits
8d284d56
Verified
Commit
8d284d56
authored
2 years ago
by
Thomas Lambert
Browse files
Options
Downloads
Patches
Plain Diff
fix(esc): add offset between two ESC
parent
aa14eb3a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
controller/controller.ino
+2
-1
2 additions, 1 deletion
controller/controller.ino
with
2 additions
and
1 deletion
controller/controller.ino
+
2
−
1
View file @
8d284d56
...
...
@@ -75,6 +75,7 @@ const uint16_t gMAX_RPM = 3000; // Motor maximum RPM (set in ESC)
const
uint16_t
gMIN_RPM
=
750
;
// Motor minimum RPM (set in ESC)
const
uint8_t
gMAX_ESC_VAL
=
160
;
// Value at which motor is at max RPM
const
uint8_t
gMIN_ESC_VAL
=
40
;
// Min value for ESC to start motor (trial-error)
const
uint8_t
gESC_OFFSET
=
4
;
// Offset to add to ESC 2 to sync them
const
uint8_t
gCSN_PINS
[]
=
CSN_PINS
;
// Encoder Chip Select pins
const
int8_t
gENC_ORIENT
[]
=
ENC_ORIENT
;
// Encoder orientation
...
...
@@ -172,7 +173,7 @@ void loop() {
// Write value to ESCs
gEsc1
.
write
(
gEsc_val
);
gEsc2
.
write
(
gEsc_val
);
gEsc2
.
write
(
gEsc_val
+
gESC_OFFSET
);
// Read value from rotary encoders
for
(
int
i
=
0
;
i
<
sizeof
(
gCSN_PINS
);
i
++
)
{
...
...
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