2017-02-25 10:15:18 +00:00
|
|
|
/**
|
2016-06-16 04:18:44 +00:00
|
|
|
* Marlin 3D Printer Firmware
|
|
|
|
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
|
|
|
*
|
|
|
|
* Based on Sprinter and grbl.
|
|
|
|
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
|
|
|
*
|
|
|
|
* This program 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.
|
|
|
|
*
|
|
|
|
* This program 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.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2016-07-13 23:07:36 +00:00
|
|
|
#ifndef __NOZZLE_H__
|
|
|
|
#define __NOZZLE_H__
|
2016-06-16 04:18:44 +00:00
|
|
|
|
|
|
|
#include "Marlin.h"
|
|
|
|
#include "point_t.h"
|
|
|
|
|
2016-12-09 06:22:01 +00:00
|
|
|
#if ENABLED(NOZZLE_CLEAN_FEATURE)
|
|
|
|
constexpr float nozzle_clean_start_point[4] = NOZZLE_CLEAN_START_POINT,
|
|
|
|
nozzle_clean_end_point[4] = NOZZLE_CLEAN_END_POINT,
|
2017-06-20 03:39:23 +00:00
|
|
|
nozzle_clean_length = FABS(nozzle_clean_start_point[X_AXIS] - nozzle_clean_end_point[X_AXIS]), //abs x size of wipe pad
|
|
|
|
nozzle_clean_height = FABS(nozzle_clean_start_point[Y_AXIS] - nozzle_clean_end_point[Y_AXIS]); //abs y size of wipe pad
|
2016-12-09 06:22:01 +00:00
|
|
|
constexpr bool nozzle_clean_horizontal = nozzle_clean_length >= nozzle_clean_height; //whether to zig-zag horizontally or vertically
|
2017-05-09 17:35:43 +00:00
|
|
|
#endif // NOZZLE_CLEAN_FEATURE
|
2016-12-09 06:22:01 +00:00
|
|
|
|
2016-06-16 04:18:44 +00:00
|
|
|
/**
|
2016-06-22 23:23:55 +00:00
|
|
|
* @brief Nozzle class
|
2016-06-16 04:18:44 +00:00
|
|
|
*
|
|
|
|
* @todo: Do not ignore the end.z value and allow XYZ movements
|
|
|
|
*/
|
2016-06-22 23:23:55 +00:00
|
|
|
class Nozzle {
|
2016-06-16 04:18:44 +00:00
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* @brief Stroke clean pattern
|
|
|
|
* @details Wipes the nozzle back and forth in a linear movement
|
|
|
|
*
|
|
|
|
* @param start point_t defining the starting point
|
|
|
|
* @param end point_t defining the ending point
|
|
|
|
* @param strokes number of strokes to execute
|
|
|
|
*/
|
2016-07-14 15:29:04 +00:00
|
|
|
static void stroke(
|
2017-05-22 18:47:43 +00:00
|
|
|
_UNUSED point_t const &start,
|
|
|
|
_UNUSED point_t const &end,
|
|
|
|
_UNUSED uint8_t const &strokes
|
|
|
|
) _Os;
|
2016-06-16 04:18:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Zig-zag clean pattern
|
2017-02-24 22:41:44 +00:00
|
|
|
* @details Apply a zig-zag cleaning pattern
|
2016-06-16 04:18:44 +00:00
|
|
|
*
|
|
|
|
* @param start point_t defining the starting point
|
|
|
|
* @param end point_t defining the ending point
|
2016-06-22 23:23:55 +00:00
|
|
|
* @param strokes number of strokes to execute
|
|
|
|
* @param objects number of objects to create
|
2016-06-16 04:18:44 +00:00
|
|
|
*/
|
2016-07-14 15:29:04 +00:00
|
|
|
static void zigzag(
|
2017-05-22 18:47:43 +00:00
|
|
|
_UNUSED point_t const &start,
|
|
|
|
_UNUSED point_t const &end,
|
|
|
|
_UNUSED uint8_t const &strokes,
|
|
|
|
_UNUSED uint8_t const &objects
|
|
|
|
) _Os;
|
2016-06-22 23:23:55 +00:00
|
|
|
|
2017-02-24 22:41:44 +00:00
|
|
|
/**
|
|
|
|
* @brief Circular clean pattern
|
|
|
|
* @details Apply a circular cleaning pattern
|
|
|
|
*
|
|
|
|
* @param start point_t defining the middle of circle
|
|
|
|
* @param strokes number of strokes to execute
|
|
|
|
* @param radius radius of circle
|
|
|
|
*/
|
|
|
|
static void circle(
|
2017-05-22 18:47:43 +00:00
|
|
|
_UNUSED point_t const &start,
|
|
|
|
_UNUSED point_t const &middle,
|
|
|
|
_UNUSED uint8_t const &strokes,
|
|
|
|
_UNUSED float const &radius
|
|
|
|
) _Os;
|
2016-06-16 04:18:44 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Clean the nozzle
|
|
|
|
* @details Starts the selected clean procedure pattern
|
|
|
|
*
|
|
|
|
* @param pattern one of the available patterns
|
|
|
|
* @param argument depends on the cleaning pattern
|
|
|
|
*/
|
2016-07-14 15:29:04 +00:00
|
|
|
static void clean(
|
2017-05-22 18:47:43 +00:00
|
|
|
_UNUSED uint8_t const &pattern,
|
|
|
|
_UNUSED uint8_t const &strokes,
|
|
|
|
_UNUSED float const &radius,
|
|
|
|
_UNUSED uint8_t const &objects = 0
|
|
|
|
) _Os;
|
2016-07-14 15:29:04 +00:00
|
|
|
|
|
|
|
static void park(
|
2017-05-22 18:47:43 +00:00
|
|
|
_UNUSED uint8_t const &z_action
|
|
|
|
) _Os;
|
2016-06-16 04:18:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|