92f5e4a2c87687aac78c768e1da127e68bb426a6
[clinton/Smoothieware.git] / src / modules / tools / homer / Homer.h
1 /*
2 This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl).
3 Smoothie is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
4 Smoothie is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
5 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
6 */
7
8 #ifndef _HOMER_H
9 #define _HOMER_H
10
11 #include "libs/Module.h"
12 #include "libs/Kernel.h"
13 #include "modules/communication/utils/Gcode.h"
14 #include "libs/StepperMotor.h"
15 #include "libs/Pin.h"
16
17 #include <vector>
18
19 class Homer : public Module{
20 public:
21 Homer();
22 void on_module_loaded();
23 void on_gcode_received(void* argument);
24 void on_config_reload(void* argument);
25
26 private:
27 void do_homing(char axes_to_move);
28 void do_homing_corexy(char axes_to_move);
29 void wait_for_homed(char axes_to_move);
30 void wait_for_homed_corexy(int axis);
31 void corexy_home(int home_axis, bool dirx, bool diry, float fast_rate, float slow_rate, float retract_mm);
32 void trim2mm(float * mm);
33
34 float steps_per_mm[3];
35 float homing_position[3];
36 float home_offset[3];
37 bool home_direction[3];
38 unsigned int debounce_count;
39 float retract_mm[3];
40 int trim[3];
41 float fast_rates[3];
42 float slow_rates[3];
43 char status;
44 bool is_corexy;
45 bool is_delta;
46 };
47
48 #endif /* _HOMER_H */