Filtering PWM output to stepper motor coil to read voltage drop of sense resistor

Thread Starter

Travm

Joined Aug 16, 2016
363
Danko,
That seems to achieve what i'm looking for, however we're still filtering Vsense independently.
I think the best route is to file this under future research and move forward filtering the Vsense to an acceptable average. The actual current ripple could be helpful in the application.

I also don't see how the flyback diode in the image above works connected in series with the power supply?

I've attached my .asc as well. What I see at Vsense is the voltage jumps up and down, rapidly.
 

Attachments

Danko

Joined Nov 22, 2017
1,835
Danko,
That seems to achieve what i'm looking for, however we're still filtering Vsense independently.
I am delighted to hear it.
I think the best route is to file this under future research and move forward filtering the Vsense to an acceptable average. The actual current ripple could be helpful in the application.
Good idea.
I also don't see how the flyback diode in the image above works connected in series with the power supply?
Inner resistance of voltage source V1 is zero, independent from its voltage. Therefore, when voltage of V1 becomes zero, anode of D2 is connected to ground (kind of cheating:)).
I've attached my .asc as well. What I see at Vsense is the voltage jumps up and down, rapidly.
These voltage pulses are really horrible:eek:.
 

ebp

Joined Feb 8, 2018
2,332
Returning to the original post:

What exactly do you want to accomplish with the motor current? Can you post a sketch of what the current waveform looks like and what you would like it to look like? After all the posts, I'm left with the feeling you are trying to accomplish something that simply isn't possible.
 

Thread Starter

Travm

Joined Aug 16, 2016
363
Returning to the original post:

What exactly do you want to accomplish with the motor current? Can you post a sketch of what the current waveform looks like and what you would like it to look like? After all the posts, I'm left with the feeling you are trying to accomplish something that simply isn't possible.
I am trying to simulate an idea, where I can filter the current through a coil, and a sense resistor, so that there isnt any voltage ripple at the sense resistor.
I have a feeling you are correct. And the original suggestion of simply filtering the voltage at the sense resistor is the best path forward.
 

Thread Starter

Travm

Joined Aug 16, 2016
363
So unless anyone sees anything blatantly bad about this I'll likely build this and see what happens.
I"ll keep playing with simulation and see if i can get anywhere else with filtering the coil.

circuit2.jpg
 

crutschow

Joined Mar 14, 2008
34,459
So unless anyone sees anything blatantly bad about this I'll likely build this and see what happens.
I"ll keep playing with simulation and see if i can get anywhere else with filtering the coil.
My simulation of your circuit below looks okay.
The Sense voltage has very little ripple.

But for more realistic simulation, you should use the models for a real transistor and diode, not the idealized generic LTspice models.

upload_2018-10-28_10-34-32.png
 

ebp

Joined Feb 8, 2018
2,332
Travm, do you understand why the current in crutschow's simulation has the shape it does and what the current waveforms through the transistor and diode would look like? This may give you some clues about why you can't effectively change the motor current waveform.

Incidentally, I don't understand the waveforms versus the numeric values for PULSE and .tran that appear on his schematic.
 

Thread Starter

Travm

Joined Aug 16, 2016
363
So I guess i was able to get this to work in simulation. I found the resonance too. I will probably build this as well. It shouldnt resonate as much when the current changes are smaller I would expect. The resonance is interesting, much to learn about that I think.
circuit3.jpg
 

Attachments

Thread Starter

Travm

Joined Aug 16, 2016
363
Travm, do you understand why the current in crutschow's simulation has the shape it does and what the current waveforms through the transistor and diode would look like? This may give you some clues about why you can't effectively change the motor current waveform.

Incidentally, I don't understand the waveforms versus the numeric values for PULSE and .tran that appear on his schematic.
I believe I do yes, the R-C filter on the voltage dropped by the sense resistor (Vsense) is charging and dischargin from the capacitor between pullses
 

Thread Starter

Travm

Joined Aug 16, 2016
363
Another note, I just priced inductors, and wow. Definately a simple R-C on the sense line is the way to go. I was able to get spice simulating a neat clean power line, but the inductor I would need to buy to do this, $$$ expensive.
 

crutschow

Joined Mar 14, 2008
34,459
So drop your desire to smooth the inductor current (which I see little need for) and just use an RC filter for the current signal, as I simulated in post #32.
 
Top