VHDL Model of a stepper motor

Anybody allready designed a VHDL model of a stepper motor to simulate in modelsim ?

Reply to
fpgauser
Loading thread data ...

Do you really mean a model of a _stepper motor_? If so, you will need to decide how you map from the physical properties and operating conditions of the motor - shaft angle, externally applied torque etc - to VHDL data types. And you will need to decide how fast to sample and update your model in order to mimic its continuous-time behaviour in the discrete-time VHDL simulator.

It's not even so simple to decide how to model the electrical inputs to such a motor.

On the other hand, if you simply want to assume that the motor is very lightly loaded and is driven by on/off digital signals, you may be able to write a very crude discretized model that looks at the electrical input, decides what the settled shaft angle should be for that input, and causes the shaft angle to progress towards that position over time. I suspect, though, that you will still need to model the motor's speed in some way.

For unusual applications like this, it's important to specify the level of modelling accuracy you require - it makes a huge difference to the difficulty of creating a model.

Note that the mixed-signal simulator people solved these things a long time ago; if you have a complete mixed-signal simulator then you will probably get quite a few such models bundled with it.

Finally, since you are working in ModelSim, it is left as a trivial exercise for the reader to write a little Tk graphical widget that will display the motor's position visually as the simulation proceeds :-)

--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.bromley@MYCOMPANY.com
http://www.MYCOMPANY.com

The contents of this message may contain personal views which 
are not the views of Doulos Ltd., unless specifically stated.
Reply to
Jonathan Bromley

fpgauser schrieb:

Hi, for a physical model you need a VHDL-AMS Model. Modelsim does not support VHDL-AMS (yet? :-) ).

Everything else has been answered by Jonathan Bromleys posting before.

Have a nice simulation Eilert

Reply to
backhus

Thanks to both.

No, the motor model cannot be trivial. (low load etc.) I really need to model the inductance-angle behaviour in order to obtain a realistic current. I am going to create a mechanism to detect the losses of steps and want to created certain extreme cases of operation. For the simutation I do not need realy the physical angle of course but the resulting PWM controlling the inductance / motor current, so I though a digital model would do.

One idea was to emulate the inductance's behaviour with a circuit decribing the I according to the incoming U (done by a serial DAC). So the chain was: serial stream -> parallel -> voltage as integer ->

create di/dt -> add di/dt to I , calculate accelleration, and so on thus finally obtain a virtual axis postion. Magnetism is the next.

But if you say there are existing VHDL-AMS models I'll have a look at this.

Reply to
fpgauser

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.