| 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 ZPROBE_H_ |
| 9 | #define ZPROBE_H_ |
| 10 | |
| 11 | #include "Module.h" |
| 12 | #include "Pin.h" |
| 13 | |
| 14 | class StepperMotor; |
| 15 | class Gcode; |
| 16 | class StreamOutput; |
| 17 | |
| 18 | class ZProbe: public Module |
| 19 | { |
| 20 | |
| 21 | public: |
| 22 | void on_module_loaded(); |
| 23 | void on_config_reload(void *argument); |
| 24 | void on_gcode_received(void *argument); |
| 25 | uint32_t acceleration_tick(uint32_t dummy); |
| 26 | |
| 27 | |
| 28 | private: |
| 29 | bool wait_for_probe(int steps[3]); |
| 30 | bool run_probe(int& steps, bool fast= false); |
| 31 | bool probe_delta_tower(int& steps, float x, float y); |
| 32 | bool return_probe(int steps); |
| 33 | bool calibrate_delta_endstops(Gcode *gcode); |
| 34 | bool calibrate_delta_radius(Gcode *gcode); |
| 35 | void coordinated_move(float x, float y, float z, float feedrate, bool relative=false); |
| 36 | void home(); |
| 37 | bool set_trim(float x, float y, float z, StreamOutput *stream); |
| 38 | bool get_trim(float& x, float& y, float& z); |
| 39 | |
| 40 | float probe_radius; |
| 41 | float probe_height; |
| 42 | float current_feedrate; |
| 43 | float slow_feedrate; |
| 44 | float fast_feedrate; |
| 45 | Pin pin; |
| 46 | uint8_t debounce_count; |
| 47 | struct { |
| 48 | bool running:1; |
| 49 | bool is_delta:1; |
| 50 | }; |
| 51 | }; |
| 52 | |
| 53 | #endif /* ZPROBE_H_ */ |