Re: Teensy 3.1 & Delta support February 07, 2015 06:38AM |
Registered: 11 years ago Posts: 14,686 |
Quote
Traumflug
For good printing results, acceleration/speed of the extruder matters. That said, all this approxximation with short segments is a bit a kludge, of course. I fear we can't avoid this kludge for now, making step-accurate movements curved and also properly accelerating and also constant velocity is pretty tricky.
Re: Teensy 3.1 & Delta support February 07, 2015 06:45AM |
Registered: 14 years ago Posts: 7,616 |
Generation 7 Electronics | Teacup Firmware | RepRap DIY |
Re: Teensy 3.1 & Delta support February 07, 2015 07:09AM |
Registered: 11 years ago Posts: 14,686 |
Re: Teensy 3.1 & Delta support February 07, 2015 07:52AM |
Registered: 14 years ago Posts: 7,616 |
Quote
dc42
Traumflug, you can find all the movement code in modules Move, DDA and DriveMovement. The per-step calculations are done in DriveMovement.
Quote
dc42
You didn't say what controller you are using, so I can't comment on what speed you would achieve if you used the same algorithms.
Generation 7 Electronics | Teacup Firmware | RepRap DIY |
Shall we call it "1 Click Configuration"? February 08, 2015 06:30AM |
Registered: 14 years ago Posts: 7,616 |
Excursion to dc42 firmware February 10, 2015 05:44PM |
Registered: 14 years ago Posts: 7,616 |
Quote
dc42
Traumflug, you can find all the movement code in modules Move, DDA and DriveMovement.
:~/RepRap/RepRapFirmware$ grep -rn DriveMovement . :~/RepRap/RepRapFirmware$ grep -rn DriveM . :~/RepRap/RepRapFirmware$
Quote
dc42
I think that is close to the limit on that hardware.
Generation 7 Electronics | Teacup Firmware | RepRap DIY |
Re: Excursion to dc42 firmware February 10, 2015 06:53PM |
Registered: 11 years ago Posts: 14,686 |
Re: Excursion to dc42 firmware February 10, 2015 09:07PM |
Registered: 14 years ago Posts: 7,616 |
Quote
dc42
That's the right repo, but the wrong branch. The code is in the dev branch.
Quote
dc42
Traumflug, you can find all the movement code in modules Move, DDA and DriveMovement. The per-step calculations are done in DriveMovement.
Quote
dc42
I have tested it up to 500mm/sec on my Mini Kossel with Duet electronics, and I think that is close to the limit on that hardware.
Generation 7 Electronics | Teacup Firmware | RepRap DIY |
Re: Excursion to dc42 firmware February 11, 2015 04:57AM |
Registered: 11 years ago Posts: 14,686 |
Quote
Traumflug
Please correct me if I'm wrong, I see there one timer and you calculate time intervals not from one step of the fastest stepper to the next of the fastest stepper, but from one step to the next, no matter on which motor this next step happens. If two steppers should step at the same time, you call ScheduleInterrupt(0) (would be setTimer(0) in Teacup parlance). That's good, and I especially like this "repeat" flag!
Quote
Traumflug
Total lack of optimisation and the about most computing intensive algorithm one could think of. On an ATmega one could sure be happy to reach 1000 steps/second.
Re: Excursion to dc42 firmware February 11, 2015 06:16AM |
Registered: 14 years ago Posts: 7,616 |
Quote
dc42Quote
Traumflug
Total lack of optimisation and the about most computing intensive algorithm one could think of. On an ATmega one could sure be happy to reach 1000 steps/second.
Traumflug, I find that comment insulting. The algorithm calculates the step interval on a delta precisely (to better than 1us) instead of resorting to approximating linear moves in XYZ space as linear moves in delta space. If you can come up with a significantly better algorithm that achieves the same goal, please share it. As for optimisation, all the per-step calculations are done in integer maths. The square root function, which dominates the step interval calculation time, has been optimised by using a good algorithm and loop unrolling - but another user with ARM assembler experience is rewriting it in assembler to see if it can be speeded up further.
It is often said in software engineering circles that premature optimisation is the root of all evil - which is an exaggeration of course but contains more than a grain of truth. I have optimised the code sufficiently for the purpose for which it is intended, which is to drive 3D printers based on Duet or similar 32-bit electronics, leaving enough CPU cycles for the web interface, PanelDue etc. The 500mm/s I can achieve on a delta is significantly faster than most users want to use. I have no intention of trying to run it on an atmega or other 8-bit processor.
Generation 7 Electronics | Teacup Firmware | RepRap DIY |
Re: Excursion to dc42 firmware February 11, 2015 07:25AM |
Registered: 11 years ago Posts: 14,686 |
Quote
Traumflug
As for optimisation opportunities, rewriting parts in assembler is the kind of optimisation I consider to be evil. Maybe you gain a few cycles but totally loose portability and readability. Compilers are very good at compiling to fast and efficient binaries, no need to mess with this.
Re: Excursion to dc42 firmware February 11, 2015 08:54AM |
Registered: 14 years ago Posts: 7,616 |
Quote
dc42
why bother when the mcu is fast enough to do the full calculation on each step? As I have said elsewhere, I think 8-bit processors make no sense as 3D printer controllers any more.
Generation 7 Electronics | Teacup Firmware | RepRap DIY |
Re: Excursion to dc42 firmware February 11, 2015 09:38AM |
Registered: 11 years ago Posts: 14,686 |
Quote
Traumflug
Trying to declare 8-bit controllers as obsolete is just like trying to declare gasoline cars as a thing of the past.
Quote
Traumflug
Your code works on one single controller (current Duet) and one single kinematics type (Deltas) only.
Quote
Traumflug
Even if suddenly all controllers were 32-bit, what do you do when the next Duet comes with 1/128 microstepping drivers? Suddenly you're in a position much the same as 8-bits are now: you're limited in achievable printing speeds.
Re: Excursion to dc42 firmware February 11, 2015 01:39PM |
Registered: 14 years ago Posts: 7,616 |
Quote
dc42
I'm not declaring them as obsolete, just as inappropriate for the application
Generation 7 Electronics | Teacup Firmware | RepRap DIY |
Re: Excursion to dc42 firmware February 11, 2015 02:03PM |
Registered: 11 years ago Posts: 14,686 |
Quote
Traumflug
Quote
dc42
I'm not declaring them as obsolete, just as inappropriate for the application
I see. It's pointless to try to get 32-bit fans into joining writing fast and efficient code.
Re: Excursion to dc42 firmware February 11, 2015 02:20PM |
Registered: 14 years ago Posts: 7,616 |
Quote
dc42
My current code is fast enough to run a 3D printer at high speeds
Quote
dc42
(cheaper than the atmega2560) on a cheap (cheaper than the atmega2560) microcontroller
Generation 7 Electronics | Teacup Firmware | RepRap DIY |
Re: Excursion to dc42 firmware February 13, 2015 08:37AM |
Registered: 11 years ago Posts: 14,686 |
Quote
Traumflug
Quote
dc42
on a cheap (cheaper than the atmega2560) microcontroller
People should be very interested where you get these controllers. Or how you leverage the processing speed of a cheap CPU without expensive controller around it. To the best of my knowledge, there are no such things. Even the affordable Teensy3 is more than double the price of an comparable Arduino Nano.
Re: Project: Teacup Firmware February 15, 2015 07:16AM |
Registered: 11 years ago Posts: 91 |
An excursion to aprinter firmware :-) February 15, 2015 09:24AM |
Registered: 14 years ago Posts: 7,616 |
Generation 7 Electronics | Teacup Firmware | RepRap DIY |
Re: Project: Teacup Firmware February 15, 2015 10:32AM |
Registered: 10 years ago Posts: 9 |
Re: Project: Teacup Firmware February 15, 2015 12:49PM |
Registered: 11 years ago Posts: 91 |
Re: Project: Teacup Firmware February 15, 2015 04:11PM |
Registered: 11 years ago Posts: 14,686 |
Quote
NickE
@dc42 and @ambrop7,
Looking at your firmwares, I am trying to get the flow of what is happening, but it looks like it will take hours of code analysis
Can you please give me a simple flowchart or pseudocode of the steps being taken to calculate the step times?
I would appreciate it very much!
Re: Project: Teacup Firmware February 16, 2015 01:33PM |
Registered: 10 years ago Posts: 9 |
Re: Project: Teacup Firmware February 16, 2015 01:49PM |
Registered: 10 years ago Posts: 9 |
Re: Project: Teacup Firmware February 16, 2015 05:28PM |
Registered: 14 years ago Posts: 7,616 |
Re: Project: Teacup Firmware February 21, 2015 10:28PM |
Registered: 10 years ago Posts: 1 |
Re: Project: Teacup Firmware April 17, 2015 08:01PM |
Registered: 14 years ago Posts: 87 |
Re: Project: Teacup Firmware April 17, 2015 08:37PM |
Registered: 14 years ago Posts: 7,616 |
Quote
Myndale
Not sure if anyone's interested but I did a write-up a few years ago on the maths used in my own Repic firmware
Quote
Myndale
I haven't been able to find any implementations of teacup that print off SD card? I see there's support for writing to SD but not printing, have I missed something or has it just not been added yet?
Generation 7 Electronics | Teacup Firmware | RepRap DIY |
Re: Project: Teacup Firmware April 22, 2015 01:23PM |
Registered: 11 years ago Posts: 8 |
Re: Project: Teacup Firmware April 22, 2015 02:49PM |
Registered: 14 years ago Posts: 7,616 |
Quote
nilrods
Repic5D software. [...] I had a couple questions on it if you don't mind.
Quote
nilrods
[forums.reprap.org]
Generation 7 Electronics | Teacup Firmware | RepRap DIY |