Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
motosat
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
motosat
Commits
1328d82c
Commit
1328d82c
authored
Sep 11, 2019
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corrected movements
parent
791b5509
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
38 deletions
+62
-38
test_01.php
test_01.php
+62
-38
No files found.
test_01.php
View file @
1328d82c
...
...
@@ -40,6 +40,12 @@ $USABLE_FRACT = 0.6; // use ony samples not less than this fraction of maxima
$USABLE_POW
=
1.0
;
// transform (maxstrengh - strengh) by applying pow - 1.2 ...1.3 may have marginal improvements
$ARGMAX_OURSIDE
=
0.2
;
// Allow argmax outside of the measured range by this fraction
$ARGMAX_OURSIDE_2D
=
0.0
;
// Allow argmax outside of the measured range by this fraction during 2D peaking
// Modem never allows wrong satellite to have signal strength above 29, and tries to maintain 30 for the correct one when the signal falls below.
// So these values can not be used for peaking(maybe only remove 30 if the signal is going down?)
$HUGHES_BAD_STRENGTHS
=
array
(
29
,
30
);
/*
http://192.168.1.250/motor.xml?Action=ElUp&Distance=0.5&Units=1 0.5 degree up
...
...
@@ -173,18 +179,9 @@ if ($scan_mode){
exit
(
0
);
}
// Just move where requested
$total_cycles
=
0
;
if
(
$multi
)
{
while
(
true
)
{
$cycles
=
moveElAzSk_degrees
(
$DishAngle
);
if
(
!
isset
(
$cycles
))
{
break
;
}
$total_cycles
+=
$cycles
;
}
}
else
{
$total_cycles
=
moveElAzSk_degrees
(
$DishAngle
);
}
$total_cycles
=
moveElAzSk_degrees
(
$DishAngle
,
$multi
);
$xml
=
new
SimpleXMLElement
(
"<?xml version='1.0'?><motosat/>"
);
$xml
->
addChild
(
'cycles'
,(
string
)
$total_cycles
);
$rslt
=
$xml
->
asXML
();
...
...
@@ -329,7 +326,7 @@ function peakAzimuthOrElevation($xml_state, $el_not_az, $azel_play, $azel_range,
}
function
findMax2d
(
$data
,
$fract
,
$pow
,
$frac_outside
=
0.2
){
// $pow not yet used
global
$dbg_file
;
global
$
HUGHES_BAD_STRENGTHS
,
$
dbg_file
;
$min
=
$data
[
0
][
0
];
$max
=
$data
[
0
][
0
];
$rows
=
sizeof
(
$data
);
...
...
@@ -358,12 +355,17 @@ function findMax2d($data, $fract, $pow, $frac_outside = 0.2){ // $pow not yet us
$xy
=
$argmax
;
// x,y pair
// put a cell into a queue, in $poly_data and mark a cell as used
$queue
[]
=
$xy
;
if
(
!
in_array
(
$data
[
$xy
[
1
]][
$xy
[
0
]],
$HUGHES_BAD_STRENGTHS
))
{
$poly_data
[]
=
array
(
array
(
0.0
,
0.0
),
// $xy,
array
(
0.0
,
0.0
),
// $xy,
array
(
$data
[
$xy
[
1
]][
$xy
[
0
]]
)
);
}
$cluster
[
$xy
[
1
]][
$xy
[
0
]]
=
true
;
while
(
sizeof
(
$queue
)
>
0
)
{
...
...
@@ -407,13 +409,18 @@ function findMax2d($data, $fract, $pow, $frac_outside = 0.2){ // $pow not yet us
if
(
$data
[
$xy
[
1
]][
$xy
[
0
]]
<
$threshold
)
// signal too weak
continue
;
// already used
$queue
[]
=
$xy
;
$cluster
[
$xy
[
1
]][
$xy
[
0
]]
=
true
;
if
(
!
in_array
(
$data
[
$xy
[
1
]][
$xy
[
0
]],
$HUGHES_BAD_STRENGTHS
))
{
// use for the wave, but do not use for polynimial maximum
$poly_data
[]
=
array
(
array
(
$xy
[
0
]
-
$argmax
[
0
],
$xy
[
1
]
-
$argmax
[
1
]),
array
(
$xy
[
0
]
-
$argmax
[
0
],
$xy
[
1
]
-
$argmax
[
1
]
),
array
(
$data
[
$xy
[
1
]][
$xy
[
0
]]
)
);
$cluster
[
$xy
[
1
]][
$xy
[
0
]]
=
true
;
}
}
}
if
(
$dbg_file
!==
null
)
{
...
...
@@ -495,7 +502,7 @@ function findMax2d($data, $fract, $pow, $frac_outside = 0.2){ // $pow not yet us
function
findMax1d
(
$data
,
$fract
,
$pow
,
$frac_outside
=
0.2
){
global
$dbg_file
;
global
$
HUGHES_BAD_STRENGTHS
,
$
dbg_file
;
$min
=
$data
[
0
];
$max
=
$data
[
0
];
$argmax
=
0
;
...
...
@@ -522,7 +529,12 @@ function findMax1d($data, $fract, $pow, $frac_outside = 0.2){
$poly_data
=
Array
();
for
(
$k
=
$k_min
;
$k
<=
$k_max
;
$k
++
){
$poly_data
[]
=
Array
(
$k
-
$argmax
,
$datap
[
$k
]);
if
(
!
in_array
(
$datap
[
$k
],
$HUGHES_BAD_STRENGTHS
))
{
// skip samples with "bad" strengths (see explanation in the $HUGHES_BAD_STRENGTHS declaration
$poly_data
[]
=
Array
(
$k
-
$argmax
,
$datap
[
$k
]
);
}
}
$pa
=
new
PolynomialApproximation
();
...
...
@@ -852,22 +864,34 @@ function waitMotorsReady($modem_threshold = 0.0){ //
return
$try
;
}
function
moveElAzSk_counts
(
$new_azelsk_count
)
{
function
moveElAzSk_counts
(
$new_azelsk_count
,
$multi
=
true
)
{
$total_cycles
=
0
;
while
(
true
)
{
$xml_state
=
moveElAzSk_start_counts
(
$new_azelsk_count
);
if
(
isset
(
$xml_state
))
{
if
(
isset
(
$xml_state
))
{
$cycles
=
waitMotorsReady
();
return
$cycles
;
// $xml_state;
$total_cycles
+=
$cycles
;
if
(
!
$multi
)
return
$total_cycles
;
}
else
return
$total_cycles
;
// did not move last time
}
return
;
}
function
moveElAzSk_degrees
(
$new_azelsk_degree
)
{
function
moveElAzSk_degrees
(
$new_azelsk_degree
,
$multi
=
true
)
{
$total_cycles
=
0
;
while
(
true
)
{
$xml_state
=
moveElAzSk_start_degrees
(
$new_azelsk_degree
);
if
(
isset
(
$xml_state
))
{
if
(
isset
(
$xml_state
))
{
$cycles
=
waitMotorsReady
();
return
$cycles
;
// $xml_state;
$total_cycles
+=
$cycles
;
if
(
!
$multi
)
return
$total_cycles
;
}
else
return
$total_cycles
;
// did not move last time
}
return
;
}
function
myval
(
$s
)
{
...
...
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