Help with DPLL motor control

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi everyone.

I meant to add comp.arch.embedded also to my original post (which went
into comp.dsp).

I am working on a digital PLL design for a motor control application and
I need some help with the control-loop aspects. The end goal is to have
my motor achieve phase lock with a reference signal.

Some background information:

My system consists of an FPGA which implements the "digital logic" end
of things such as the Frequency/Phase detector + error counters, PWM
controller, etc. The PFD is setup to drive a counter which keeps track
of the phase difference(in terms of counts) between my motor and a
reference clock. The FPGA is also paired up with a micrcontroller which
I am using to implement a PID loop, provide debug output, etc.

The DC motor I am using has an output that goes high once per revolution
("tach sense") which feeds one input of the PFD(realized in the FPGA).
The other input to the PFD is an external clock signal, so the PFD
compares a reference clock and the motor tach pulse train and spits out
an error between the two in terms of counts(it also has an output lets
me know if the motor is faster or slower than the reference clock).

The problem:

Since I am implementing a digital PID controller (in software on the
uController), usually the sampling rate ("Ts") is factored in the
conversion from a continuous-time to discrete-time control-loop. If it's
important, I am using the Tustin or Bilinear transform to go from C-->D.

The issue I face is that my error counter can only be read when the only
when the motor has spun around and the reference clock has come by(the
FPGA logic provides a signal that interrupts the uC when a new error is
available and then the uC reads the error counter in the FPGA).

Given that the motor will probably be speeding up/slowing down as a
result of the control-loop, this means that I probably will not receive
errors at periodic intervals, thus I cannot factor in one Ts into my PID
code for my discrete-time implementation.

My question:

Can I just keep track of the time between each error event, convert that
to a Ts and use that as my Ts each time I get a new error ("variable
sampling rate")?

Are there any draw backs to this technique?

Are there any alternative methods?

I appreciate all suggestions and information.

Best regards.
-- Jay.

Re: Help with DPLL motor control
Quoted text here. Click to load it

There is very little information available from the motor.
What jitter in terms of phase angle would you admit ?
What is the expected response time of the system ?

With the information given, I'd have a PI controller with a
time constant in the order of 1000 revolutions or so to start with.

As improvement you can implement a model of the motor and
whatever there is attached.

Ing.Buero R.Tschaggelar -
& commercial newsgroups -

Re: Help with DPLL motor control
Quoted text here. Click to load it

When the reference clock is fixed I'd process with the reference clock.
When the system has a variable reference clock, I'd use a fixed clock
and use new values when they are available.

The model of the loop becomes more complicated when is has to be adapted
to variable processing speeds, as the weight of 'time' changes.

Ing.Buero R.Tschaggelar -
& commercial newsgroups -

Re: Help with DPLL motor control

snipped-for-privacy@none.none says...
Quoted text here. Click to load it

Thanks for your suggestions, I'll try to follow them.

In your previous post you asked about phase accuracy -- I'm hoping for 1
deg phase accuracy.

Also, I have another question, perhaps it can be correlated with the
somewhat recent discussion about stepper motors.

If know the frequency plot/response for my motor and I know that it does
not respond to frequency inputs beyond, say 10Hz or so, it would be a
bad idea for me to issue motor frequency changes at a rate about 10Hz,

I ask because it's possible I could receive error information for my
control-loop to process as fast as 50Hz. If my motor cannot respond to
changes faster than 10Hz, I suspect if I take the error coming in at
50Hz, process it and produce a new duty cycle (voltage output for the
motor), I could end up with a limit-cycle. Is this correct?

I am asking this because others have suggested that my error rate needs
to occur at 5x or 10x the bandwidth of my system, but my feeling is that
if my motor cannot respond to changes at 5x or 10x its bandwidth, I'm
asking for trouble...


-- Jay

Re: Help with DPLL motor control

Quoted text here. Click to load it

In general, sensor data should be processed as fast as possible,
because delays are can only be kept under control in a control loop
with slow integrators. In you current project, I tend to think
your data comes not very often and with a delay, hence my suggetion
to use a slow integrator.
Whatever additional knowledge you can gather, the earlier the better,
can be used to improve the control loop.
When you're aiming at 1 degree phase error, oversampling definitely

Ing.Buero R.Tschaggelar -
& commercial newsgroups -

Site Timeline