Ingo Hilmar Panzer tschroeder
wiringlayout.png (135965 bytes)


With this Soft Motion device it is possible to control a Stepper motor just with the GPIO-Pins of a Raspberry Pi and a motor driver via position and velocity. For projects with several motors you need to add more devices, as each device controls one motor.

The device is configurable, so it is possible to use different motors and to choose the GPIO-Pins free.


With this device you can use different Raspberry Pis, motor and motor driver models, as the wiring is similar. The maximal velocity of the motor depends on this three components.


The GPIO-Pins of the Raspi are connected to the Input pins of the motor driver and the motor to the Output pins of the driver. The supply voltage for the motor and the driver are connected to the driver. If the motor only requires 5V, it can be supplied by the 5V Outputpin of the Raspi. Nevertheless, it is recommended to use an external voltage supply because the Raspi is not as stable as an external supply, especially when more than one motor are provided.
Take a close look that no wires are mixed up and everything is connected correctly. Otherwise the motor will not turn correctly!

Add Device

You can add the device to your project the same way as other Soft Motion devices.

With a right click on the „SoftMotion General Axis Pool“ you open the menu „Add device“. The „SM_Drive_RaspiStepper“ is under „Softmotion drives“ and „position controled drives“, which you can add now by clicking „Add Device“.

Configure Device

With a double click on the device in the device tree the editor for the configuration opens. The motor specific parameters like number of motorincrements, the velocity unit or the maximal velocity can be set as in other SoftMotion devices.
Special to this one is that you have to set the GPIO-Pins, the motor is attached to in the parameters. You do not need another GPIO-device.
Besides the GPIOs you have to set the Motorpowertime. To preserve the coils, the motor is not under power the whole Taskcycle. The Parameter „MotorPowerTime“ defines the percentage part of the Cycletime, the motor is under power. If you want to power the motor the whole, you can set „MotorPowerTime“ equal to one.


To call up the motor in the project, a program must be added to the application as a "POU". There you create an instance of "SMC_StartupDrive" and assign this instance to the SoftMotion axis.

Operating principle


Project Members: