smoothie port to mbed online compiler (smoothieware.org)

Dependencies:   mbed

For documentation, license, ..., please check http://smoothieware.org/

This version has been tested with a 3 axis machine

Committer:
scachat
Date:
Tue Jul 31 21:11:18 2012 +0000
Revision:
0:31e91bb0ef3c
smoothie port to mbed online compiler

Who changed what in which revision?

UserRevisionLine numberNew contents of line
scachat 0:31e91bb0ef3c 1 /*
scachat 0:31e91bb0ef3c 2 This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl).
scachat 0:31e91bb0ef3c 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.
scachat 0:31e91bb0ef3c 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.
scachat 0:31e91bb0ef3c 5 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
scachat 0:31e91bb0ef3c 6 */
scachat 0:31e91bb0ef3c 7
scachat 0:31e91bb0ef3c 8
scachat 0:31e91bb0ef3c 9
scachat 0:31e91bb0ef3c 10 #ifndef EXTURDER_MODULE_H
scachat 0:31e91bb0ef3c 11 #define EXTRUDER_MODULE_H
scachat 0:31e91bb0ef3c 12
scachat 0:31e91bb0ef3c 13 #include "libs/Module.h"
scachat 0:31e91bb0ef3c 14 #include "libs/Kernel.h"
scachat 0:31e91bb0ef3c 15 #include "modules/robot/Block.h"
scachat 0:31e91bb0ef3c 16
scachat 0:31e91bb0ef3c 17 #define microseconds_per_step_pulse_checksum 42333
scachat 0:31e91bb0ef3c 18 #define extruder_module_enable_checksum 6183
scachat 0:31e91bb0ef3c 19 #define extruder_steps_per_mm_checksum 58088
scachat 0:31e91bb0ef3c 20 #define default_feed_rate_checksum 53183
scachat 0:31e91bb0ef3c 21 #define acceleration_checksum 60356
scachat 0:31e91bb0ef3c 22
scachat 0:31e91bb0ef3c 23 #define OFF 0
scachat 0:31e91bb0ef3c 24 #define SOLO 1
scachat 0:31e91bb0ef3c 25 #define FOLLOW 2
scachat 0:31e91bb0ef3c 26
scachat 0:31e91bb0ef3c 27 class Extruder : public Module{
scachat 0:31e91bb0ef3c 28 public:
scachat 0:31e91bb0ef3c 29 Extruder();
scachat 0:31e91bb0ef3c 30 virtual void on_module_loaded();
scachat 0:31e91bb0ef3c 31 virtual void on_config_reload(void* argument);
scachat 0:31e91bb0ef3c 32 virtual void on_gcode_execute(void* argument);
scachat 0:31e91bb0ef3c 33 virtual void on_block_begin(void* argument);
scachat 0:31e91bb0ef3c 34 virtual void on_block_end(void* argument);
scachat 0:31e91bb0ef3c 35 virtual void on_play(void* argument);
scachat 0:31e91bb0ef3c 36 virtual void on_pause(void* argument);
scachat 0:31e91bb0ef3c 37 void set_speed(int steps_per_second);
scachat 0:31e91bb0ef3c 38 uint32_t acceleration_tick(uint32_t dummy);
scachat 0:31e91bb0ef3c 39 uint32_t stepping_tick(uint32_t dummy);
scachat 0:31e91bb0ef3c 40 uint32_t reset_step_pin(uint32_t dummy);
scachat 0:31e91bb0ef3c 41
scachat 0:31e91bb0ef3c 42 Pin* step_pin; // Step pin for the stepper driver
scachat 0:31e91bb0ef3c 43 Pin* dir_pin; // Dir pin for the stepper driver
scachat 0:31e91bb0ef3c 44 Pin* en_pin;
scachat 0:31e91bb0ef3c 45
scachat 0:31e91bb0ef3c 46 double start_position; // Start point ( in steps ) for the current move
scachat 0:31e91bb0ef3c 47 double target_position; // End point ( in steps ) for the current move
scachat 0:31e91bb0ef3c 48 double current_position; // Current point ( in steps ) for the current move, incremented every time a step is outputed
scachat 0:31e91bb0ef3c 49 Block* current_block; // Current block we are stepping, same as Stepper's one
scachat 0:31e91bb0ef3c 50 int microseconds_per_step_pulse; // Pulse duration for step pulses
scachat 0:31e91bb0ef3c 51 double steps_per_millimeter; // Steps to travel one millimeter
scachat 0:31e91bb0ef3c 52 double feed_rate; //
scachat 0:31e91bb0ef3c 53 double acceleration; //
scachat 0:31e91bb0ef3c 54
scachat 0:31e91bb0ef3c 55 int counter_increment;
scachat 0:31e91bb0ef3c 56 int step_counter;
scachat 0:31e91bb0ef3c 57
scachat 0:31e91bb0ef3c 58 bool solo_mode;
scachat 0:31e91bb0ef3c 59 double travel_ratio;
scachat 0:31e91bb0ef3c 60 double travel_distance;
scachat 0:31e91bb0ef3c 61 bool absolute_mode;
scachat 0:31e91bb0ef3c 62
scachat 0:31e91bb0ef3c 63 int direction;
scachat 0:31e91bb0ef3c 64
scachat 0:31e91bb0ef3c 65 bool debug;
scachat 0:31e91bb0ef3c 66 int debug_count;
scachat 0:31e91bb0ef3c 67
scachat 0:31e91bb0ef3c 68 char mode;
scachat 0:31e91bb0ef3c 69 bool acceleration_lock;
scachat 0:31e91bb0ef3c 70
scachat 0:31e91bb0ef3c 71 bool paused;
scachat 0:31e91bb0ef3c 72 };
scachat 0:31e91bb0ef3c 73
scachat 0:31e91bb0ef3c 74 #endif