Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Baitboat
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
OpenSource
Baitboat
Commits
704a7204
Commit
704a7204
authored
10 years ago
by
Randy Mackay
Browse files
Options
Downloads
Patches
Plain Diff
Tracker: move servo init to servos.pde
parent
c69bfa2c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
AntennaTracker/servos.pde
+17
-0
17 additions, 0 deletions
AntennaTracker/servos.pde
AntennaTracker/system.pde
+2
-9
2 additions, 9 deletions
AntennaTracker/system.pde
with
19 additions
and
9 deletions
AntennaTracker/servos.pde
+
17
−
0
View file @
704a7204
...
...
@@ -4,6 +4,23 @@
* servos.pde - code to move pitch and yaw servos to attain a target heading or pitch
*/
// init_servos - initialises the servos
static
void
init_servos
()
{
// setup antenna control PWM channels
channel_yaw
.
set_angle
(
g
.
yaw_range
*
100
/
2
);
// yaw range is +/- (YAW_RANGE parameter/2) converted to centi-degrees
channel_pitch
.
set_angle
(
g
.
pitch_range
*
100
/
2
);
// pitch range is +/- (PITCH_RANGE parameter/2) converted to centi-degrees
// move servos to mid position
channel_yaw
.
output_trim
();
channel_pitch
.
output_trim
();
// initialise output to servos
channel_yaw
.
calc_pwm
();
channel_pitch
.
calc_pwm
();
}
/**
update the pitch (elevation) servo. The aim is to drive the boards ahrs pitch to the
requested pitch, so the board (and therefore the antenna) will be pointing at the target
...
...
This diff is collapsed.
Click to expand it.
AntennaTracker/system.pde
+
2
−
9
View file @
704a7204
...
...
@@ -74,15 +74,8 @@ static void init_tracker()
hal
.
uartB
->
set_blocking_writes
(
false
);
hal
.
uartC
->
set_blocking_writes
(
false
);
// setup antenna control PWM channels
channel_yaw
.
set_angle
(
18000
);
// Yaw is expected to drive antenna azimuth -180-0-180
channel_pitch
.
set_angle
(
9000
);
// Pitch is expected to drive elevation -90-0-90
channel_yaw
.
output_trim
();
channel_pitch
.
output_trim
();
channel_yaw
.
calc_pwm
();
channel_pitch
.
calc_pwm
();
// initialise servos
init_servos
();
// use given start positions - useful for indoor testing, and
// while waiting for GPS lock
...
...
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