Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

Bug: Driving a Stepper motor causes back-steps

2 posters

Go down  Message [Page 1 of 1]

TimFisch

TimFisch

I tried to model a simple stepper driver like the TI DRV8825. This driver has two pins "DIR" for direction and "STEP" in order to execute one step.
Additionally, there are more pins in order to distuinguish between full and part step modes.

I tried to emulate this with an up-counter, which counts up on every "STEP" and a RAM/ROM IC, which contains the distinct voltages on A+, B+ and A-, B- for each step.

Since the stepper in Simulide already work with 5V I thought the output of the RAM/ROM IC should already work as driver. Additionally, I tried an impedance conversion via a buffer.

Without a buffer the stepper motor often jumps back and is not able to make a full turn. With the buffers it's much better, but there are still some back-steps visible.

How could this be solved?
Attachments
Bug: Driving a Stepper motor causes back-steps  Attachmentstepper.zip
You don't have permission to download attachments.
(2 Kb) Downloaded 17 times



Last edited by arcachofo on Fri Dec 24, 2021 3:23 am; edited 1 time in total (Reason for editing : Marked as Unsolved (red color))

https://wiki.mexle.hs-heilbronn.de/

arcachofo

arcachofo

I will have a look.

My first idea is about some spike caused by an intermediate value in 74xx93.
To see if this is actually the case, a Latch could be added after the Ram, this latch should update at falling clock edge.

The main problem is that for simplicity, the Stepper model is based on resistors, not in coils.
In a real stepper, this spikes will be "absorbed" by the coil, but not in this model.

Anyway I'm not sure what is actually happening, could be a bug or any other issue.

arcachofo

arcachofo

I think this is definetly caused by spikes in the output of 7493 counter.
It works perfectly if I add a latch:

Bug: Driving a Stepper motor causes back-steps  Steppe10


Here comparing signal before and after the latch.
Odd channels are before the latch, even channels after:

Bug: Driving a Stepper motor causes back-steps  La_ste10


The spike is barely 10 ns wide, so I think it should not afect the stepper:

Bug: Driving a Stepper motor causes back-steps  Spike11


I need to think about this...
A model based on coild would be much more complex and slow, but maybe it's worth...

I also will have a look why are those spikes there.

TimFisch likes this post

TimFisch

TimFisch

Maybe there is a way to use a linear / trapezoidal approximation for the coils. Rolling Eyes

https://wiki.mexle.hs-heilbronn.de/

arcachofo

arcachofo

The inductor model currently used is mathematically quite simple (based on backward euler approximation).
In any case an inductor can take hundreds of steps to change from 0 to 5V.
a resistor just takes one.

Every time some voltage changes the circuit must be recalculated.
In this case, being a direct connection it doesn't take too long, but this depend on the case.

Anyway this must be solved.
I will do a try with inductors and see what happens...

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum