Mobatools limit question

Is there a limit as to how many steppers and/or button inputs I can use with this library? I would like to use 9 steppers and 23 button inputs. Then could I sneak in 9 speed control pots also? I'm experimenting with the Mobatools stepper 03 example.

Your other topic on the same subject deleted.

Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.

Please create one topic only for your question and choose the forum category carefully. If you have multiple questions about the same project then please ask your questions in the one topic as the answers to one question provide useful context for the others, and also you won’t have to keep explaining your project repeatedly.

Repeated duplicate posting could result in a temporary or permanent ban from the forum.

Could you take a few moments to Learn How To Use The Forum

It will help you get the best out of the forum in the future.

Thank you.

Sorry, posted it in the wrong section and tried to delete it. You beat me to it.

@MicroBahner Over to you

Steppers:
Regarding the software architecture there is no hard limit for the count of steppers. But all on creating stepper pulses is done in one and only one interrupt. So the more steppers are active the longer this ISR will run. And computation time per stepper increases if the stepper is ramping down or up. So at the end it is a question of processer load. This is especially a problem with slow processors like the standard AVR series. If things get bad the runtime is longer than the time to the next IRQ.
If you use softLeds ( bulb simulaton ) things get worse, because creating the PWM is done in the same ISR too.
That's why 'out of the box' the number of steppers is limited to 6 by a #define in MobaTools.h
#define MAX_STEPPER 6
This works fine even on an AVR.

If you don't use softLeds and don't let run alle steppers at the same time ( especially with ramping up/down) you can increase that #define to be able to create more stepper objects.

Buttons:
The MoToButtons class can manage up to 32 buttons within one instance. Default is max 16 buttons. If you want to use more than 16, you must insert a line
#define MAX32BUTTONS
before including MobaTools.h

That should be independent of MobaTools, but you need a processor with 9 analog inputs ( or use an external ADC.

@MicroBahner Thank you for chiming in

You're welcome - and thank you for pointing out the question.

Ok I understand now about the processor having to handle all the ramp up/downs. If I don't make them ramp up/down then the processor might be ok? If not, I can run each stepper one after the other and not the same time.

If I use 9 steppers, Ill need to create this line? #define MAX_STEPPER 9

Thanks for your help on this!

Not only ramping up/down but all pulse creating has to be handled in the ISR. But it needs less time in the ISR if the timing of the pulses is constant ( constant speed ) and not varying from step to step.

It's all not a hard limit - it depends. The more steppers are moving at the same time, the more load to the ISR. And the more are accelerating or decelerating at the same time, the load increases even more. The speed of the steppers also matters. At the end you have to try what is possible.
Which Arduino are you planning to use (not all are supported so far)?

You don't need to create the line, it's already there. You only have to change the '6' to '9'

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.