yarf 0.1
Yet Another RepRap Firmware
src/movement/block.h
Go to the documentation of this file.
00001 /*
00002  * block.h
00003  *
00004  * Copyright 2011 Pieter Agten
00005  *
00006  * This file is part of Yarf.
00007  *
00008  * Yarf is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation, either version 3 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * Yarf is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with Yarf.  If not, see <http://www.gnu.org/licenses/>.
00020  */
00021 
00030 #ifndef BLOCK_H
00031 #define BLOCK_H
00032 
00033 #include "yarf.h"
00034 #include "util/fixed_point.h"
00035 
00036 #include <stdbool.h>
00037 #include <stdint.h>
00038 
00064 typedef struct {
00065   unsigned int id;                    
00067   // Needed for block_handler:
00068   uint32_t nb_steps;                  
00069   uint32_t nb_steps_completed;        
00070   steps_t steps[NUM_AXES];            
00071   void (*collision_handler)(uint8_t); 
00073   fxp16u16_t timer_ticks;            
00074   fxp16u16_t plateau_timer_ticks;    
00075   fxp16u16_t exit_timer_ticks;       
00076   uint16_t acceleration_step;        
00077   uint16_t acceleration_end;         
00078   uint32_t deceleration_start;       
00081   // For avoiding duplicate calculations:
00082   float distance_mm;                 
00083   float mm_ticks_per_step_min;       
00084   float direction[NUM_AXES];         
00085   speed_t plateau_speed;             
00087 #if PLANNER_LOOKAHEAD
00088   speed_t entry_speed;               
00089   speed_t max_entry_speed;           
00091   bool plateau_speed_always_reachable; 
00092   bool recalculate; 
00093 #endif
00094 
00095 #if ADVANCE_ALGORITHM
00096   bool use_advance;            
00097 //  uint32_t advance_multiplier; /**< A precalculated value to speed up the advance steps calculation. */
00098   float advance_multiplier;
00099   int32_t advance;            
00100 #endif
00101 } block_t;
00102 
00103 #endif //BLOCK_H
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines