I'm working on a kinetic sculpture that involves a large pendulum swinging perpetually left to right.
I'm using a raspberry pi 3 B+ / arduino uno with a DM860AC to control a nema 34 stepper. I was using the pi to directly control the driver with pigpio wavechains (thank you joan!) until I realised the driver needed a 5V signal which is why I got the uno. At this point I'm not sure whether it makes the most sense to either:
1- Use the pi to control the uno which can then handle the 5V PWM
2- Use the uno by itself and some implementation of the stepper.h/accelstepper.h libraries
3- Use the pi by itself but get a logic converter to bump the 3.3 up to 5v
This it the approach I've used so far: In a spreadsheet I've calculated the speed and acceleration of the pendulum very precisely (ie. at every 0.5 degrees, or any other integer step increment). Using this I planned to calculate step/freq pairs to feed into a wavechain.
I've had luck driving the motor back and forth with acceleration/deceleration using wavechains but when I try to add all of my many step/frequency pairs to a wavechain I get an error related to having too many counters.
Through trial and error I've been able to determine that this number of counters is 20. Is this a set number or can I redefine it?
After I hit the wave counter issue and 3.3/5v issue I tried using the arduino with the accelstepper library but the acceleration control seems a little coarse for what I'm trying to do which is accelerate and decelerate the stepper perfectly in time with the natural motion of the pendulum. Are there any other arduino based PWM libraries I'm not aware of that might work better for me?
I've also been curious about only driving the stepper at the bottom of the swing to give the pendulum just that little bit extra energy but haven't spent much time on that idea yet, just wanted to mention it.
I need to say that while I know enough to have gotten this far, I am by no means a fluent coder, I'm more mechanically inclined, so please forgive me for any large knowledge gaps. I'm bouncing back and forth between methodologies and I'm hoping someone could point me in the right direction or at least A direction.
Many thanks in advance.