Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…load successfully
  • Loading branch information...
commit d802167593c4a0362cb15f0012d7c8e1a4cf18aa 1 parent 8d126dc
Jordan Miller jmil authored

Showing 1 changed file with 118 additions and 0 deletions. Show diff stats Hide diff stats

  1. +118 0 ArduinoSlaveExtruder/Configuration.h
118 ArduinoSlaveExtruder/Configuration.h
... ... @@ -0,0 +1,118 @@
  1 +/****************************************************************************************
  2 + * Here's where you define the overall electronics setup for your machine.
  3 + ****************************************************************************************/
  4 +
  5 +//
  6 +// CHOOSE WHICH EXTRUDER YOU'RE USING:
  7 +//
  8 +//#define EXTRUDER_CONTROLLER_VERSION_2_0
  9 +//#define EXTRUDER_CONTROLLER_VERSION_2_1
  10 +#define EXTRUDER_CONTROLLER_VERSION_2_2
  11 +
  12 +#define TEMPERATURE_SAMPLES 5
  13 +#define SERIAL_SPEED 38400
  14 +
  15 +//the address for commands to listen to
  16 +#define RS485_ADDRESS 0
  17 +#define PACKET_TIMEOUT 100
  18 +
  19 +/****************************************************************************************
  20 + * Here's where you define the way your motors are driven.
  21 + ****************************************************************************************/
  22 +//PWM
  23 +//#define MOTOR_STYLE 0
  24 +//ENCODER
  25 +//#define MOTOR_STYLE 1
  26 +//STEPPER
  27 +#define MOTOR_STYLE 2
  28 +
  29 +//do you want to reverse the motor?
  30 +#define DELAY_FOR_STOP 5
  31 +#define MOTOR_REVERSE_DURATION 300
  32 +#define MOTOR_FORWARD_DURATION 300
  33 +
  34 +/****************************************************************************************
  35 + * Is there a heated build platform?
  36 + ****************************************************************************************/
  37 +
  38 +#define HAS_HEATED_BUILD_PLATFORM 1
  39 +// Define the default temperature for the heated build platform
  40 +#define DEFAULT_PLATFORM_TEMPERATURE 0
  41 +
  42 +/****************************************************************************************
  43 + * Define the PID behavior for the heater
  44 + ****************************************************************************************/
  45 +/// Set to true to use PID for temperature.
  46 +/// false uses the old on-off mechanism.
  47 +#define TEMP_PID 1
  48 +
  49 +/// The interval between heater updates, in milliseconds.
  50 +#define TEMP_UPDATE_INTERVAL 200
  51 +#define TEMP_PID_INTEGRAL_DRIVE_MAX 110
  52 +#define TEMP_PID_PGAIN 5.0
  53 +#define TEMP_PID_IGAIN 0.1
  54 +#define TEMP_PID_DGAIN 100.0
  55 +
  56 +/****************************************************************************************
  57 + * Here's where you define the speed PID behavior for an encoder
  58 + ****************************************************************************************/
  59 +//#define INVERT_QUADRATURE
  60 +#define MIN_SPEED 50 //minimum PWM speed to use
  61 +#define MAX_SPEED 255 //maximum PWM speed to use
  62 +#define SPEED_ERROR_MARGIN 10 //our error margin (to prevent constant seeking)
  63 +#define SPEED_INITIAL_PGAIN 1 //our proportional gain.
  64 +#define SPEED_INITIAL_IGAIN 100 //our integral gain.
  65 +#define SPEED_INITIAL_DGAIN 10 //our derivative gain.
  66 +
  67 +
  68 +/****************************************************************************************
  69 + * Here's where you define the configuration for the stepper.
  70 + ****************************************************************************************/
  71 +#define MOTOR_STEPS 200 //number of steps per revolution
  72 +#define MOTOR_STEP_MULTIPLIER 2 //step multiplier (full = 1, half=2, etc.)
  73 +
  74 +/****************************************************************************************
  75 + * Sanguino Pin Assignment
  76 + ****************************************************************************************/
  77 +
  78 +//these are the pins for the v2.0 Extruder Controller
  79 +#if defined(EXTRUDER_CONTROLLER_VERSION_2_0) || defined(EXTRUDER_CONTROLLER_VERSION_2_1) || defined(EXTRUDER_CONTROLLER_VERSION_2_2)
  80 +
  81 +#define ENCODER_A_PIN 2
  82 +#define ENCODER_B_PIN 3
  83 +
  84 +#define RX_ENABLE_PIN 4
  85 +#define TX_ENABLE_PIN 16
  86 +
  87 +#define MOTOR_1_SPEED_PIN 5
  88 +#define MOTOR_1_DIR_PIN 7
  89 +#define MOTOR_2_SPEED_PIN 6
  90 +#define MOTOR_2_DIR_PIN 8
  91 +
  92 +#define SERVO1_PIN 9
  93 +#define SERVO2_PIN 10
  94 +
  95 +#define EXTRUDER_HEATER_PIN 11
  96 +#define EXTRUDER_THERMISTOR_PIN 3
  97 +
  98 +#ifdef HAS_HEATED_BUILD_PLATFORM
  99 + #define PLATFORM_HEATER_PIN 15
  100 + #define PLATFORM_THERMISTOR_PIN 6
  101 +#else
  102 + #define VALVE_PIN 15
  103 +#endif
  104 +
  105 +#define FAN_PIN 12
  106 +
  107 +#define DEBUG_PIN 13
  108 +
  109 +#endif
  110 +
  111 +//quadrature encoder behavior
  112 +#ifdef INVERT_QUADRATURE
  113 +#define QUADRATURE_INCREMENT speed_error--;
  114 +#define QUADRATURE_DECREMENT speed_error++;
  115 +#else
  116 +#define QUADRATURE_INCREMENT speed_error++;
  117 +#define QUADRATURE_DECREMENT speed_error--;
  118 +#endif

0 comments on commit d802167

Please sign in to comment.
Something went wrong with that request. Please try again.