LTSpice - making an oscillator that can be started/stopped, remembering where it left off

Thread Starter

prairiemystic

Joined Jun 5, 2018
240
I need to make an oscillator in LTSpice that can be started/stopped without losing phase info. When it's stopped, somehow remembering its phase and continuing from there when it gets restarted. Doesn't matter if sine or triangle wave, a square-wave would not work for what I'm, trying to do.

It is to simulate a mechanical system like a printhead that moves back and forth- but stopping the motor leaves it at a position, and restarting the motor it continues to move (oscillate) from there.

I tried and don't think an AC source could do it, they are periodic and I couldn't think of a way to remember its phase angle when it gets stopped.
 

eetech00

Joined Jun 8, 2013
3,149
I need to make an oscillator in LTSpice that can be started/stopped without losing phase info. When it's stopped, somehow remembering its phase and continuing from there when it gets restarted. Doesn't matter if sine or triangle wave, a square-wave would not work for what I'm, trying to do.

It is to simulate a mechanical system like a printhead that moves back and forth- but stopping the motor leaves it at a position, and restarting the motor it continues to move (oscillate) from there.

I tried and don't think an AC source could do it, they are periodic and I couldn't think of a way to remember its phase angle when it gets stopped.
Are you wanting a actual circuit? or a behavioral one for simulation only?
 

Thread Starter

prairiemystic

Joined Jun 5, 2018
240
I was looking for a behavioural circuit, but if I have to add a small oscillator/sample & hold circuit to generate the signal, that is OK too. I'm going to try crutschow's circuit and see how it does. Thank you. I forgot a capacitor in Spice has no leakage.

What I need to do is simulate/test the rest of a circuit that reacts to the one limit switch. I have to see what the timers and debounce do under a bunch of scenarios, like multiple speed settings and cancelling things etc. given the mechanical aspect.
 

Parkera

Joined May 3, 2016
96
"I forgot a capacitor in Spice has no leakage."
Just assign an equivalent parallel resistance to the capacitor. (right click on the capacitor)
 
Top