Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rndmc
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
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jake Read
rndmc
Commits
67c86147
Commit
67c86147
authored
6 years ago
by
Jake Read
Browse files
Options
Downloads
Patches
Plain Diff
verbose flag for less logging on stepper and planner
parent
c96e76cb
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/hardware/atkstepper.js
+7
-4
7 additions, 4 deletions
modules/hardware/atkstepper.js
modules/motion/planner.js
+9
-6
9 additions, 6 deletions
modules/motion/planner.js
with
16 additions
and
10 deletions
modules/hardware/atkstepper.js
+
7
−
4
View file @
67c86147
...
...
@@ -15,6 +15,9 @@ function Stepper() {
var
stepper
=
Hardware
()
// log more
var
verbose
=
false
stepper
.
description
.
name
=
'
ATKStepper
'
stepper
.
description
.
alt
=
'
software representation of stepper motor
'
...
...
@@ -184,7 +187,7 @@ function Stepper() {
console
.
log
(
dMove
)
}
console
.
log
(
'
------------------- DMOVE
'
,
state
.
axis
,
dMove
.
steps
)
if
(
verbose
)
console
.
log
(
'
------------------- DMOVE
'
,
state
.
axis
,
dMove
.
steps
)
var
packet
=
new
Array
()
// step blocks are #131
...
...
@@ -195,7 +198,7 @@ function Stepper() {
packet
.
push
(
131
)
}
packet
=
packet
.
concat
(
PCKT
.
pack32
(
dMove
.
steps
))
console
.
log
(
'
------------------- PMOVE
'
,
packet
)
if
(
verbose
)
console
.
log
(
'
------------------- PMOVE
'
,
packet
)
packet
=
packet
.
concat
(
PCKT
.
pack32
(
dMove
.
entry
))
packet
=
packet
.
concat
(
PCKT
.
pack32
(
dMove
.
accel
))
packet
=
packet
.
concat
(
PCKT
.
pack32
(
dMove
.
accelLen
))
...
...
@@ -227,7 +230,7 @@ function Stepper() {
axis
:
state
.
axis
,
increment
:
unitsMade
}
console
.
log
(
"
STEPPER ACK MOVE
"
,
state
.
axis
,
stepsMade
)
if
(
verbose
)
console
.
log
(
"
STEPPER ACK MOVE
"
,
state
.
axis
,
stepsMade
)
stepper
.
outputs
.
ack
.
emit
(
ack
)
stepper
.
outputs
.
position
.
emit
(
state
.
position
)
}
...
...
@@ -240,7 +243,7 @@ function Stepper() {
axis
:
state
.
axis
,
increment
:
0
}
console
.
log
(
"
STEPPER ACK WAIT
"
,
state
.
axis
)
if
(
verbose
)
console
.
log
(
"
STEPPER ACK WAIT
"
,
state
.
axis
)
stepper
.
outputs
.
ack
.
emit
(
ack
)
}
...
...
This diff is collapsed.
Click to expand it.
modules/motion/planner.js
+
9
−
6
View file @
67c86147
...
...
@@ -23,6 +23,9 @@ function Planner() {
}
}
// log more
var
verbose
=
false
planner
.
state
=
State
()
var
state
=
planner
.
state
// reference pass attempt?
...
...
@@ -92,9 +95,9 @@ function Planner() {
var
newNetState
=
state
.
netState
.
slice
(
0
)
newNetState
[
match
]
-=
1
state
.
netState
=
newNetState
console
.
log
(
'
NEW NET STATE
'
,
newNetState
)
if
(
verbose
)
console
.
log
(
'
NEW NET STATE
'
,
newNetState
)
}
else
{
console
.
log
(
'
ERR: missed axis on ack from stepper
'
)
console
.
log
(
'
ERR
in PLANNER
: missed axis on ack from stepper
'
)
}
netStateRefresh
()
}
...
...
@@ -181,7 +184,7 @@ function Planner() {
state
.
netState
=
state
.
netState
// dereference
var
move
=
JSON
.
parse
(
JSON
.
stringify
(
mq
.
shift
()))
console
.
log
(
"
MOVE FROM PLANNER
"
,
move
)
if
(
verbose
)
console
.
log
(
"
MOVE FROM PLANNER
"
,
move
)
planner
.
outputs
.
moves
.
emit
(
move
)
planner
.
outputs
.
moveComplete
.
emit
(
1
)
}
else
{
...
...
@@ -284,7 +287,7 @@ function Planner() {
// to maximum permissible by JD
// because we know the final exit speed, we'll run the pass from
// back to start
console
.
log
(
'
REV PASS
'
)
if
(
verbose
)
console
.
log
(
'
REV PASS
'
)
for
(
var
i
=
mq
.
length
-
1
;
i
>
0
;
i
--
)
{
// the moves we're junctioning around / transitioning between
var
mqi
=
mq
[
i
-
1
]
...
...
@@ -313,7 +316,7 @@ function Planner() {
// we've swept backwards to make sure we can decelerate into the end point,
// now we need to make sure we can accelerate up to these cornering velocities
// and if not, set the exit speeds appropriately, so that we can get there
console
.
log
(
'
FWD PASS
'
)
if
(
verbose
)
console
.
log
(
'
FWD PASS
'
)
for
(
var
i
=
0
;
i
<
mq
.
length
-
1
;
i
++
)
{
var
mqi
=
mq
[
i
]
var
mqn
=
mq
[
i
+
1
]
...
...
@@ -333,7 +336,7 @@ function Planner() {
// this becomes very useful for turning moves over to stepper motors
// and will give us a time estimate for each move as well,
// we need / want that so that we can set a network buffer length
console
.
log
(
'
TRAPEZOIDS
'
)
if
(
verbose
)
console
.
log
(
'
TRAPEZOIDS
'
)
for
(
var
i
=
0
;
i
<
mq
.
length
;
i
++
)
{
calcTrap
(
mq
[
i
],
accel
,
false
)
if
(
moveTime
(
mq
[
i
])
<
0.1
)
{
...
...
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