Calculating homing speeds



  • Hi to all,

    I am new - so to say: a noob - as I am currently trying to build my 1st printer using own design after scanning tons of internet pages. My project consists of a portal type cartesian printer (Y-axis (500mm) with moving bed, X-axis (500mm) and Z-axis (300mm)). The Y- and X-axes are driven by leadscrews with attached steppers, The Z-axis has 2 parallel leadscrews to move the X-Axis with the printhead. For the controller I chose the DUET 2 WiFi and have updated the firmware for v3.1.1 before starting the config+ testing. Power is provided by a 24V supply, a separate 12V/5V one is for future expansions. The stepper motors are all Nema 23 (some china product 57BYGH56) with 1.8°, 0.9 Nm , 3A rated, 0.8Ohm, 1.4mH from data sheet). I used these values for the EMF calculator at reprapFirmware.org which showed for a current of 1400 mA and 185 mm/sec speed nice green values for peak EMF (0.7 and 22.8V) as well as step pulse freq 118.4 kHz at 185 mm/sec.
    I entered those values into my config.g for the DUET2 with
    M569 P0 S1 ; physical drive 0 forward
    M569 P1 S0 ; physical drive 1 backwards
    M569 P2 S1 ; physical drive 2 forward
    ;M569 P3 S1 ; physical drive 3 forward
    M584 X0 Y1 Z2 ; set drive mapping
    M350 X16 Y16 Z16 I1 ; configure microstep + Interp.
    M92 X640 Y640 Z640 ; set steps per mm = 1.8° * 200 -> 360° is 5 mm -> 40 steps per mm * 16 === 640
    M566 X1000.00 Y1000.00 Z500.00 ; set maximum instantaneous speed changes (mm/min)
    M203 X11000.00 Y11000.00 Z5500.00 ; set maximum speeds (mm/min) - around 185*60
    M201 X3500.00 Y3500.00 Z2000.00 ; set accelerations (mm/s^2)
    M906 X1400 Y1400 Z1400 I30 ; set motor currents (mA) and motor idle factor in per cent
    ....
    and adapted the homex.g for
    G91 ; relative positioning
    G1 H2 Z5 F800 ; lift Z 5mm relative to current position

    M906 X1400
    G1 H1 X-495 F2500 ; move quickly to X axis (first pass)
    G1 H2 X5 F1500 ; go back a few mm
    G1 H1 X-15 F800 ; move slowly to X axis (second pass)
    ;M906 X800
    G1 H2 Z-5 F800 ; lower Z again
    G90 ; absolute positioning
    G92 X0
    ....
    the other axes are set similar.

    BUT: as you can see from the homex.g script, the F-parameter which sets the speed is given with F2500 as this seems the maximum speed I can get! Values beyond are blocking the steppers and produce strange noises. My question is what is wrong with the calculated max speed of 11000 mm/min (around 185 mm/sec)?

    Where am I wrong with my testing to get fast homing?

    A 2nd question would be: how can I shortcut the homing (including that Z-axis up/down part) when the axis is already in home? Any possibility to recognize this state and just quit the homex.g script at the start?



  • @hlwerschner

    Hi,

    I didn't see were you listed the lead of the lead screws on the steppers. In the comment for M92 you show one revolution yields 5 mm of movement. Is that correct?

    As to the homing issue given the length of time printing tends to take saving a few extra seconds during homing is perhaps not that big of deal.

    On my printers I home Z first and then move to Z=10. Then I can home X and Y without moving Z at all.

    Frederick



  • @hlwerschner said in Calculating homing speeds:

    F-parameter which sets the speed is given with F2500 as this seems the maximum speed I can get

    A stepper's maximum speed is about 1000 rotations per minute, so maximum 16 rotations every second. In your case 5 mm per rotation = 80 mm/s maximum (compared to belt driven: 20 pulley = 40 mm per rotation). But in most cases the stepper are used at about 5 rotations per second because with higher speeds torque drops. To get faster speeds, you need a gear between stepper and your ball screw(?) or a servo with 3000/4000 rotations per minute (eg iHSV Servos. But the Servos would not be connected to the TMC stepper drivers, but as external drivers).

    Steppers loose torque at high speed, hence to try staying at relative low speed. Servos don't loose torque at high speed, but they are more expensive than steppers (especially if you have already payed for the drivers).

    If I use a different calculator: https://www.allaboutcircuits.com/tools/stepper-motor-calculator/ it says that maximum speed is about 14 revolutions/s. (This calculator calculates power wrong however. P=I² * R must be used).


  • Moderator

    @hlwerschner said in Calculating homing speeds:

    A 2nd question would be: how can I shortcut the homing (including that Z-axis up/down part) when the axis is already in home? Any possibility to recognize this state and just quit the homex.g script at the start?

    This is where conditional gcode comes in, though as you are just starting, perhaps focus on the basics for the time being and do some research on the forum for conditional gcode and you will eventually find the examples you are looking for.

    Your motors sound like they may not be as well suited to the Duet wifi as you think. 3a rated current, but only running at 1400ma may be too low. It's usually recommended to target 60-85% of the rated current. So in your case, 2500ma, but that's higher than the wifi can provide. So perhaps try increasing your current to 2000, but also ensure that you are actively cooling the board as the drivers will get quite warm.

    Also your expectation of top speed is rather ambitious. I suggest you start a much lower speed and slowly increase and test to find a useful practical maximum.



  • @JoergS5 said in Calculating homing speeds:

    80 mm/s

    Thank you for your comments and hints, its really appreciated.
    @fcwilt : I had to find an appropriate english translation for the mechanics: "Linearführungswelle" in German is "linear guide rails" or "Leadscrew" which is used in that emf calculator as choice of belt / leadscrew. The steppers are directly attached to each guide rail (500mm / 300mm length and 16 mm steel diameter of the rod with 5mm for each full turn). As I started with the duet3 configs as a guide for first tests, I use the webcontrol which has a builtin sequence to first home x then y and finally z (aside from homeall.g). I also started with the generated scripts for homex/y/z which I now have adapted after my tests, but they did contain initial values which I may have interpreted wrongly (for example that G1 ... F6000 speed).

    @JoergS5 : Yes, that 2nd calculator did also help (had seen it while searching more infos on steppers in general). The 1000 rpms are absolutely OK for me...I simply was confused about values produced by that emf calculator which showed max speed of 11000 steps. So much for the theory!
    In fact I do not search for the max speed to USE it, I want to understand the theory behind all values and establish a SAFE max / min range for reasonble working of my project. As I have built the frame of the machine for the axes etc to allow installation of a cnc mill head instead of the hotend, I do know that mills will need much slower movements relative to 3d printing.

    @Phaedrux: I did see the annoucements for the conditional (meta-)commands and studied the available docs but that stuff is currently incomplete (no variables...) and/or work in progress, its promising. So far I will follow its features and when I consider my project ready, some of those features may be of great use (checking if endstops are already triggered, some complete z-probe cycles in one script etc).

    Regarding your comment about the 2500ma for the DUET2 WiFi: the docs tell me that "...Duet 2 WiFi and Duet 2 Ethernet (maximum motor current 2.4A RMS) => Stepper motor rated current <= 3.0A ..." - do I missinterpret something here? Btw: my choice of around 1400ma keeps all the electronics very cool and I like it that way 🙂 Nevertheless I will use good cooling as this is always good to do. The whole machine will be so loud, that some fans are not the problem!

    To state it again: My research for the "top speed" was started with the wish to understand the working conditions and ensure that I will add safe min/max ranges for critical settings. The reality of good printings (and later milling) will have to work in these ranges and I am a patient guy who likes to watch my machine doing something (useful). Remember: its my first mechanical project in my life and I want to learn ... sometimes by smoketests 😉

    I did a lot of pretests with other electronics + cnc/printer software but I am really impressed about the quality of the DUET hardware as well as of RepRap software. I am sure that this is a solid basis to built nice machines with it. And this forum is also quite helpful!



  • @hlwerschner said in Calculating homing speeds:

    @fcwilt : I had to find an appropriate english translation for the mechanics: "Linearführungswelle" in German is "linear guide rails" or "Leadscrew"

    Thank you for the reply.

    What was your reason for using lead screws to move X and Y rather than belts?

    I think that if you wanted greater speed you could have obtained that with belts

    Thanks.

    Frederick



  • @hlwerschner I think the 11000 steps come from the EMF calculator: the top section is what you want to achieve, but this is not what the stepper is able to do. What the stepper is able to do is more what is in the section below at which speed the torque drops. The step pulse is important, because the Duet 2 is limited to about 120 kHz per driver. If you have more, you can loose steps. This is visible by high values of hiccups in the M122 report.

    If you run Duet 2 with high current, you shoud cool the Duet with a fan in any case. My personal recommendation is to unburden the Duet by not heating the bed directly through the Duet, but use a separate PSU and controlling the current through SSR or similar (if you heat your bed).



  • @fcwilt Hi, to your question about screws vs belts:
    First, I got into that whole building such a machine when I thought about a cnc mill. That is the reason why I first designed a very sturdy aluminium profile frame using mostly 30mm * 120 mm profiles for the outer frame, 30mm * 60 mm internal stabilization profiles and 60mm * 60mm profiles for the portal. Looking for the movement, I was lucky to get two 500 mm linear rails (screws) [around 50EUR each] from a china company which was very supportive and fast. They look very solid and good quality and provide smooth and vibrationfree working. When I had choosen the controller (the last one I found and liked was the DUET 2 at that time) , I discovered that the same machine could also be used as a printer, just swapping the mechanics (basically) and adapting the RepRap configs. One of my friends also pointed to the possibilities with such a variant and in addition I would have easier setup/testing. This way, I will start with the 3d printing option and later look into milling...

    Again to state: I definitely do not NEED high speed, its just to know about the limits of all components to finally be able to diagnose strange behaviour. I am an old IT guy (more than 45 years in the job) and have done several electronics development also (starting with Apple, Atari, PC graphics etc). Now I am with all those funny small controllers and this project...after so many years with big mainframes 🙂



  • @JoergS5 said in Calculating homing speeds:

    11000

    Thank you for the 2nd comment. I tried to recreate my entries into that calculator and take a screen shot:

    (if this uploaded picture is visible) yoou will notice that the calculator seemed quite happy with my values...Just for the evaluation of max values possible, NOT my goal to really run my machine with that speed. But as I said, the real world is very mucher lower than the values and that caused me to search for experts telling me where the theory was missinterpreted by me.

    You are absolutely right that these values would demand lots of additional work and considerations...



  • Hmm, I did upload a file, but nothing shows...![alt text](iemf-calculator-24-07-_2020_16-10-12.png mage url)



  • @hlwerschner said in Calculating homing speeds:

    @fcwilt Hi, to your question about screws vs belts:

    Thanks for the info. Sounds like a lot of fun. Those extrusions should most certainly result in a very strong frame.

    Keep us informed as to this project - it is very interesting.

    Frederick



  • @hlwerschner holding torque 0.9 Ncm is wrong, take 90. 0.9 would be 0.9 Nm. Then you get other values...


Log in to reply