1

Im trying to send two different g-code instructions to the SKR V1.3 simultaneously using the pi 4B's UART pins to control two wheel stepper motors and one stepper motor for my lidar system:

First i send this command in order to allow un-restricted movement of the motors:

stty -echo && echo "G91" >> /dev/ttyAMA0

But then, When I want to send these commands simultaneously For wheels,

echo "G1 X80 Y80" >> /dev/ttyAMA0

and for Lidar back n' fourth motion,

    echo "G1 Z20" >> /dev/ttyAMA0 
    wait(3 seconds in python)
    echo "G1 Z-20' >> /dev/ttyAMA0

they don't end up being processed at the same time. They work fine when executed alone, but when I execute them at the same time, or one after another, its only when the previous G-code command stops does the next one start. Is there a way to get around this and execute g-code commands simultaneously?

1 Answers1

0

You can add the initial Z command to your existing command:

echo "G1 X80 Y80 Z20" >> /dev/ttyAMA0

I would recommend getting in to pyserial

https://github.com/pyserial/pyserial

HackSlash
  • 4,944
  • 2
  • 18
  • 44