Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1264

Python • Stepper control via PIO for a dosing device

$
0
0
I need help with programming. Unfortunately, I haven't been able to find any like-minded people in my area (15526 Reichenwalde) with whom I could exchange ideas. At the biblical age of 65, I'm trying to get into programming with MicroPython, especially PIO programming. The aim is to build a dosing device for pasty materials with the following properties: Operation via 4 buttons: <Inject> (fill), <Retract> (return to position for refilling, <Man / Auto> (switching between manual and automatic operation, <Stop / Teach> short press = stop, 2 seconds = teach-in of the dosing quantity. In the first attempt I wrote a program that provides the direction of rotation signal, the step pulses, the enable signal and a "cycle running" signal for a DRV8825 driver via PIO. The main program provides the setpoints for the step frequency, the number of setpoint steps and the cycle start signal. This first program carries out a dosing cycle consisting of filling and unloading (small movement back) at the press of a button. This works so far, except for the following problem: If the start button is pressed again while the motor is running, the step setpoints are reloaded. The setpoint is added to the steps already carried out, the The dosing quantity is therefore too large... I have used Bit3 as a status bit in the SM (Bit3=1 means "cycle running"). However, I have not been able to prevent a new trigger during the dosing cycle. Please help.
Stepper_CTRL with_PIO_04.zip

Statistics: Posted by Quax — Thu Jul 11, 2024 5:39 pm



Viewing all articles
Browse latest Browse all 1264

Trending Articles