redoxcode / micropython-stepper Goto Github PK
View Code? Open in Web Editor NEWLibrary to use stepper drivers in micropython in a tidy way
License: MIT License
Library to use stepper drivers in micropython in a tidy way
License: MIT License
Hi,
It is said in your read me that this lib allows the user to command several steppers in a non blocking way.
I understand here that 2 steppers can be driven independantly at the same time.
I tried a simple wiring, with 2 stepper using 2 TMC2209drivers. with the code under this issue. I tried to disconnect motors 1 after the other to test it alone and everything is going well, it does 180° in one direction then comes back to 0°. But when I plug both motors, only one is moving.
The non moving stepper is plugged to a driver that seems to have a default (high urrent consumption when the motor isn't enabled). However, this particular driver is moving when I command it alone.
Do you have an idea of what would cause this behavior ?
thanks,
Sylvain
My program :
from stepper import Stepper
import time
from machine import Pin
Pin(5, Pin.OUT).off()
Pin(21, Pin.OUT).off()
s1 = Stepper(18,19,steps_per_rev=200*8, speed_sps=500, en_pin=21, timer_id=-1)
s2 = Stepper(22,23,steps_per_rev=200*8, speed_sps=500, en_pin=5, timer_id=-1)
s1.target_deg(0)
s2.target_deg(0)
print(1)
time.sleep(3.0)
s1.target_deg(180)
s2.target_deg(180)
time.sleep(3.0)
print(2)
s1.target_deg(0)
s2.target_deg(0)
Add an easy way to check if the final position is reached.
Maybe a function to return the difference between target and current position?
Maybe just a function that returns a boolean?
Why MICROPYTHON STEPPER ON ESP32:
GPIO27 AND GPIO14 CAN'T BE USED?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.