Searching \ for 'Need a smooth needle motion!' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=need+smooth+needle
Search entire site for: 'Need a smooth needle motion!'.

Truncated match.
PICList Thread
'Need a smooth needle motion!'
1999\08\16@183606 by Chris Eddy

flavicon
face
part 0 1342 bytes
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META content='"MSHTML 4.72.3612.1706"' name=GENERATOR>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#000000 size=2>Comrades;</FONT></DIV>
<DIV><FONT color=#000000 size=2></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000 size=2>I have a project with a stepper controlled
needle indicator.&nbsp; I have a simple 8 bit input.&nbsp; I have a maximum
needle speed.&nbsp; The problem is that I have a jerky needle motion.&nbsp; I
have an IIR filter in the software, and you can see the needle jerk in chunks
that resemble binary distances.&nbsp; (IE the needle surges less and less as it
homes in).&nbsp; I need good snappy response, but I need the needle to move
smoothly.&nbsp; Are there any filter gurus out there that can identify my
problem?</FONT></DIV>
<DIV><FONT color=#000000 size=2></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000 size=2>Thanks</FONT></DIV>
<DIV><FONT color=#000000 size=2>Chris Eddy</FONT></DIV>
<DIV><FONT color=#000000 size=2>Pioneer Microsystems,
Inc.</FONT></DIV></BODY></HTML>

</x-html>

1999\08\16@200026 by Dennis Plunkett

flavicon
face
At 08:49 17/08/99 +1000, you wrote:
{Quote hidden}

Yep this is the sort of thing one needs to do if it is to look like an
analogue counterpart.
You say in chunks, sounds like the time constant of the IIR is too short
(Not enough taps) And that you are reponding at a rate that may be way too
fast.
We all need to know a little more before we attempt to look at the problems
(Yes I think that there is more than one and I don't think that it is the
filter as yet, although it may be fixable in this area). Firstly how well
does it work when it has to move from a large value to a small value and
vice versa, secondly how does it move when subjected to small veraiations
ie. 3 or so bits worth (The IIR filter should do its job here) Then how
often do you sample, do you leave the ADC in continuios sample mode while
the IIR is active, or do you use a sample and hold type thing?

Please tell us more. I don't know much, but may be able to help.

Dennis

1999\08\17@094946 by Thomas McGahee

flavicon
face
One way to achieve a smooth needle movement is to
continuously modify the velocity based on the
distance the needle has to move. The larger the
distance, the shorter the time interval between
steps.

You would constantly compare the present position
with the desired position. The absolute value of the
difference would be used to govern the current
step rate. The sign of the difference would be used
to determine the direction of the step.

In pseudo-code the procedure would be something like this:

Initialization:
  Home stepper motor to 0 position
  Clear CurrentValue to 0
  Set Direction to UP
  Set TargetValue to 0
  Set Difference to 0

StepperMeter: (Main Routine)
  Call GetTargetValue. <TargetValue now has 8 bit value>.
  Call FindDifference. <Difference and Direction are now loaded>
  Call OneStep. <Step ONCE UP/DOWN and update CurrentValue>
  Call FindDifference. <New Difference and Direction now loaded>
  Call DelayDifference. <Delay based on remaining difference>
  Goto StepperMeter. <Loop>

GetTargetValue: (Subroutine)
  Check availability of new value.
  IF nothing new to be acquired THEN Return. ENDIF
  Acquire TargetValue via ADC/SerialPort, or via
   other means.
  Convert TargetValue into 8 bit form if not already
   received in this form. <8 bit unsigned binary.>
  Return with 8 bit value in TargetValue.

FindDifference: (Subroutine)
  Compare TargetValue and CurrentValue

  IF TargetValue=CurrentValue
   THEN set Difference to 0
        set Direction to UP
        Return.
  ENDIF

  IF TargetValue>CurrentValue
   THEN set Difference to TargetValue-CurrentValue
        set Direction to UP
        Return
  ENDIF

  IF CurrentValue>TargetValue
   THEN set Difference to CurrentValue-TargetValue
        set Direction to DOWN
        Return
  ENDIF

OneStep: (Subroutine)
  IF Difference=0 THEN Return. ENDIF

  IF Direction=UP
   THEN step up once
        decrement Difference
        Return
  ENDIF

  IF Direction=DOWN
   THEN step down once
        decrement Difference
        Return
  ENDIF

DelayDifference: (Subroutine)
  IF Difference=0 THEN Return. ENDIF

 Compute number of extra delay units: Units=255-Difference
 IF Units=0 THEN Set Units to 1 ENDIF

 Call StepTime (minimum step time)
DelayLoop:
 Call IttyBittyTime
 Decrement Units
 IF Units>0 THEN Goto DelayLoop ENDIF

 Return

StepTime: (Subroutine)
 Delay for 5 milliseconds (or whatever min step time is)
 Return

IttyBittyTime: (Subroutine)
 Delay for 100 microseconds (experiment with this value)
 Return

**************

Fr. Tom McGahee

1999\08\17@100704 by Lawrence Lile

flavicon
face
The short answer:   Nope.

The Long answer - what you need to do is NOT to filter the signal to your
stepper motor, but use microstepping.  The best place to look for this info
is

 Jones on Stepper Motors       http://www.cs.uiowa.edu/~jones/step/

This is a complete treatise on the subject of stepper motors and
microstepping.  There are a lot of others.

I am involved in a project now using stepper motors to control a pan system
for video cameras.  Same issue - at slow speeds they are jerky.  I am
looking into microstepping the camera motor to eliminate the jerking motion.





{Original Message removed}

1999\08\17@223258 by Russell McMahon

picon face
Then, if you are using a stepper motor,  there is microstepping - instead
of just applying steps you PWM between adjacent steps and vary the PWM
ratio smoothly.

This can work very nicely.

RM



>One way to achieve a smooth needle movement is to
>continuously modify the velocity based on the
>distance the needle has to move. The larger the
>distance, the shorter the time interval between
>steps.

1999\08\18@095315 by Chris Eddy

flavicon
face
I don't think it is related to switching of the stepper.  The motor moves
smoothly through individual movement segments.  The issue is how to match
the filtering of an input to the rapid motion of a needle.  With a digital
display, we simply do not notice the jerky nature of a filter function as it
homes in on a value.  The needle does, though.  So the question is one of
filtering such that it is smooth, and yet not so slow that it is not, well,
slow.

I see great ideas so far, and am about to try Tom's ideas.

Thans
Chris Eddy

Russel said:

>Then, if you are using a stepper motor,  there is microstepping - instead
>of just applying steps you PWM between adjacent steps and vary the PWM
>ratio smoothly.
>
>This can work very nicely.

1999\08\18@163456 by l.allen

picon face
{Quote hidden}

Just to add another possibility.....
Steppers are not inherently continuous devices, contiguous yes.
It might be a better approach to to actually use a continuous type
device... I know moving coil meters are a pain in the butt ... BUT
(humour) this is because they lack feedback.
I have started to play around with junked harddrives that use moving
coil armatures to position the heads with digital/optical positional
feedback.... and are they smooth.
This investigation arose because of a requirement for different meter
characteristics dependent on mode of operation, fast response, peak
detect,averaging, rms, peak hold, min hold etc and a digital circuit
vastly simplified  the circuit.
The problem with these mechanisms is I haven't seen them anywhere than
in harddrives.



_____________________________

Lance Allen
Technical Officer
Uni of Auckland
Psych Dept
New Zealand
_____________________________

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...