Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Raspistepper driver softmotion

mattiap
2022-01-31
2023-04-17
  • mattiap - 2022-01-31

    Hi everyone, I state that I am taking my first steps on everything that is electronic and programmable. I'm trying to move a stepper motor (nema17-200step / rev-1.5A) with a raspberry pi4 and a drv8825 driver. I followed this https://forge.codesys.com/drv/sm3raspistepper/home/Home/, and managed to spin the motor, I would like to ask you experts if there is any way I can use a home switch to reset the motor position. Following what is written in the link posted above, I read that softmotion has exclusive access to the GP I / O of the raspberry and I do not know how to connect my limit switch. Can anybody help me? Or tell me if there are other methods to reset the motor? Thanks in advance.

     
  • eschwellinger

    eschwellinger - 2022-02-05

    use smc_Moming fb from the SM3_DriveBasic.library. Connect the limit switches to this fb.

     

    Last edit: eschwellinger 2022-02-06
  • mattiap - 2022-02-26

    Thanks for the answer, also placed an image of the connections, I can't understand how to use SMC_homing, how can I define the switch input PIN?

     
  • eschwellinger

    eschwellinger - 2022-02-26

    A proposal would be to connect a a GPIO input to do the limit switch if the distance is not to long. It is 3.3V depends on your machine if this could work.

     

    Last edit: eschwellinger 2022-02-26
  • mattiap - 2022-02-28

    Thanks for the time you are dedicating to me.
    I connected the limit switch input to a GP i/o input of the Raspberry, what I can't do is define the pin in the SMC_homing fb, what I have to write to ensure that my PIN 4 is active and reads the limit switch?
    It might be trivial, but these are my first steps on codesys.

     
  • tobzi - 2022-03-02

    Hello eschwellinger!

    I kind of have the same issue. Running three stepper motors with help of Softmotion and Raspberry Pi 4.
    I want to use some additional outstanding GPIO's for limit switches and/or other DI/DO's. Seems like when I'm running softmotion, my whole
    GPIO bus is getting disabled (not sure if softmotion is causing this issue). The GPIO is marked with a red
    triangle in the Device Tree and have status "Bus is not running" and "GPIOs: Not Running"

    My question is: Is Softmotion blocking me to use the other outstanding GPIO's?
    Is it possible to add limitswitches (DI/DO's) while running softmotion?

    Note: I have connected one limitswitch to GPIO4 for testing and mapped the IO correctly (working when creating a blank program without softmotion).

    Se pictures attached.

    Hope you are able to help and clarify.. :-)

    Regards

     
  • mattiap - 2022-03-02

    Hello ,
    in fact that's what I want to do, but reading the guide of this link https://forge.codesys.com/drv/sm3raspistepper/home/Home/, it says that the GP i / o cannot be used together with softomotion, I don't know if there is an alternative way to connect other inputs / outputs besides the engines.

     
  • mattiap - 2022-06-02

    Hello everybody,πŸ˜€
    I am carrying out my project and continue in this discussion.
    I haven't been able to get a soft motion limit switch to work yet, but for now I can do without it.
    now I need help on controlling a DC motor through codesys, do you think if I connect a BTS7960 to a raspberry I can control it with softmotion?
    I put some photos to better understand (the motor is a 895 360w, so with a very high load).
    I trust in your precious help.πŸ™

     
  • helloword - 2023-02-01

    Hello.
    Tell me how to properly configure the drive for a circular stepper motor? In the first picture, I showed the normal setting, the motor is spinning. But if you change the motor type to circular, then it does not work. Tell me what is the reason? Is this a problem in the library?
    Thank you.!

     
  • gtruu - 2023-04-17

    Hello! Since I saw here has been questions regarding GPIO it should be proper to post a question here about connecting IO-s to raspi stepper library.
    I use different type of raspberry (Revolution pi). Revolution pi I/O-s are not configured under GPIO tab as for standard raspberry. Raspistepper library supports only Dword value for pins. How could I solve my problem. I have IO list and it is mapped by using some name: "outputW.0" for example. I need to connect it with raspistepper library but had found no solution jet for it

     

Log in to post a comment.