Fork of Smoothie to port to mbed non-LPC targets.
Fork of Smoothie by
Stepper.h
00001 /* 00002 This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl). 00003 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. 00004 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. 00005 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>. 00006 */ 00007 00008 #ifndef STEPPER_H 00009 #define STEPPER_H 00010 00011 #include "libs/Module.h" 00012 00013 class Block; 00014 class Hook; 00015 class StepperMotor; 00016 00017 #define microseconds_per_step_pulse_checksum CHECKSUM("microseconds_per_step_pulse") 00018 #define acceleration_ticks_per_second_checksum CHECKSUM("acceleration_ticks_per_second") 00019 #define minimum_steps_per_minute_checksum CHECKSUM("minimum_steps_per_minute") 00020 #define base_stepping_frequency_checksum CHECKSUM("base_stepping_frequency") 00021 00022 class Stepper : public Module { 00023 public: 00024 Stepper(); 00025 void on_module_loaded(); 00026 void on_config_reload(void* argument); 00027 void on_block_begin(void* argument); 00028 void on_block_end(void* argument); 00029 void on_gcode_received(void* argument); 00030 void on_gcode_execute(void* argument); 00031 void on_play(void* argument); 00032 void on_pause(void* argument); 00033 uint32_t main_interrupt(uint32_t dummy); 00034 void trapezoid_generator_reset(); 00035 void set_step_events_per_second(float); 00036 uint32_t trapezoid_generator_tick(uint32_t dummy); 00037 uint32_t stepper_motor_finished_move(uint32_t dummy); 00038 int config_step_timer( int cycles ); 00039 void turn_enable_pins_on(); 00040 void turn_enable_pins_off(); 00041 uint32_t synchronize_acceleration(uint32_t dummy); 00042 00043 Block* current_block; 00044 int counters[3]; 00045 int stepped[3]; 00046 int offsets[3]; 00047 float counter_alpha; 00048 float counter_beta; 00049 float counter_gamma; 00050 //int step_events_completed; 00051 unsigned int out_bits; 00052 float trapezoid_adjusted_rate; 00053 int trapezoid_tick_cycle_counter; 00054 int cycles_per_step_event; 00055 bool trapezoid_generator_busy; 00056 int microseconds_per_step_pulse; 00057 int acceleration_ticks_per_second; 00058 unsigned int minimum_steps_per_second; 00059 int base_stepping_frequency; 00060 unsigned short step_bits[3]; 00061 int counter_increment; 00062 bool paused; 00063 bool force_speed_update; 00064 bool enable_pins_status; 00065 Hook* acceleration_tick_hook; 00066 00067 StepperMotor* main_stepper; 00068 00069 }; 00070 00071 00072 00073 00074 #endif
Generated on Tue Jul 12 2022 20:09:02 by 1.7.2