Permalink
Browse files

old v1.8 extruder firmware for stepper motor control, compiles and up…

…load successfully
  • Loading branch information...
1 parent 8d126dc commit d802167593c4a0362cb15f0012d7c8e1a4cf18aa Jordan Miller committed Apr 23, 2010
Showing with 118 additions and 0 deletions.
  1. +118 −0 ArduinoSlaveExtruder/Configuration.h
@@ -0,0 +1,118 @@
+/****************************************************************************************
+ * Here's where you define the overall electronics setup for your machine.
+ ****************************************************************************************/
+
+//
+// CHOOSE WHICH EXTRUDER YOU'RE USING:
+//
+//#define EXTRUDER_CONTROLLER_VERSION_2_0
+//#define EXTRUDER_CONTROLLER_VERSION_2_1
+#define EXTRUDER_CONTROLLER_VERSION_2_2
+
+#define TEMPERATURE_SAMPLES 5
+#define SERIAL_SPEED 38400
+
+//the address for commands to listen to
+#define RS485_ADDRESS 0
+#define PACKET_TIMEOUT 100
+
+/****************************************************************************************
+ * Here's where you define the way your motors are driven.
+ ****************************************************************************************/
+//PWM
+//#define MOTOR_STYLE 0
+//ENCODER
+//#define MOTOR_STYLE 1
+//STEPPER
+#define MOTOR_STYLE 2
+
+//do you want to reverse the motor?
+#define DELAY_FOR_STOP 5
+#define MOTOR_REVERSE_DURATION 300
+#define MOTOR_FORWARD_DURATION 300
+
+/****************************************************************************************
+ * Is there a heated build platform?
+ ****************************************************************************************/
+
+#define HAS_HEATED_BUILD_PLATFORM 1
+// Define the default temperature for the heated build platform
+#define DEFAULT_PLATFORM_TEMPERATURE 0
+
+/****************************************************************************************
+ * Define the PID behavior for the heater
+ ****************************************************************************************/
+/// Set to true to use PID for temperature.
+/// false uses the old on-off mechanism.
+#define TEMP_PID 1
+
+/// The interval between heater updates, in milliseconds.
+#define TEMP_UPDATE_INTERVAL 200
+#define TEMP_PID_INTEGRAL_DRIVE_MAX 110
+#define TEMP_PID_PGAIN 5.0
+#define TEMP_PID_IGAIN 0.1
+#define TEMP_PID_DGAIN 100.0
+
+/****************************************************************************************
+ * Here's where you define the speed PID behavior for an encoder
+ ****************************************************************************************/
+//#define INVERT_QUADRATURE
+#define MIN_SPEED 50 //minimum PWM speed to use
+#define MAX_SPEED 255 //maximum PWM speed to use
+#define SPEED_ERROR_MARGIN 10 //our error margin (to prevent constant seeking)
+#define SPEED_INITIAL_PGAIN 1 //our proportional gain.
+#define SPEED_INITIAL_IGAIN 100 //our integral gain.
+#define SPEED_INITIAL_DGAIN 10 //our derivative gain.
+
+
+/****************************************************************************************
+ * Here's where you define the configuration for the stepper.
+ ****************************************************************************************/
+#define MOTOR_STEPS 200 //number of steps per revolution
+#define MOTOR_STEP_MULTIPLIER 2 //step multiplier (full = 1, half=2, etc.)
+
+/****************************************************************************************
+ * Sanguino Pin Assignment
+ ****************************************************************************************/
+
+//these are the pins for the v2.0 Extruder Controller
+#if defined(EXTRUDER_CONTROLLER_VERSION_2_0) || defined(EXTRUDER_CONTROLLER_VERSION_2_1) || defined(EXTRUDER_CONTROLLER_VERSION_2_2)
+
+#define ENCODER_A_PIN 2
+#define ENCODER_B_PIN 3
+
+#define RX_ENABLE_PIN 4
+#define TX_ENABLE_PIN 16
+
+#define MOTOR_1_SPEED_PIN 5
+#define MOTOR_1_DIR_PIN 7
+#define MOTOR_2_SPEED_PIN 6
+#define MOTOR_2_DIR_PIN 8
+
+#define SERVO1_PIN 9
+#define SERVO2_PIN 10
+
+#define EXTRUDER_HEATER_PIN 11
+#define EXTRUDER_THERMISTOR_PIN 3
+
+#ifdef HAS_HEATED_BUILD_PLATFORM
+ #define PLATFORM_HEATER_PIN 15
+ #define PLATFORM_THERMISTOR_PIN 6
+#else
+ #define VALVE_PIN 15
+#endif
+
+#define FAN_PIN 12
+
+#define DEBUG_PIN 13
+
+#endif
+
+//quadrature encoder behavior
+#ifdef INVERT_QUADRATURE
+#define QUADRATURE_INCREMENT speed_error--;
+#define QUADRATURE_DECREMENT speed_error++;
+#else
+#define QUADRATURE_INCREMENT speed_error++;
+#define QUADRATURE_DECREMENT speed_error--;
+#endif

0 comments on commit d802167

Please sign in to comment.