Hello Community,
I'm looking for input on the following problem.
In short:
I want to drive a stepper motor with a non-linear speed curve to individually determine speed and acceleration up to a specific position like a speed profile.
In detail:
I've programmed many projects with NEMA stepper motors that drove at a constant speed with a certain acceleration to a position and back using the AccelStepper.h library. So far, so good.
For the new project, I've acquired significantly larger components:
- JMC Servo Motor with an integrated driver, 660 Watts, Type IHSV86-30-66-72. Documentation: (JMC Servomotor 660Watt IHSV86-30-66-72 v604)
- 48 V power supply
- Arduino Mega and Teensy 4.1
Characteristics of the Stepper Motor (JMC Servo Motor operates like a stepper motor):
- The stepper motor is controlled by a pulse signal (PUL) and has a direction signal (DIR), similar to the connection of a motor driver (like DRV8825).
- Max PUL frequency = 200 kHz
- Min pulse spacing 2µs
- TTL Logic
- Fixed microsteps 800-40000 steps per revolution
Motor Control:
The motor should be controlled with a non-linear/non-constant speed curve or speed profile over time to drive a linear actuator. The speed profile should resemble a type of sinusoidal curve. However, the speed profile should be freely definable and can deviate from a sine wave, allowing for desired linear, square wave, ramp function, and all freely definable non-linear profiles in between - essentially a freely definable speed profile.
Here's a graphical example and video for illustration:
- (thanks to @husneck Sine wave trajectory stepper motor with Pololu Tic T825)
- The speed profile or motion of the motor should look like this at 7:42 mins :https://www.youtube.com/watch?v=JGJJuGIP-6U
I've tried using the AccelStepper library, but I can't find anything beyond constant speed with a defined acceleration. The forum and research also didn't yield a relatively simple method or library.
In essence, I need to change the number of pulses or the time interval in which the pulse is sent within a relatively short time interval.
Are there any suggestions, libraries, or sample code for this?
Of course, the journey will be documented here, and I will share my code. Sharing is caring.
Cheers and thank you !