1
\$\begingroup\$

I am using a PIC microcontroller and software uses for programming is microC. One more thing I use is a controller unit (DH542-D) for controlling a bipolar stepper motor.

I read several articles and notes regarding this accelleration/decelleration. I tried to implement it, but I did not get proper output on my servo motor. I did work on an equation but the resulting output wasn't affected that much.

Please, show me the equation to implement this motion in my motor.

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

I did this a few years ago for a bespoke system I designed and built. You can see the system I designed actually moving the laser head in this video (unfortunately Vimeo requires a login).

I did it with a lookup table (a C static array generated by a python script). If you want smooth motion, you want constant acceleration, so that there is a small, constant force on the load, according to F=ma. You can then accelerate to whatever final velocity you define.

If you have an integer that defines the time until the next pulse, your static array of constants which gives your initial step (which will be longest), thereafter each step is a little shorter. Make the table large enough so that you can get to your target velocity.

Of course, if you only need a small distance you don't have to use all the steps. In my system, because there was always a fixed target position, a "recipe" is calculated before starting the move, which defines how many steps of the ramp must be used used, and for how many steps the head must remain at maximum velocity, to get to that target.

In real time, each time a pulse is emitted, the next value in the lookup table defines when the next pulse will happen.

It's a few years ago, and I don't remember the equation to generate the steps. I need to look up the source code, I will do so in a few days and post it here. For my purpose (moving a laser head around an XY table) it worked very well.

The maths to get the profile was derived from this link. However I didn't want or need to generate the profile in real time.

\$\endgroup\$
0
\$\begingroup\$

One define max acceleration,g and max velocity,v based on step rate and motor torque and load.

  • g and v max must be discovered by trial and error with max loads for given pulley size, step rate steps /rev , voltage,current , and thus torque which declines with velocity.

I used a constant g max and constant v max for both directions to reach up to v= 1m/s in x or y=0.5m with no load on 8mm pulleys using 12V on NEMA17 2A for an XY Gantry.

  • but I used both an STM Gcode board and then switched to an UNO with CNC shield and GCode Panel(free) for WIndows with full steps. THe software did all the calculations.

  • it was the best for my application. Pulse step rate was 100kHz max 1us for Fwd/Reverse.

\$\endgroup\$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.