Page 1 of 1

Stepper motor that has load cells.

Posted: Wed Nov 24, 2021 5:58 am
by AmeliaJames
Hello to all,

Am trying to do a project that utilizes the stepper motor with load cell where am focused in running the stepper motor until the reading of the load cell goes up to greater or equal to 200. Below is the code that I am trying to write:

Code: Select all

def calcWeight(import,isbigger=True):
    isWeightOk = True
    while isWeightOk:
        enaPin.low()
        pulPin.low()
        time.sleep_us(1)
        pulPin.high()
        time.sleep_us(1)
        val = (scales.stable_value()*(0.00589)/10000
        print(val) 
        if(isbigger):
            if(val>=(import*0.001)):
                isWeightOk=False
        else:
            if(val<=(import*0.001)):
                isWeightOk=False
    return True
The code is working so well but the motor is too low. Normally, I have in mind that the motor should wait for this project with time.sleep _ us (500). On writing this time sleep, the motor becomes too slow and I can not work like this. I have a thought that this problem is associated with the load cells. Without this load cell the motor is working very well without any delay and I can make the arrangement of the speed very easily. What should I do? I am making use of the hx711 library below:

https://github.com/SergeyPiskunov/micro ... r/hx711.py
https://www.theengineeringprojects.com/ ... stems.html