Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Marlin Davinci 1.0 Error
#1
I get a PID error when compiling my marlin code. Does anyone know why I am getting this error?

Arduino: 1.5.8 (Windows 8), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

ConfigurationStore.cpp: In function 'void Config_ResetDefault()':
ConfigurationStore.cpp:423:26: error: 'DEFAULT_Kp' was not declared in this scope
PID_PARAM(Kp, e) = DEFAULT_Kp;
^
ConfigurationStore.cpp:424:37: error: 'DEFAULT_Ki' was not declared in this scope
PID_PARAM(Ki, e) = scalePID_i(DEFAULT_Ki);
^
ConfigurationStore.cpp:425:37: error: 'DEFAULT_Kd' was not declared in this scope
PID_PARAM(Kd, e) = scalePID_d(DEFAULT_Kd);
^
Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.


I am using Chris's marlin code for ramps 1.4
Reply
#2
is DEFAULT_Kp defined in Configuration.h ?
Reply
#3
Thanks Luc! Actually the extruder didn't have a PID assigned. I added temp beds defaults but I am not sure if they should be the same:

#define PIDTEMP
#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
#ifdef PIDTEMP
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
//#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
// Set/get with gcode: M301 E[extruder number, 0-2]
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_INTEGRAL_DRIVE_MAX PID_MAX //limit for the integral term
#define K1 0.95 //smoothing factor within the PID
#define PID_dT ((OVERSAMPLENR * 10.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine

#define DEFAULT_Kp 10.00
#define DEFAULT_Ki .023
#define DEFAULT_Kd 305.4





As a new side issue. Planner.cpp has an issue. I will try and figure this out in the meantime.

Arduino: 1.5.8 (Windows 7), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

planner.cpp: In function 'void plan_buffer_line(const float&, const float&, const float&, const float&, float, const uint8_t&)':
planner.cpp:678:9: error: 'DISABLE_INACTIVE_EXTRUDER' was not declared in this scope
if (DISABLE_INACTIVE_EXTRUDER) //enable only selected extruder
^
Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Reply
#4
I am also using ramps optical endstops 12v supported and didn't find any info online for marlin support. I didn't load firmware yet as I don't want to fry the optics with the pins not set. Do you know a source out there? You should have a donate button luc!
Reply
#5
if you use the ramps 1.4 there is a location to plug the endstop it is defined, you do not need to know the pins , just configure the right MOTHERBOARD -

or you means you do not know which one is VCC/GND/SIG on endstop ?
Reply
#6
I know the VGS plugs but the marlin code only has a section on mechanical enstop. Nothing about optical.

//===========================================================================
//=============================Mechanical Settings===========================
//===========================================================================

// Uncomment the following line to enable CoreXY kinematics
// #define COREXY

// coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors

#ifndef ENDSTOPPULLUPS
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX
// #define ENDSTOPPULLUP_ZMAX
// #define ENDSTOPPULLUP_XMIN
// #define ENDSTOPPULLUP_YMIN
// #define ENDSTOPPULLUP_ZMIN
#endif

#ifdef ENDSTOPPULLUPS
//#define ENDSTOPPULLUP_XMAX
//#define ENDSTOPPULLUP_YMAX
//#define ENDSTOPPULLUP_ZMAX
//#define ENDSTOPPULLUP_XMIN
//#define ENDSTOPPULLUP_YMIN
//#define ENDSTOPPULLUP_ZMIN
#endif

// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
#define DISABLE_MAX_ENDSTOPS
//#define DISABLE_MIN_ENDSTOPS

// Disable max endstops for compatibility with endstop checking routine
#if defined(COREXY) && !defined(DISABLE_MAX_ENDSTOPS)
#define DISABLE_MAX_ENDSTOPS
#endif

// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
#define X_ENABLE_ON 0
#define Y_ENABLE_ON 0
#define Z_ENABLE_ON 0
#define E_ENABLE_ON 0 // For all extruders

// Disables axis when it's not being used.
#define DISABLE_X false
#define DISABLE_Y false
#define DISABLE_Z false
#define DISABLE_E false // For all extruders

#define INVERT_X_DIR true // for Mendel set to false, for Orca set to true
#define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false
#define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true
#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false

// ENDSTOP SETTINGS:
Reply
#7
http://reprapworld.com/documentation/marlin_guide.pdf

Endstops
These are more difficult. By default the settings are OK for mechanical endstops.
But if you want opto endstops you need to comment the line (place // before the
text) of the corresponding parameter
#define ENDSTOPPULLUP_...
aslo you need to change ..._ENDSTOP_INVERTING = true; to false.
So for example, if you have a machanical end stop on the X axis you need to
replace
#define ENDSTOPPULLUP_XMIN
with
//#define ENDSTOPPULLUP_XMIN
and
const bool X_MIN_ENDSTOP_INVERTING = true;
with
const bool X_MIN_ENDSTOP_INVERTING = false;
Reply
#8
So in theory this is all I need right?

I don't really understand the min vs max inverting.

// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
#define DISABLE_MAX_ENDSTOPS
Reply
#9
you only have min end stops (the ones for homing), unless you added 3 additional end stops on max positions, you do not need to care of max end stop values, but as I see you set that you only use min end stops and do not use max end stops
#define DISABLE_MAX_ENDSTOPS
//#define DISABLE_MIN_ENDSTOPS

so just focus on min end stops settings
Reply
#10
Makes sense. Thanks again. Very helpful. So optical sensors don't need inverting? I need to look into endstop pullups, they are all turned off but I don't know what that means and I'm curious to know.

Besides optical sensors being set up marlin is working great so far minus stepper drive tweaks. One guy had a good tip for tweaking them. Put positive reader on screwdriver and negative to ground and as you turn screwdriver you get live updates to multimeter.
Reply
#11
Hey Luc! I am very close to getting everything worked out. The z axis is acting funny. I tried slowing down the acceleration to see if it was moving too fast but it doesn't help.

The homing on the z is funky too, If I keep hitting auto home the z axis keeps moving up 1mm after its already homed, when I try homing over and over. The y and x axis's are homing perfectly.

Here is a video of the z axis stalling when controlling manually. (also it moves wonky when trying to control movement - up and down motions)

https://youtu.be/WW3R42Hz_5M
Reply
#12
Cannot see the video , it says it is private
EDIT: can see now

For z and also others axis be careful with acceleration - if too fast it will miss steps and movement will not be correct
Reply
#13
looks a little bit fast no ?
Be sure step/mm and acceleration are corrects, did you calibrate your Z ?
Reply
#14
Z isn't calibrated for print height yet. I am using the davinci standard steps of 2650mm and tried different travel accelerations at 20, 50, 100. Stepper driver is @ .5volts (for all steppers actually)

Z max height is @ 200mm
Reply
#15
As an update, I had some loose dupoint connectors on the x axis which fixed the x axis movement. I adjusted the POTS of the xyz. X and Y axis POTS are great for now. X axis with linear bearings is very quiet and y axis is semi noisy but need to lube. The Z axis pots adjustment didn't change its whacky behavior. I adjusted speed in firmware but still get issues. I think its skipping steps. On top of it sometimes it randomly homes the wrong way. But when the z axis stalls It whines like its trying to move, a slight turn with my hand allows it to move further but it stalls again. Stumped....

Forgot to mention, I tried switching stepper drivers with z axis to see if its hardware and z axis did not change with it's issues.
Reply
#16
Well I would suggest to decrease Z pot until rotation is smooth using homing acceleration and feedrate - ideal is doing without be connected to axis rod - usually inconsistent rotation (back and forth) is due to too high current - and if too low the motor do not turn (or just in one direction sporadically)
if it is ok without axis - then connect rod and do same homing using low acceleration - if not moving - it means it just need to increase a little the current using pot until motor get enough current.
Reply
#17
You won't believe what it was.... The z axis stepper motor had a bent pin which was causing the yellow cord not to connect causing bizarre behavior. Fixed it and its operating great. The dupoint connectors for x axis are annoying and causing skipped steps rarely. I heard you can use kapton tape around motherboard pins to create more tension for the connectors.
Reply
#18
good - so now you have a brand new printer Smile
Reply
#19
Thanks for you help Luc.
Reply
#20
You want to make it even better? Swap the z-axis for a real leadscrew instead of a threaded rod... you'd be amazed how much faster/smoother it moves...

http://www.robotdigg.com/product/31/NEMA...+Leadscrew
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)