Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mattdr
supermileage_2018
Commits
d50c9956
Commit
d50c9956
authored
Jan 13, 2019
by
thcl
Browse files
Open loop implemented for calibration
parent
fc77752d
Changes
1
Hide whitespace changes
Inline
Side-by-side
source_code/Teensy32/src/encoder.cpp
View file @
d50c9956
...
...
@@ -20,7 +20,7 @@ int Zoffset = 0;
// This is the difference in encoder tics from the Z index to
// the electrical encoder zero (which is found by powering the
// AB block and waiting for the motor to settle)
int
hard_coded_offset
=
304
;
int
hard_coded_offset
=
-
1051
;
// how long in microsec (us) to delay between phases while calibrating
// the wheel
...
...
@@ -165,8 +165,13 @@ int calibrate_encoder(void)
//worst case needs 6 full electrical rotations
Serial
.
println
(
"STARTING CALIBRATION"
);
while
(
1
){
Serial
.
println
(
"TURN FOR MANUEL CALIBRATION"
);
delayMicroseconds
(
100000
);
//0.1 sec delay
for
(
int
p
=
1
;
p
<=
6
;
p
++
)
{
set_block_phase
(
p
);
int
myDelay
=
28500
;
delayMicroseconds
(
myDelay
);
}
if
(
calibrated
==
true
){
//ditch the interrupt
turn_all_off
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment