Yahoo Groups archive

68300

Index last updated: 2026-04-29 00:01 UTC

Thread

Tabel Stepper Motor TPU Problems

Tabel Stepper Motor TPU Problems

2002-11-19 by jeffreyslcu

Hi all,
I am using the Table Stepper Motor (TSM) function in the TPU to, 
well, run a stepper motor.  I am having two problems that I am hoping 
someone can help me solve.

First, I have some c-code to run the motor in an open-loop mode. 
Every 5mS I read the PRESENT_POSITION register, add an interger (say 
8), then write the result to DESIRED_POSITION. Then update the HSR to 
implement the command. My start rate is around 140 pulses per second 
(pps) and the slew rate is around 2135 pps.  I would expect the motor 
to run at a somewhat constant rate, or at least dither back and forth 
around the given rate based on the discrete acceleration rates in the 
profile lookup table. Instead it is very jerky doing stop and go type 
behavior. The pulse waveform out of the TPU shows both phases pulsing 
as expected, then one phase stops while the other phase keeps 
toggling a few times, then both phases begin pulsing again. This 
occurs somewhat rhythmically.

The second problem is the 1.8 degree per step motor will be rotating 
in the proper direction, suddenly reverse at a somewhat higher rate 
and travel more than one revolution, then reverse again and travel as 
normal. The phasing never changes to warrant the motor changing 
directions. I suspect the anomally above is causing the motor to have 
a resonance problem, but I have never heard of a motor traveling 
backwards for any substantial distance.

Can anyone help me with these problems?

Thanks,
Jeff

RE: [68300] Tabel Stepper Motor TPU Problems

2002-11-19 by Melear Charles-rdph40

Jeffery,
 
I really don't have a clue but for people who write in C, the get caught by a particular problem with how C treats the Host Service Request Register.
 
The first thing that you need to do is make sure that the pair of HSR bits that you are going to write are %00.
 
Then, you need to make sure that the C compiler only generates one instruction to write to this pair of bits.  Many times, the C compiler will generate both an AND and an OR instruction to write to the pair of HSR bits.
 
Now, this is most important:  DO NOT use read-modify-write instructions to deal with the Host Service Request Register.  AND, OR, EOR, etc., are all read-modify-write instructions.  
 
What you want to use is a MOVE instruction.  Actually, you need to use a MOVE (immediate) instruction.  Then, and this is psychotically important, write "0" to all the bits that you do not want to effect.  For instance, if you want to cause channel 0 to do something and the HSR code is %01, then use this instruction:  MOVE #$0001,(HSR).l.  If a bit in the HSR is currently a 1, then a write of 0 will have no effect.
 
The problem with RMW instructions is that the TPU can change a bit in the HSR inbetween the READ and the WRITE portion of the RMW instruction and this will result in an errant HSR being issued to the channel where the bit got changed.
 
Like I say, check the actual assembly code that the compiler generated and look for RMW instructions that deal with the HSR and I think you will find your problem.
 
Regards,
 
Charlie
Show quoted textHide quoted text
-----Original Message-----
From: jeffreyslcu [mailto:jeffrey.s.sato@...]
Sent: Monday, November 18, 2002 6:22 PM
To: 68300@yahoogroups.com
Subject: [68300] Tabel Stepper Motor TPU Problems


Hi all,
I am using the Table Stepper Motor (TSM) function in the TPU to, 
well, run a stepper motor.  I am having two problems that I am hoping 
someone can help me solve.

First, I have some c-code to run the motor in an open-loop mode. 
Every 5mS I read the PRESENT_POSITION register, add an interger (say 
8), then write the result to DESIRED_POSITION. Then update the HSR to 
implement the command. My start rate is around 140 pulses per second 
(pps) and the slew rate is around 2135 pps.  I would expect the motor 
to run at a somewhat constant rate, or at least dither back and forth 
around the given rate based on the discrete acceleration rates in the 
profile lookup table. Instead it is very jerky doing stop and go type 
behavior. The pulse waveform out of the TPU shows both phases pulsing 
as expected, then one phase stops while the other phase keeps 
toggling a few times, then both phases begin pulsing again. This 
occurs somewhat rhythmically.

The second problem is the 1.8 degree per step motor will be rotating 
in the proper direction, suddenly reverse at a somewhat higher rate 
and travel more than one revolution, then reverse again and travel as 
normal. The phasing never changes to warrant the motor changing 
directions. I suspect the anomally above is causing the motor to have 
a resonance problem, but I have never heard of a motor traveling 
backwards for any substantial distance.

Can anyone help me with these problems?

Thanks,
Jeff


---------------------------------------------------
To unsubscribe from this group, send an email to:
68300-unsubscribe@yahoogroups.com

To learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu <http://www.motorola.com/mcu> 



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . 




[Non-text portions of this message have been removed]

Re: [68300] Tabel Stepper Motor TPU Problems

2002-11-19 by Robert Yablonski

Jeff,

I do not know if the TSM is causing problems but stepper motors are very 
fickle unless put into a closed loop system.  You can easily get the 
problems you describe if the drive pulses are not locked to motor 
position.  The random TPU behavior is not welcome.  Maybe someone can 
explain it.

R. Yablonski

At 12:22 AM 11/19/02 +0000, you wrote:
Show quoted textHide quoted text
>Hi all,
>I am using the Table Stepper Motor (TSM) function in the TPU to,
>well, run a stepper motor.  I am having two problems that I am hoping
>someone can help me solve.
>
>First, I have some c-code to run the motor in an open-loop mode.
>Every 5mS I read the PRESENT_POSITION register, add an interger (say
>8), then write the result to DESIRED_POSITION. Then update the HSR to
>implement the command. My start rate is around 140 pulses per second
>(pps) and the slew rate is around 2135 pps.  I would expect the motor
>to run at a somewhat constant rate, or at least dither back and forth
>around the given rate based on the discrete acceleration rates in the
>profile lookup table. Instead it is very jerky doing stop and go type
>behavior. The pulse waveform out of the TPU shows both phases pulsing
>as expected, then one phase stops while the other phase keeps
>toggling a few times, then both phases begin pulsing again. This
>occurs somewhat rhythmically.
>
>The second problem is the 1.8 degree per step motor will be rotating
>in the proper direction, suddenly reverse at a somewhat higher rate
>and travel more than one revolution, then reverse again and travel as
>normal. The phasing never changes to warrant the motor changing
>directions. I suspect the anomally above is causing the motor to have
>a resonance problem, but I have never heard of a motor traveling
>backwards for any substantial distance.
>
>Can anyone help me with these problems?
>
>Thanks,
>Jeff
>
>
>---------------------------------------------------
>To unsubscribe from this group, send an email to:
>68300-unsubscribe@yahoogroups.com
>
>To learn more about Motorola Microcontrollers, please visit
>http://www.motorola.com/mcu
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.