Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
ucbus-stepper
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
ucbus-stepper
Commits
a76660c3
Commit
a76660c3
authored
2 years ago
by
Jake Read
Browse files
Options
Downloads
Patches
Plain Diff
queues together
parent
c731284b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
firmware/axl-stepper/src/axl
+1
-1
1 addition, 1 deletion
firmware/axl-stepper/src/axl
firmware/axl-stepper/src/main.cpp
+45
-16
45 additions, 16 deletions
firmware/axl-stepper/src/main.cpp
firmware/axl-stepper/src/osape_ucbus
+1
-1
1 addition, 1 deletion
firmware/axl-stepper/src/osape_ucbus
with
47 additions
and
18 deletions
axl
@
202c44ee
Compare
eb34931b
...
202c44ee
Subproject commit
eb34931b0991d7c6e257968fe60af13b90b1f629
Subproject commit
202c44ee96ff46f07823a6dc8b9b4bb13c0a575e
This diff is collapsed.
Click to expand it.
firmware/axl-stepper/src/main.cpp
+
45
−
16
View file @
a76660c3
...
...
@@ -16,10 +16,9 @@
//OSAP osap("axl-stepper_z-front-left");
//OSAP osap("axl-stepper_z-rear-right");
//OSAP osap("axl-stepper_z-front-right");
OSAP
osap
(
"axl-stepper_y-left"
);
//
OSAP osap("axl-stepper_y-left");
//OSAP osap("axl-stepper_y-right");
//OSAP osap("axl-stepper_x");
OSAP
osap
(
"axl-stepper_x"
);
//OSAP osap("axl-stepper_e");
VPort_ArduinoSerial
vpUSBSerial
(
&
osap
,
"arduinoUSBSerial"
,
&
Serial
);
...
...
@@ -207,6 +206,32 @@ boolean axl_checkLimit(void){
Endpoint
homeEP
(
&
osap
,
"home"
,
onHomeData
);
// -------------------------------------------------------- 8: Precalcd-move-adder;
EP_ONDATA_RESPONSES
onPrecalculatedMoveData
(
uint8_t
*
data
,
uint16_t
len
){
ERRLIGHT_TOGGLE
;
haltLightOnTime
=
millis
()
+
250
;
move_t
move
;
// data[0] == AXL_MODE_QUEUE -> I think we designed this serialization so
// that we could hit the same endpoint w/ multiple structures...
uint16_t
rptr
=
1
;
move
.
vi
=
ts_readFloat32
(
data
,
&
rptr
);
move
.
accel
=
ts_readFloat32
(
data
,
&
rptr
);
move
.
cruise
=
ts_readFloat32
(
data
,
&
rptr
);
move
.
vf
=
ts_readFloat32
(
data
,
&
rptr
);
move
.
distance
=
ts_readFloat32
(
data
,
&
rptr
);
for
(
uint8_t
a
=
0
;
a
<
AXL_NUM_DOF
;
a
++
){
move
.
unitVector
[
a
]
=
ts_readFloat32
(
data
,
&
rptr
);
move
.
endPos
.
axis
[
a
]
=
ts_readFloat32
(
data
,
&
rptr
);
}
// and send it...
axl_addMoveToQueue
(
move
);
// OSAP::debug("move len " + String(move.distance));
return
EP_ONDATA_REJECT
;
}
Endpoint
precalculatedMoveEP
(
&
osap
,
"precalculatedMoves"
,
onPrecalculatedMoveData
);
// -------------------------------------------------------- Arduino Setup
void
setup
()
{
...
...
@@ -223,27 +248,28 @@ void setup() {
// setup controller
axl_setup
();
// ticker begin:
d51ClockUtils
->
start_ticker_a
(
AXL_TICKER_INTERVAL_US
);
//
d51ClockUtils->start_ticker_a(AXL_TICKER_INTERVAL_US);
}
// -------------------------------------------------------- Das Loop
uint32_t
lastBlink
=
0
;
uint32_t
blinkInterval
=
50
;
// ms
uint8_t
dummy
[
128
];
void
loop
()
{
osap
.
loop
();
stepper_hw
->
dacRefresh
();
axl_
lazy
Loop
();
axl_
net
Loop
(
dummy
);
if
(
lastBlink
+
blinkInterval
<
millis
()){
lastBlink
=
millis
();
CLKLIGHT_TOGGLE
;
updateStatesEP
();
//axl_printHomeState();
}
if
(
haltLightOnTime
+
250
<
millis
()){
ERRLIGHT_OFF
;
}
//
if(haltLightOnTime + 250 < millis()){
//
ERRLIGHT_OFF;
//
}
}
// -------------------------------------------------------- Small-Time Ops
...
...
@@ -263,14 +289,17 @@ void axl_onPositionDelta(uint8_t axis, float delta){
}
}
void
TC0_Handler
(
void
){
// void TC0_Handler(void){
// DEBUG1PIN_ON;
// TC0->COUNT32.INTFLAG.bit.MC0 = 1;
// TC0->COUNT32.INTFLAG.bit.MC1 = 1;
// // run the loop,
// axl_integrator();
// DEBUG1PIN_OFF;
// }
void
ucBusDrop_onRxISR
(
void
){
DEBUG1PIN_ON
;
TC0
->
COUNT32
.
INTFLAG
.
bit
.
MC0
=
1
;
TC0
->
COUNT32
.
INTFLAG
.
bit
.
MC1
=
1
;
// run the loop,
axl_integrator
();
DEBUG1PIN_OFF
;
}
\ No newline at end of file
// deadies, unused ATM
void
ucBusDrop_onRxISR
(
void
){}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
osape_ucbus
@
9779836f
Compare
55661c3f
...
9779836f
Subproject commit
55661c3f0510b7e31ce059a47fc1c401c608c765
Subproject commit
9779836fd38f965e2be5fb0ff11f933dac7f7a04
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