Results 481 to 490 of 757
-
12-09-2014, 10:31 AM #481
This single error might explain the flakey behavior of your system. Let's dig in:
In Configuration.h you have the number of servo's defined as 1 in a statement like this:
#define NUM_SERVOS 1 // Servo index starts with 0 for M280 command
Let's check the data structures in Marlin_main.cpp. At roughly 400 line into the file you will see a declaration:
Code:#if NUM_SERVOS > 0 Servo servos[NUM_SERVOS]; #endif
Code:static void engage_z_probe() { // Engage Z Servo endstop if enabled #ifdef SERVO_ENDSTOPS if (servo_endstops[Z_AXIS] > -1) { #if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0) servos[servo_endstops[Z_AXIS]].attach(0); #endif servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2]); #if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0) delay(PROBE_SERVO_DEACTIVATION_DELAY); servos[servo_endstops[Z_AXIS]].detach(); #endif } #endif }
Code:enum AxisEnum {X_AXIS=0, Y_AXIS=1, Z_AXIS=2, E_AXIS=3};
Code:servos[servo_endstops[Z_AXIS]].attach(0); servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2]); servos[servo_endstops[Z_AXIS]].detach();
Code:bool CooldownNoWait = true; bool target_direction;
Code:extern "C"{ extern unsigned int __bss_end; extern unsigned int __heap_start; extern void *__brkval; int freeMemory()
Last edited by Roxy; 12-09-2014 at 10:37 AM.
-
12-09-2014, 10:47 AM #482
- Join Date
- Aug 2014
- Posts
- 627
So, it is an issue within the ABL code itself then because you are defining how many servos you really have, in my case 1, but the code is not able, or possibly not able, to handle only a declaration of 1 servo.
If the above statement is true it would seem wise to remove the declaration to me or to fix the code (sure it up) so it can actually handle the real number of servos you actually have attached.
-
12-09-2014, 10:48 AM #483
I just did a compare of the Bdac Configuration.h file and yours... You probably want to add this line to your stuff:
Code:#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line) #define Z_PROBE_REPEATABILITY_TEST // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled. #ifdef ENABLE_AUTO_BED_LEVELING
-
12-09-2014, 10:50 AM #484
- Join Date
- Aug 2014
- Posts
- 627
#define Z_PROBE_REPEATABILITY_TEST
What is that used for in the new code?
-
12-09-2014, 11:16 AM #485
Agreed... But remember, this is Open Source. The person that did the original Auto Bed Leveling code grabbed somebody else's Servo code. And that is how the servo code was setup. This really should be cleaned up because a lot of people are making that mistake. But once again, this is Open Source... So anybody that wants it changed bad enough can make the change. Just be Thankful you have the source so these types of issues can be resolved.
This is the M48 command I wrote. I actually went through the process to get this merged back into the main code base. It will let us run some numbers once everything else is working to see how repeatable your Z-Probe is (and as a result, to see how well the Auto Bed Leveling is going to work on your system.)
-
12-09-2014, 11:33 AM #486
- Join Date
- Aug 2014
- Posts
- 627
Then how do we get to the new fork author(s) and let them know this needs to be cleaned up because this is a bad one imo. No need for OS to have this sort of stuff continue once someone finds an issue if someone is actively maintaining it, right?
-
12-09-2014, 12:06 PM #487
You would make a branch of Erik Zalm's Marlin code and fix the issue. I just checked a frozen version of the code from September 15th (rather than get the current stuff). That #define sets the number to 3, so it is correct. Probably 'fixing' this issue just involves making the comments (the documentation) much more clear. Or, you could get more clever and just make that array big enough that this problem never happens.
Once you have the code correct, you issue a 'Pull Request' to Erik Zalm and eventually he will take a look at what you did and if he likes it, he will fold it back into the main branch of the tree. It requires effort and so far nobody has done the required effort.
With that said... In another thread Dacb is supporting changes to the Marlin coded base for MakerFarm printers. (That is the code base we are going to wake up on your printer). I'm thinking I'll suggest a better set of comments for that file and if Dacb agrees, he will fold them into his Configuration.h file. Then later, when ever we (he) get around to it, the better documentation will be there when his fork gets merged back into the main Marlin tree.
UPDATE: Actually... I posted the stuff in the other thread so Dacb could add it to his fork, but I just deleted that post. The reason is I think this is OK. There is a table that gets used and it indexes into the 0 slot of that array. So declaring 1 servo is OK.
This line is used:
int servo_endstops[] = SERVO_ENDSTOPS
with SERVO_ENDOSTOPS defined as:
#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
That one line isn't causing your flakey behaviour....Last edited by Roxy; 12-09-2014 at 12:29 PM.
-
12-09-2014, 12:07 PM #488
- Join Date
- Aug 2014
- Posts
- 627
I have compiled it and it did compile fine with all of these changes.
-
12-09-2014, 01:47 PM #489
- Join Date
- Aug 2014
- Posts
- 627
Well, what do I do now? It compiled but I did not flash.
-
12-09-2014, 02:34 PM #490
New member with print issue
06-11-2024, 08:57 AM in Tips, Tricks and Tech Help