-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
to capture chars at UART at 250000 baud.
- Loading branch information
Sebastianv650
committed
Nov 28, 2016
1 parent
5005969
commit 912704a
Showing
1 changed file
with
5 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
912704a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next to this being super super super dangerous, you most likely broke stepping when baby stepping is used.
I would recommend actually fixing the core problem if doing to much unneeded shit in the interrupt routine.
912704a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is an issue with babystepping, please provide the issue number.
If you find unneded shit in the ISR, feel free to create an issue with a proposal or create a PR - nobody will keep this ISR thing if there is a better solution.
In fact, there was no solution when I did this changes and it solves all problems I had like communication errors, followed by hiccups due to buffer underrun, wired printer movements and so on.
912704a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you most likely fixed buffering problems, and introduced a whole bunch of race conditions in the process that will influence stability. I'm just saying you are trading one problem for another.
I'm just warning you. I'm not using this version of Marlin. We never had buffering problems in the older fork of Marlin I'm using at 250000. You're free to ignore my warning. I just flew by because I wanted to check something else and noticed this commit by chance.
But I can give you one example of where you are pretty much messing thing up, and that's the whole endstop monitoring function which sends data out on serial.
The baby stepping is going to give problems because that function pretty much looks like designed to be ran without being interrupted from the stepper interrupt. As they are both accessing the same pins.
912704a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can read the whole problem in #3680. The basic problem is quite simple to understand, but there are only two options to solve it:
Up to now I have no issue in mind where the endstop monitoring or babystepping is broken. But you are right that this block of code inside the temperature ISR should be protected by further stepper ISRs.
Can you be more specific to the endstop monitoring function? I don't see how this should be affected.
912704a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not saying the problem isn't real. I'm just stating that your solution is wrong and will cause you more pain then gain.
The problem with baby stepping is that the baby stepping can now be interrupted by the stepper, where they both work on the same IOs. Giving two "masters".
The problem with endstop monitoring is that it does serial output, which takes a long time, causing the interrupt to block and the whole reason you are having problems is that interrupts are taking too long. So that is one source of your problems.
If nozzle-mixing and pressure-compensation are done in interrupts then the problems are bigger than I thought and I'd better shut up. (I am wondering what the maximum step rate is now. As this is one of the problems we ARE running into with our current Marlin code)
912704a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. It's running just fine on my printer. As stated before, if you have a better idea or a PR, we will be open for everything. If not, don't complain about fixes that are not nice but the best the Marlin community has up to now.
Regarding babystepping I will create a Issue to discuss two options I have in mind.
PINS_DEBUGGING, as the name is saying it, is for debugging purposes and not for production print runs. Therefore my oppinion is that it's OK to do serial outputs within an ISR. Beside that, this feature is not related to this PR. It was also sending over serial before.
Everything that can be done is calculated inside the planner and added to the block buffer. But there are things that can't be calculated in advance, this are calculated inside the stepper ISR. Again, if you have ideas for improvements or PRs, just open a ticket..
There is no one fixed step rate. Marlin has a lot of features that adds additions load to the processor, therefore the real maximum step rate will vary.
For example on a plain non-kinematic printer without fancy features, LCD and other things enabled it should run as fast or maybe even faster than Marlin 1.0.
If you use a CORE-kinematic, together with MBL, maybe a mixing extruder, graphical LCD and so on you will most likely not reach the 40kHz step rate. For this reason, there is an active discussion about a future 32bit board for Marlin.
912704a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UM2 with graphical LCD and SD support has no problems with the 40k step rate. CoreXY should not effect this. Delta has a problem but that's more related to planner speed.
I have experiments with 60khz step rates, the hard limit seems to be around ~65khz on 5 steppers, then you simply cannot work with 5 steppers and do the required instructions with interrupt overhead and endstop sampling, and still handle the UART. Even if you strip everything.
Like I said, I don't care what you do with this code, just warning you. You are free to ignore my warning.
"It works for me" isn't really the best way forward in highly time critical embedded code with this many configuration options IMHO.
In the end, you're not hurting me, or any of the products I support. You might only hurt yourself or the community using this version of Marlin.
912704a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. Race conditions are exactly what we're up against now.
912704a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 from me too!
@Sebastianv650 opened a discussion on #5946
I would vote for safety first. Never give race conditions a chance when working with hot hardware...
912704a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also be curious about this. And, is it better or worse than Marlin 1.0.x?