# Stepper motor library

**URL:** <https://forum.xod.io/t/stepper-motor-library/1826>\
**Category:** Uncategorized\
**Created:** [February 8, 2019, 10:21pm UTC](https://forum.xod.io/t/stepper-motor-library/1826 "2019-02-08T22:21:02Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![edgars-balunovs](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@edgars-balunovs](https://forum.xod.io/u/edgars-balunovs)\
**Post date:** [February 8, 2019, 10:21pm UTC](https://forum.xod.io/t/stepper-motor-library/1826/1 "2019-02-08T22:21:02Z")

</div>

Does anyone have any solution to control multiple stepper motors simultaneously? The Step/Dir library avalaible does not allow that feature.

---

<div class="post-metadata">

**Author:** ![awgrover](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@awgrover](https://forum.xod.io/u/awgrover)\
**Post date:** [February 16, 2019, 3:16pm UTC](https://forum.xod.io/t/stepper-motor-library/1826/2 "2019-02-16T15:16:57Z")

</div>

I remember some discussion of stepper-motors and did a search on this forum. Do any of these help you?

[https://forum.xod.io/search?q=stepper](https://forum.xod.io/search?q=stepper)

---

<div class="post-metadata">

**Author:** ![edgars-balunovs](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@edgars-balunovs](https://forum.xod.io/u/edgars-balunovs)\
**Post date:** [February 16, 2019, 3:35pm UTC](https://forum.xod.io/t/stepper-motor-library/1826/3 "2019-02-16T15:35:14Z")

</div>

The main problem is that there is no way of controlling two steppers simultaneously that I can think of. In arduino IDE there were couple of libraries, that could accomodate this. All of the topics about seppers till this day in forum i’ve read, unfortunately with no success.

---

<div class="post-metadata">

**Author:** ![awgrover](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@awgrover](https://forum.xod.io/u/awgrover)\
**Post date:** [February 16, 2019, 4:16pm UTC](https://forum.xod.io/t/stepper-motor-library/1826/4 "2019-02-16T16:16:09Z")

</div>

Yes, I was trying to remember the discussion about multiple-steppers. The problem was timing, if you want continuous/smooth movement, which needed to be tight, and thus (probably) use interrupts. But, there are a limited number of those, and they are used for multiple things.

Techniques based on “pulsing” every `loop()` seem problematic. A transaction in XOD is analogous to `loop()` (clock set to `always`), but I wonder if that’s fast enough to create smooth motion, given the rest of your program? What are the timings needed for that (when do you need to send the next pulse, with what tolerance)?

What are the Arduino IDE libraries that can do it? I could look at them and see if they’ll work in XOD world. I looked at [AccelStepper](http://www.airspayce.com/mikem/arduino/AccelStepper/), which appears to do smooth motion by sending pulses at the right time in `loop()`.

If you can use extra hardware, and offload the “move-n-steps” logic:

Something like “Digilent chipKIT Motor Shield. It’s an I2C controller allowing several shields to be used.” or [https://www.pololu.com/category/120/stepper-motor-drivers](https://www.pololu.com/category/120/stepper-motor-drivers)

What else have you looked at that would help with this?

---

<div class="post-metadata">

**Author:** ![edgars-balunovs](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@edgars-balunovs](https://forum.xod.io/u/edgars-balunovs)\
**Post date:** [March 9, 2019, 5:31pm UTC](https://forum.xod.io/t/stepper-motor-library/1826/5 "2019-03-09T17:31:56Z")

</div>

One of possibilities might be the grbl library, of those I remember. Controlling three steppers was superb even in high speeds, but now I have another project in which there’s a need to control two independent steppers from program inbedded in arduino module. Thing is that while one motor moves, the other does nothing. When I get to my PC, I will get to look at previous projects in arduino IDE and tell, which library also works with multiple steppers. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![edgars-balunovs](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@edgars-balunovs](https://forum.xod.io/u/edgars-balunovs)\
**Post date:** [March 9, 2019, 5:36pm UTC](https://forum.xod.io/t/stepper-motor-library/1826/6 "2019-03-09T17:36:22Z")

</div>

External hardware is last resort and it takes a lot of time to get hands on and there’s a need to keep simplicity in project.

---

<div class="post-metadata">

**Author:** ![edgars-balunovs](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@edgars-balunovs](https://forum.xod.io/u/edgars-balunovs)\
**Post date:** [March 11, 2019, 12:29pm UTC](https://forum.xod.io/t/stepper-motor-library/1826/7 "2019-03-11T12:29:47Z")

</div>

This is the library that worked using two steppers simultaneously: [https://github.com/HobbyComponents/HCMotor](https://github.com/HobbyComponents/HCMotor) unfortunately I lost the sketch to show. It was a simple program to control two independant mixers for brewing and it worked like a charm. Thanks for any help! 🙂

---

<div class="post-metadata">

**Author:** ![xiukenkou41](https://avatars.discourse-cdn.com/v4/letter/x/278dde/32.png) [@xiukenkou41](https://forum.xod.io/u/xiukenkou41)\
**Post date:** [December 18, 2019, 10:36am UTC](https://forum.xod.io/t/stepper-motor-library/1826/8 "2019-12-18T10:36:53Z")

</div>

you can have look at this site:[https://www.oyostepper.com](https://www.oyostepper.com)

---

<div class="post-metadata">

**Author:** ![fsbl490z60](https://avatars.discourse-cdn.com/v4/letter/f/85f322/32.png) [@fsbl490z60](https://forum.xod.io/u/fsbl490z60)\
**Post date:** [February 2, 2022, 1:33pm UTC](https://forum.xod.io/t/stepper-motor-library/1826/9 "2022-02-02T13:33:11Z")

</div>

Beste vrienden ,  
Ik zoek eerder een oplossing om een stepper op 3 of meerdere posities te verkrijgen door het tellen van de stappen . Start-stop links rechts heb ik al maar ik heb 3 posities nodig met de middelste positie als nulpunt . Aantal steps positief , aantal steps negatief . Is voor een draaitafel in modelspoor .  
Om meerdere steppers te bedienen puzzelen met oorspronkelijke (copy) en and of or denk ik dan . Naargelang het doel van gebruik .
