yarf 0.1
Yet Another RepRap Firmware
src/yarf.h
Go to the documentation of this file.
00001 /*
00002  * yarf.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 YARF_H
00031 #define YARF_H
00032 
00033 #include "config.h"
00034 #include "boards.h"
00035 
00039 #define NUM_AXES  4
00040 
00044 #define NUM_POS_AXES  3
00045 
00049 #define X_AXIS     0
00050 
00054 #define Y_AXIS     1
00055 
00059 #define Z_AXIS     2
00060 
00064 #define E_AXIS     3
00065 
00066 
00070 #define X_AXIS_POS X_AXIS
00071 
00075 #define Y_AXIS_POS Y_AXIS
00076 
00080 #define Z_AXIS_POS Z_AXIS
00081 
00085 #define E_AXIS_POS E_AXIS
00086 
00090 #define X_AXIS_NEG 4
00091 
00095 #define Y_AXIS_NEG 5
00096 
00100 #define Z_AXIS_NEG 6
00101 
00105 #define E_AXIS_NEG 7
00106 
00110 #define X_MM_PER_STEP      (1.0/X_STEPS_PER_MM)
00111 
00115 #define Y_MM_PER_STEP      (1.0/Y_STEPS_PER_MM)
00116 
00120 #define Z_MM_PER_STEP      (1.0/Z_STEPS_PER_MM)
00121 
00125 #define E_MM_PER_STEP      (1.0/E_STEPS_PER_MM)
00126 
00127 
00128 /* Extruder feed rate calculations */
00129 
00133 #define R_IN  (FD/2)
00134 
00138 #define R_OUT (ED/2)
00139 
00143 #define FILAMENT_INPUT_AREA (M_PI * R_IN * R_IN)
00144 
00148 #define FILAMENT_OUTPUT_AREA (M_PI * R_OUT * R_OUT)
00149 
00154 #define FL (M_PI * PWD)
00155 
00160 #define EL ( (FL * R_IN * R_IN)/(R_OUT * R_OUT) )
00161 
00166 #define E_STEPS_PER_MM_IN  (E_STEPS_PER_REV * GEAR_RATIO / FL)
00167 
00172 #define E_STEPS_PER_MM_OUT (E_STEPS_PER_MM_IN * FL / EL)
00173 
00179 #define E_MAX_SPEED_OUT    (E_MAX_SPEED_IN * FL / EL)
00180 
00186 #define E_MAX_ADVANCE_OUT  (E_MAX_ADVANCE_SPEED_IN * FL / EL)
00187 
00188 
00189 #if E_COORDINATES_ARE_INPUT
00190 #define E_STEPS_PER_MM           E_STEPS_PER_MM_IN
00191 #define E_MAX_SPEED              E_MAX_SPEED_IN
00192 #define E_MAX_ADVANCE_SPEED      E_MAX_ADVANCE_SPEED_IN
00193 #else
00194 #define E_STEPS_PER_MM           E_STEPS_PER_MM_OUT
00195 #define E_MAX_SPEED              E_MAX_SPEED_OUT
00196 #define E_MAX_ADVANCE_SPEED      E_MAX_ADVANCE_SPEED_OUT
00197 #endif
00198 
00203 #define HOST_USART usart0_stream
00204 
00208 typedef long steps_t;
00209 
00213 typedef unsigned int speed_t;
00214 
00215 #endif // YARF_H
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines