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

Automation, sensing and robotics • Stopping an infinite wave in pigpio

$
0
0
Good day!
I am controlling a stepper motor using the dir/step method via a driver board.

When I press a button I need the motor to accelerate to, and continue at speed until the button is released. When released the motor must decelerate to a safe stop speed without skipping steps and then stop completely.

I implemented the acceleration ramp and infinite loop using a wave chain containing an infinite loop:
waveChain += [255, 0, wave_const_speed, 255, 3]
wave_chain(waveChain)

Now, how do I get it to do a controlled stop (without missing steps)?
I tried constructing a deceleration wave and sending it using
wave_send_using_mode(wid, WAVE_MODE_ONE_SHOT_SYNC)
but it seems the infinite wave is not terminated.

Thanks in advance for any advice,
Riaan

Statistics: Posted by riaan.marx — Thu Sep 12, 2024 7:34 am



Viewing all articles
Browse latest Browse all 5010

Trending Articles