Part 2 ... not finished yet

pull/145/head^2
3d-gussner 2021-12-02 15:09:59 +01:00
parent dcd355b13f
commit b1a5170b85
6 changed files with 122 additions and 62 deletions

47
src/logic/tool_change.dot Normal file
View File

@ -0,0 +1,47 @@
digraph architecture {
graph [fontname=Helvetica, fontsize=10]
node [shape=record, fontname=Helvetica, fontsize=10]
edge [fontname=Helvetica, fontsize=10]
compound=true;
subgraph cluster_tool_change { label="tool_change"
reset
ActiveSlot_FilamentLoadState [label="Slot && FilLoadState", shape=diamond]
return
FilamentLoadState [shape=diamond]
UnloadingFilament
FeedingToFinda
FINDA [shape=diamond]
ErrorFINDAnotON
FeedingToBondtech
FSensor [shape=diamond]
ErrorFSnotON
ERRWaitingForUser
FinishedCorrectly
{rank = same
FeedingToBondtech ErrorFINDAnotON
}
{rank = same
FinishedCorrectly ERRWaitingForUser
}
{rank = same
FinishedCorrectly return
}
}
reset -> ActiveSlot_FilamentLoadState
ActiveSlot_FilamentLoadState:w -> return [label = "Slot && InNozzle"]
ActiveSlot_FilamentLoadState:s -> FilamentLoadState:n
FilamentLoadState -> UnloadingFilament [label=">=InSelector"]
FilamentLoadState:e -> FeedingToFinda [label="<InSelector"]
UnloadingFilament -> FeedingToFinda
FeedingToFinda -> FINDA
FINDA:w -> ErrorFINDAnotON [label="OFF"]
ErrorFINDAnotON -> ERRWaitingForUser
FINDA:s -> FeedingToBondtech:n [label="ON"]
FeedingToBondtech -> FSensor
FSensor:w -> ErrorFSnotON [label="OFF"]
ErrorFSnotON -> ERRWaitingForUser
FSensor -> FinishedCorrectly [label="ON"]
}

View File

@ -9,6 +9,8 @@
namespace logic {
/// @brief A high-level command state machine - handles the complex logic of tool change - which is basically a chain of an Unload and a Load operation.
/// State machine overview:
/// @dotfile tool_change.dot
class ToolChange : public CommandBase {
public:
inline ToolChange()

View File

@ -1,39 +1,4 @@
/// @file unload_filament.cpp
///@dot
///digraph architecture {
/// graph [fontname=Helvetica, fontsize=10];
/// node [shape=record, fontname=Helvetica, fontsize=10];
/// edge [fontname=Helvetica, fontsize=10];
/// compound=true;
/// subgraph cluster_unload_filament { label="unload_filament"
/// reset;
/// UnloadFilament [ URL="\ref logic::UnloadFilament"];
/// finda_FilLoadState [ shape=diamond, label="FINDA && FilLoadState"];
/// return [shape="oval"];
/// UnloadingToFinda [ URL="\ref logic::UnloadingToFinda", shape=diamond];
/// ErrorFSnotOFF [shape=oval];
/// ErrorFINDAnotOFF [shape=oval];
/// RetractingFromFinda [shape=diamond];
/// DisengagingIdler [shape=diamond];
/// ERRDisengagingIdler [shape=hexagon];
/// Finished [shape=oval];
/// {rank = same; finda_FilLoadState; return;}
/// {rank = same; ErrorFSnotOFF; UnloadingToFinda; ErrorFINDAnotOFF;}
/// {rank = same; DisengagingIdler; ERRDisengagingIdler;}
/// }
/// reset -> finda_FilLoadState
/// finda_FilLoadState -> return [label="NO && < 2"];
/// finda_FilLoadState -> UnloadFilament [label="YES && >=2"];
/// UnloadFilament -> UnloadingToFinda;
/// UnloadingToFinda -> ErrorFSnotOFF [label="err"];
/// UnloadingToFinda -> ErrorFINDAnotOFF [label="err"];
/// UnloadingToFinda -> RetractingFromFinda;
/// RetractingFromFinda -> ErrorFINDAnotOFF [label="err"];
/// RetractingFromFinda -> DisengagingIdler;
/// DisengagingIdler -> ERRDisengagingIdler [label="err"];
/// DisengagingIdler -> Finished;
///}
///@enddot
#include "unload_filament.h"
#include "../modules/finda.h"

View File

@ -1,33 +1,40 @@
digraph architecture {
graph [fontname=Helvetica, fontsize=10];
node [shape=record, fontname=Helvetica, fontsize=10];
edge [fontname=Helvetica, fontsize=10];
graph [fontname=Helvetica, fontsize=10]
node [shape=record, fontname=Helvetica, fontsize=10]
edge [fontname=Helvetica, fontsize=10]
compound=true;
subgraph cluster_unload_filament { label="unload_filament"
reset;
UnloadFilament [ URL="\ref logic::UnloadFilament"];
finda_FilLoadState [ shape=diamond, label="FINDA && FilLoadState"];
return [shape="oval"];
UnloadingToFinda [ URL="\ref logic::UnloadingToFinda", shape=diamond];
ErrorFSnotOFF [shape=oval];
ErrorFINDAnotOFF [shape=oval];
RetractingFromFinda [shape=diamond];
DisengagingIdler [shape=diamond];
ERRDisengagingIdler [shape=hexagon];
Finished [shape=oval];
{rank = same; finda_FilLoadState; return;}
{rank = same; ErrorFSnotOFF; UnloadingToFinda; ErrorFINDAnotOFF;}
{rank = same; DisengagingIdler; ERRDisengagingIdler;}
reset
UnloadFilament [ URL="\ref logic::UnloadFilament"]
finda_FilLoadState [ shape=diamond, label="FINDA && FilLoadState"]
return [shape="oval"]
UnloadingToFinda [ URL="\ref logic::UnloadingToFinda", shape=diamond]
ErrorFSnotOFF [shape=oval]
ErrorFINDAnotOFF [shape=oval]
RetractingFromFinda [shape=diamond]
DisengagingIdler [shape=diamond]
ERRDisengagingIdler [shape=hexagon]
Finished [shape=oval]
{rank = same
finda_FilLoadState return
}
{rank = same
edge[ style=invis]
ErrorFSnotOFF -> UnloadingToFinda-> ErrorFINDAnotOFF
}
{rank = same
DisengagingIdler ERRDisengagingIdler
}
}
reset -> finda_FilLoadState
finda_FilLoadState -> return [label="NO && < 2"];
finda_FilLoadState -> UnloadFilament [label="YES && >=2"];
UnloadFilament -> UnloadingToFinda;
UnloadingToFinda -> ErrorFSnotOFF [label="err"];
UnloadingToFinda -> ErrorFINDAnotOFF [label="err"];
UnloadingToFinda -> RetractingFromFinda;
RetractingFromFinda -> ErrorFINDAnotOFF [label="err"];
RetractingFromFinda -> DisengagingIdler;
DisengagingIdler -> ERRDisengagingIdler [label="err"];
DisengagingIdler -> Finished;
finda_FilLoadState -> return [label="NO && < 2"]
finda_FilLoadState -> UnloadFilament [label="YES && >=2"]
UnloadFilament -> UnloadingToFinda
UnloadingToFinda -> ErrorFSnotOFF [label="err"]
UnloadingToFinda -> ErrorFINDAnotOFF [label="err"]
UnloadingToFinda -> RetractingFromFinda
RetractingFromFinda:e -> ErrorFINDAnotOFF [label="err"]
RetractingFromFinda:s -> DisengagingIdler:n
DisengagingIdler -> ERRDisengagingIdler [label="err"]
DisengagingIdler -> Finished
}

View File

@ -0,0 +1,36 @@
digraph architecture {
graph [fontname=Helvetica, fontsize=10];
node [shape=record, fontname=Helvetica, fontsize=10];
edge [fontname=Helvetica, fontsize=10];
compound=true;
subgraph cluster_unload_to_finda { label="unload_to_finda"
Reset;
retry [shape=circle];
finda_state [ shape=diamond, label="FINDA"];
engage_idler [shape=circle];
EngagingIdler [ shape=diamond];
UnloadingToFinda [shape=diamond];
pull_pulley [shape=circle];
WaitingForFINDA [ shape=diamond, label="Waiting for FINDA"];
AboardPlannedMoves [shape=circle];
OK;
Failed;
{rank = same; finda_state; retry;}
{rank = same; engage_idler; EngagingIdler;}
{rank = same; pull_pulley; UnloadingToFinda;}
{rank = same; WaitingForFINDA; AboardPlannedMoves;}
{rank = same; OK; Failed;}
}
Reset -> finda_state;
finda_state -> OK [label="NO"];
finda_state -> EngagingIdler [label="YES"];
EngagingIdler -> engage_idler;
EngagingIdler -> UnloadingToFinda [label=">=InSelector"];
EngagingIdler -> Failed [label="<InSelector"];
UnloadingToFinda -> pull_pulley [label="Idler engaged"];
UnloadingToFinda -> WaitingForFINDA;
WaitingForFINDA -> AboardPlannedMoves [label="FINDA off"];
AboardPlannedMoves -> OK;
WaitingForFINDA -> retry [label="FINDA still on"];
retry -> Reset [label="maxTries"];
}

View File

@ -11,6 +11,9 @@ namespace logic {
/// - rotate pulley to some direction as long as the FINDA is on/off
/// - rotate some axis to some fixed direction
/// - load/unload to finda
///
/// State machine overview:
/// @dotfile unload_to_finda.dot
struct UnloadToFinda {
/// internal states of the state machine
enum {