MKS GEN-L V2.1 + TMC5160 = strange behaviour #mks #mount


Vroobel
 

Hi,

I am an ATM enthusiast, recently I finished building of my 70+ kg EQ fork mount for my 10" Newtonian telescope from a scratch:

https://stargazerslounge.com/topic/356572-my-homemade-eq-fork-mount/?do=findComment&comment=4120343

It's not entirely finished, but it's ready for some test. Several months ago I chose the OnStep @ MKS Gen-L v2.1 with the TMC5160 drivers. I have cut out the CLK pins from TMC5160 drivers and (finally) soldered short pieces of wire to GNDs, because some users still report a need of that. I have bought RPi 4 8GB RAM and installed the Astroberry system, so I try to use KStars-Ekos software. I use two 1.8 deg Nema 23 stepper motors, one is bigger for the Ra axis, second one, for the Dec axis, is smaller, but also Nema 23. The Dec drive is equipped with 80:1 CNC worm gear box while the Ra axis base on the great 100:1 harmonic gear box from the Harmonic Drive. I easily can reach a 0.5 arc sec accuracy, but after replacing the stepper motor with the 0.9 deg one I can obtain even 0.25 arc sec. 

Unfortunately I'm not happy with the set.
I used the config.h generator for the basic configuration, so it seems to work. But when I configure my setup in Ekos and try to slew to any object, after several seconds at least one axis stops immediately without deceleration. Second axis does same very soon. Doesn't matter which axis is first, its random. It's very strange, because the KStars thinks that the steppers are still working and the cross passes through the sky map to selected point. I checked, the stepper motors are in "disabled" state, I can rotate their axes. I have nothing in the log of course. When the steppers stop all the load is in danger of break: it's over 17kg! Within several weeks I checked every reasonable configuration and nothing helped. 

As my steppers consume 3.2 and 2.7A, I had to find another solution, so now I use  temporarily DM556 drivers for a CNC purposes. The MKS board is configured for the LV8729 drivers, as both the DM556 and LV8729 drivers offer 128 micro steps and the LV8729 doesn't operate on the Reset and Sleep pins. 

I found out that the 3D printers community met the same problem with the MKS Gen-L v2.1 and the TMC5160 drivers, but they also don't know what is a reason. The behaviour is exactly same. 

I'll appreciate every advice solving my problem. I am very tired and discouraged. It's no more pleasure for me. Every clear night I tried to find the reason, but recently the over 106kg setup stays in my living room, which it's very inconvenient. 


Khalid Baheyeldin
 

That mount is impressive. One you are done, please let us know, since it will go on
to the showcase page.

One possible workaround is to replace the MKS with a FYSETC S6 3D printer board.
They are known to work with the TMC5160. I use that combo myself.

But you need to check whether the power input and rating for that board can do the
3.2A + 2.7A + whatever other electronics needs are (dew heaters, WiFi, focuser, ...)

Another way is to configure the DM556 as an external driver, where the only input
from the MKS is STEP and DIR, and let the DM556 do the microstepping per the
dip switches on it. The advantage of keeping the DM556 is that it has its own
power input, and therefore less current load on the MKS.


Mike Ahner
 

As my steppers consume 3.2 and 2.7A,
We don't know whose stepper drivers you're using but you are very close to the maximum limit of step stick TMC5160 current, 3.0 amps. It suggests that your drivers may be overheating and shutting down. I would try turning the current lower following the 40%~70% rule to begin as suggested in the Wiki's first paragraph. main@onstep.groups.io | Wiki In other posts, Howard suggests starting at 35%~45%.

You don't need clear skies to test your mount, you can test it indoors just by watching where it moves during a slew. And the the size of the payload shouldn't be an issue, you have a lot of "mass" but if balanced you should only be "lifting" 1 or 2 kilograms. If you're balanced, you shouldn't need anything close to max current.

It might be useful to remove the telescope and test without any payload first. I would suggest testing with the Android app or the Website and a computer, just to see if you can slew without the drivers shutting down.


Vroobel
 

Hi,

Thank you guys for your responses.

I was very stubborn yesterday and tried to pass through different topics related with the TMC drivers, even some of them explicitly said "it's not your case...". I found accidentally something about _VQUIET, which is not mentioned in the general manual (or I missed it). I thought it's misspelling, but I tried...

My setup works with it! That's fact, the drivers are hot a little bit (~70*C), but they can do their job. The mount performed teens of GoTo jumps and didn't stopped in the way. I still have some problem with parking, but it seems to be another problem, rather related with the KStars-Ekos: the OTA sometimes stops far away from the home position, but deceleration is proper. 

I use stepper motor bought in China, its hard to say about their brand. Simple Nema 23 motors, around 1.5Nm (Ra) and  1.2Nm (Dec). That's right, the current is close to end of the range, so this is first disadvantage. The DM556 drivers can work with over 5A with no stress and they have huge heat sinks! Another disadvantage of the TMC5160 is that they aren't silent in the _VQUIET mode, while other modes don't work. The stepper motors under control of the DM556 are almost entirely silent.

Presently I don't use the PWM outputs for the dew heaters, I have made my own system of the heaters and it works well. But it's good idea, one device less. I'll think about it later.

What benefits of using the FYSETC S6 3D board instead of the MKS Gen-L v2.1 is apart the 32-bit unit? Is the slew faster? Can I use GPS and WiFi/BT module straight with the board? I use a USB GPS module, so the Ekos knows where it works. I don't need the WiFi/BT now, but it may change if I find solid reason for it. :)

Thanks again for your advises.

BTW, please give me some time for finishing the mount before you place it in the showcase. I want to paint it and make a box for all the electronics.

Best regards,
Tomasz 


Khalid Baheyeldin
 

The _VQUIET mode is discouraged because lots of people had issues with it.

Probably what is happening is that it is reducing the current enough from your excessively
high settings, to make it back to some reasonable value.

So, as advised earlier, you should re-calculate the IRUN and IGOTO per the recommended
formula, using the current rating of your motors.

IRUN = Motor current X 1.41 X 0.35
IGOTO Motor current X 1.41 X 0.55

Then, you should run with those properly calculated values, with DRIVER_MODEL set to either
TMC5160 or TMC5160_QUIET.

As for the S6, yes, it is faster, but in your case, slewing speed will not be a high priority item
for such a huge mount and optical tube, since slower is safer.

The S6 is known to work well with the TMC5160. And yes, it supports GPS too, but that only
feeds location and time to OnStep, and not the rest of the Ekos parts.

Both the MKS and S6 support WiFi.


Howard Dutton
 

On Tue, Sep 7, 2021 at 03:02 PM, Khalid Baheyeldin wrote:
The S6 is known to work well with the TMC5160. And yes, it supports GPS too, but that only
feeds location and time to OnStep, and not the rest of the Ekos parts.
I would be surprised if a TMC5160 behaved differently in an S6 vs. any other board that supports it.


Vroobel
 

Thank you for your reply. There is no rush, I can work with the MKS. 

At this point the DM556 drivers are the best solution for my mount. I tried the TMC5160 with a lower current, but the motors become noisy (rattling) and the OTA doesn't move. 

Unfortunately the DM556 drivers don't work in the micro steps mode in GoTo, this value has to be OFF. The motors lose (micro) steps and the GoTo never reaches its goal. They run with full speed only in the beginning of the slew, then slow down. 

Yesterday I made a first successful test of astrophotography with PHD2. I still have to learn a lot, but 99 x 60s pictures of the M57 look really good as the first "successful" session. 😁

Best regards,
Tomasz Kruk


On Wed, 8 Sep 2021, 14:15 Howard Dutton, <hjd1964@...> wrote:
On Tue, Sep 7, 2021 at 03:02 PM, Khalid Baheyeldin wrote:
The S6 is known to work well with the TMC5160. And yes, it supports GPS too, but that only
feeds location and time to OnStep, and not the rest of the Ekos parts.
I would be surprised if a TMC5160 behaved differently in an S6 vs. any other board that supports it.


Khalid Baheyeldin
 

According to its manual, the DM566 is capable of 1/128 microsteps when you use the DIP switches
In the spreadsheet you can configure it to either 1/128 or for 1/64 (we can provide input if you attach
the spreadsheet).

However, here is an important point: since it is an external driver, OnStep will only tell it "take a step"
using the STEP and DIR pins ONLY.

So your Config.h will have the driver model as GENERIC, which means that MICROSTEPS should be
set to OFF.


Vroobel
 

I think you understood me wrong, or maybe I wrote not clear enough.

The DM556 driver can easily work with 64 and 128 microsteps. As I should set a number of microsteps for the GoTo lower than for the tracking, I set 128 for tracking and 64 (or lower) for GoTo. But when the slew begins, it seems to work properly only within an acceleration, then runs twice slower. I assume that its twice slower, because the final position is in a half of the way.

I know a behaviour of the stepper motors in general, if I want to do same way using a twice lower number of microsteps, I have to also lower twice the number of steps. But if the number of steps is lower while the setting is still 128, then the way is twice shorter. 

I don't understand this feature, to be honest, but I think that my drivers cannot use it. So I have to switch the GoTo microsteps off, then everything works. 

Tomasz


Khalid Baheyeldin
 

My comment was that this is an external driver (driver model is GENERIC), rather than one
of the models we use, and therefore only Step and Dir pins are used to signal the driver,
while microstepping is set via DIP switches, so fixed for both tracking and slewing.

I don't know how you wired the DM556 to the MKS (apart from the Step and Dir). The DM556
documentation says that it allows control of microstepping programmatically. However, that also
assumes that the MKS Gen-L can signal the same pins, and that is where the problem is. I doubt
that the MKS can do that for a non-SPI driver, because it is wired only for SPI. And that means
that two of the three pins (MS0/MS1/MS2) are shared between axes. Which in turn means that
OnStep cannot signal the axes separately for different microstepping.

But the above goes against your testing which showed successful and accurate pointing after
a goto to an object.

But you said that you tested with MICROSTEPS_GOTO OFF, which makes sense. That also means
that now you are limited by the slow speed of the MKS (which may not be an issue for a heavy
mount/tube).

Tell us what pins are connected from the MKS to the DM556, and attach your Config.h that worked.


Vroobel
 

I have some experience with the LV8729 drivers, which could be good enough for me, but cannot give me more than 1.5A I think, maybe 2A in short time like GoTo. From all drivers I ever used, the LV8729 doesn't use the Reset and Sleep pins, so I set the MKS up with the LV8729. Of course, jumpers on the MKS board are set as On-On-On that means 128 microsteps and the DM556 is also set up for 128 microsteps using its dip switch. The 3rd signal wire is the Enable one. On the DM556 side all ground wires have to be connected together, because the driver has opto-isolators on the way.

I will send the Config.h file tomorrow, because everything is in my shed. 
 


Khalid Baheyeldin
 

My last few messages were about NOT configuring the DM556 as an LV8729.
Because they are an external driver, you need to use GENERIC as the driver
model, and connect only the Step, Dir and Enable pins, which you are already
doing. The same goes for the DIP switches as the only way to set the microsteps.
Keep it the same.

The other thing is what was mentioned before: you need to calculate proper
current values based on the formulas for each motor, and try that, so you
are not using the motors at their maximum current.


Howard Dutton
 

On Thu, Sep 9, 2021 at 03:15 PM, Vroobel wrote:
On the DM556 side all ground wires have to be connected together, because the driver has opto-isolators on the way.
Keep in mind can get away with wiring STEP/DIR/EN directly into the DM556 like this since the Mega2560 has 5V levels.  All other OnStep MCU's are 3.3V and technically would require using some level conversion/adapter to be in-spec.


Vroobel
 

Oh, I think I understand now what do you mean: the LV8729 supports the On-The-Fly Mode Switching (StepStick Driver Summary page) while the DM556 not! OK, I'll try your advice ASAP. 

I'll try to lower the current as well. But as I mentioned earlier, it doesn't matter what current is set up for the TMC5160, whatever I set up, the drivers randomly switch off going to the Disable state. But when I lower the current for the DM556 drivers, they cannot work properly at all: the OTA doesn't move and the motors rattle. 

What a difference is between GENERIC, GENERIC1, GENERIC2 and GENERIC3 driver model? 

Thank you. 

Best regards,
Tomasz Kruk


On Thu, 9 Sep 2021, 23:41 Khalid Baheyeldin, <kbahey@...> wrote:
My last few messages were about NOT configuring the DM556 as an LV8729.
Because they are an external driver, you need to use GENERIC as the driver
model, and connect only the Step, Dir and Enable pins, which you are already
doing. The same goes for the DIP switches as the only way to set the microsteps.
Keep it the same.

The other thing is what was mentioned before: you need to calculate proper
current values based on the formulas for each motor, and try that, so you
are not using the motors at their maximum current.


Vroobel
 

Thank you Howard for this information. I knew it, but I forgot, so it's another advantage of the MKS board in my case. I appreciate it. 

Best regards,
Tomasz Kruk


On Thu, 9 Sep 2021, 23:58 Howard Dutton, <hjd1964@...> wrote:
On Thu, Sep 9, 2021 at 03:15 PM, Vroobel wrote:
On the DM556 side all ground wires have to be connected together, because the driver has opto-isolators on the way.
Keep in mind can get away with wiring STEP/DIR/EN directly into the DM556 like this since the Mega2560 has 5V levels.  All other OnStep MCU's are 3.3V and technically would require using some level conversion/adapter to be in-spec.


Howard Dutton
 
Edited

On Thu, Sep 9, 2021 at 11:16 PM, Vroobel wrote:
What a difference is between GENERIC, GENERIC1, GENERIC2 and GENERIC3 driver model? 
#define GENERIC  12 // alias for GENERIC1
#define GENERIC1 12 // step/dir stepper driver with EN LOW,  allows                        for 1x,2x,4x,8x,16x,32x,64x,128x,256x (no mode switching)
#define GENERIC2 13 // step/dir stepper driver with EN HIGH, otherwise as above
#define GENERIC3 14 // step/dir stepper driver with EN LOW,  inverted step signal (steps on LOW), otherwise as above
#define GENERIC4 15 // step/dir stepper driver with EN HIGH, inverted step signal (steps on LOW), otherwise as above

Don't forget about PULSE mode in Config.h for a 1.6x speedup, SQUARE is more stable (and forgiving WRT signal timing) but on a slow Mega2560 it probably doesn't matter.

#define STEP_WAVE_FORM PULSE


Vroobel
 

Thank you, that's clear to me now. 

I tried with both the PULSE and the SQUARE, the SQUARE is significantly slower, so as long as the PULSE works well I use it. 

Best regards,
Tomasz Kruk


On Fri, 10 Sep 2021, 10:29 Howard Dutton, <hjd1964@...> wrote:
On Thu, Sep 9, 2021 at 11:16 PM, Vroobel wrote:
What a difference is between GENERIC, GENERIC1, GENERIC2 and GENERIC3 driver model? 
#define GENERIC  12 // alias for GENERIC1
#define GENERIC1 12 // step/dir stepper driver with EN LOW,  allows                        for 1x,2x,4x,8x,16x,32x,64x,128x,256x (no mode switching)
#define GENERIC2 13 // step/dir stepper driver with EN HIGH, otherwise as above
#define GENERIC3 14 // step/dir stepper driver with EN LOW,  inverted step signal (steps on LOW), otherwise as above
#define GENERIC4 15 // step/dir stepper driver with EN HIGH, inverted step signal (steps on LOW), otherwise as above

Don't forget about PULSE mode in Config.h for a 1.6x speedup, SQUARE as a more stable (and forgiving WRT signal timing) but on a slow Mega2560 it probably doesn't matter.

#define STEP_WAVE_FORM PULSE


Khalid Baheyeldin
 

On Fri, Sep 10, 2021 at 02:16 AM, Vroobel wrote:
Oh, I think I understand now what do you mean: the LV8729 supports the On-The-Fly Mode Switching (StepStick Driver Summary page) while the DM556 not! OK, I'll try your advice ASAP. 
The complexities are more involved, because there are many parts that need to work together and some impose limitations  ...

Both the LV8729 and the DM556 (per its manual) support on the fly switching of microstepping.
The LV8729 does it using MS0/MS1/MS2 pins, like all the non-SPI drivers that we use.
The TMC2130 and TMC5160 also support switching, but over an SPI connection, so 2 pins are shared.

As a result some boards can support one way of doing it, but not the other.
Specifically, the MKS Gen-L, and the S6 only support microstep switching for SPI drivers only.

So in your case, with the MKS Gen-L, the only options that allow microstep switching are the TMC2130 or TMC5160, which you already have, but see issues.

I'll try to lower the current as well. But as I mentioned earlier, it doesn't matter what current is set up for the TMC5160, whatever I set up, the drivers randomly switch off going to the Disable state.
Ignore the TMC5160 for now. There seems to be a specific issue with it and the MKS.

But when I lower the current for the DM556 drivers, they cannot work properly at all: the OTA doesn't move and the motors rattle. 
Start with:

Motor Current X 1.41 X 0.35 = current on DIP switches

Then if that rattles the motor only, then try 0.45, 0.5, ...etc until you get it to run.

What a difference is between GENERIC, GENERIC1, GENERIC2 and GENERIC3 driver model?
It is the difference of whether the EN is high or low, and whether stepping is on low or high.

Here are the descriptions:

#define GENERIC  12 // alias for GENERIC1
#define GENERIC1 12 // step/dir stepper driver with EN LOW,  allows                        for 1x,2x,4x,8x,16x,32x,64x,128x,256x (no mode switching)
#define GENERIC2 13 // step/dir stepper driver with EN HIGH, otherwise as above
#define GENERIC3 14 // step/dir stepper driver with EN LOW,  inverted step signal (steps on LOW), otherwise as above
#define GENERIC4 15 // step/dir stepper driver with EN HIGH, inverted step signal (steps on LOW), otherwise as above