-
Notifications
You must be signed in to change notification settings - Fork 26
Working modes
FABtotum being a multipurpose device, its firmware is organized around working modes.
A working mode is responsible of holding a predefined configuration for particular firmware features in order to carry out particular tasks. It may start or stop certain firmware subsystems, or change some configuration variable. Also, each working mode may define special variables and function that make sense only in that contest.
The preferred way of defining new working modes different to the usual printing and milling tasks, is to enclose it inside a namespace. In that way a particular working mode can redefine global configuration variables locally, so to maintain name consistency while changing behavior.
The firmware starts off in a default working mode (Hybrid) which enables all the basic machine functions for both printing and milling.
For each working mode, an initialization and cleanup procedure may be defined. When changing from one working mode to another, the old working mode cleanup procedure is done first, then the initialization procedure of the new mode is done.
Each head is associated with a preferred working mode. Working mode change is implicitly done when changing the installed head identifier.
At present all the working mode logic is hard-coded. In the future preprocessor macros may be defined to declare working modes and enable/disable them through compilation-time configuration.
The current working mode can be changed with the M450
command. The desired mode's index must be passed through the S
parameter. Modes are defined as follow:
ID | Mode |
---|---|
0 | Hybrid |
1 | FFF |
2 | Laser |
3 | CNC |
Firmware subsystems affected by working mode settings are the following.
Servo motor drivers can be pre-emptively attached or detached to the relevant output pins in some working modes. When detached, the freed pins may be dedicated to an alternate function or left free for the user to custom handling.
Heaters units and temperature sensors can be enabled or disabled according to the working mode.
Some g-code commands can be activated or prohibited according to the working mode set.
The FABlin architecture:
- Interface - G code commands, Error codes
- Application - Add-ons, G-code intepreter, Planner, Working modes
- Middleware - Servo, Stepper, Temperature
- MCU subsystems - ADC, GPIO, PWM
- Hardware - IO table