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

Automation, sensing and robotics • pigpio how far along am I in a wave?

$
0
0
So I've been able to use the wave generation tool to great effect to create nice profiled acceleration/deceleration step/direction for stepper motor control (step/direction). There are a couple things I'm not particularly sure of how to handle:

1. I'm trying to "home" my motor. So I kick off a pulse train, and wait for a sensor to come on. Then I've got to immediately note the position and kill the pulse train. If I do this with the wave generator, I can tell if it's done using wave_tx_busy(), but there's not a function to know how far along it is in its path. (e.g. There's not a wave_tx_progress() function that tells me how many pulses the wave generator has created from the start of the waveform). Is there a workaround for this?
2. This is related to #1. Everything is open loop here, so it's very important to keep track of exactly how many pulses have been put out. If I start a profiled move that I've specified with the wave generator, and I'm 1/2 way through and have to tell it to stop and send in a profiled deceleration wave, I don't see a way to tell how many pulses have been sent out before I called wave_tx_stop(). If wave_tx_stop() returned that value it would solve this problem.

I have half a mind to create a custom counter kernel module and just route the step pulse output right back into it. Seems silly when the pigpio library is in full control of the output and can (and probably does somehow) keep track of wherever it is, but I don't see a good workaround.

Statistics: Posted by zimm0who0net — Mon Feb 03, 2025 6:06 pm — Replies 0 — Views 12



Viewing all articles
Browse latest Browse all 7010

Trending Articles