Newsgroups: comp.robotics
Path: cantaloupe.srv.cs.cmu.edu!europa.chnt.gtegsc.com!news.sprintlink.net!uunet!in1.uu.net!portal.austin.ibm.com!awdprime.austin.ibm.com!awdprime.austin.ibm.com.!nahshon
From: nahshon@vnet.ibm.com (Itai Nahshon)
Subject: Re: Special PWM for motors
Sender: news@austin.ibm.com (News id)
Message-ID: <NAHSHON.95Jun30202428@rs3bt-01.haifa.ibm.com>
In-Reply-To: lis@asic.ict.pwr.wroc.pl's message of 29 Jun 1995 16:12:07 GMT
Date: Fri, 30 Jun 1995 17:24:28 GMT
References: <3sujcn$gbk@cyber.ict.pwr.wroc.pl>
Organization: IBM Israel Science and Technology, Haifa, Israel
Lines: 40

In article <3sujcn$gbk@cyber.ict.pwr.wroc.pl> lis@asic.ict.pwr.wroc.pl (Jarek Lis) writes:

>Hello,
>    I found interesting algorithm for PWM. It generally try  to generate
>highest frequncy output 0-1 pattern for given change frequency. i.e.

>10% is 10000000001000000000....
>20% is 10000100001000010000....
>30% is 10010010001001001000
>40% is 10100101001010010100

>Suggestion was, that it fits nice to software driven PWM circuit, because
>it gives similar frequency with much less interrupt frequency than standard
>method. It's true, but I'm not conviced if such waveforms are suitable for
>driving motors. Beatiful for heaters, but what about motors...

>Any tips?

>Jaroslaw Lis

Jaroslaw,
The original HexMon4.0 for the MiniBoard works just the same. You load
a 16 bit bit-pattern to a memory location. That pattarn is rotated by
the 1 Khz interrupt routine, turning the output on and off as the bits
are moving.

This implementation is almost useless, because you can set the motor speed
only at 16 ms intervals.

I have a different implementation which alows any resolution (up to 128 motor
leveles in each direction). Off course, better resolution means a longer cycle.
My implementation takes very few cycles in the interrupt handler (it's comparable
to, or even better than HexMon-4.0) and you can set a new speed at any time
(including in the interrupt routine itself).

Look at cher.media.mit.edu:/pub/incoming/itai/
Assembly source for HC11 and a readme file.

Itai Nahshon,
Haifa, Israel
