07-25-2007 12:22 PM
07-26-2007 03:44 PM
07-26-2007 04:02 PM
07-26-2007 10:28 PM
07-27-2007 08:39 AM
07-27-2007 01:13 PM
Difficult problem, especially if you also need to vary phase-switching speed or PWM duty cycle. Some incomplete thoughts, based on using counters:
1. 1 counter is the master clock and the 6 motor phase pulses are driven by it. This counter effectively sets the phase-switching speed for the whole pattern as a group. This counter's freq can be changed on the fly to change the motor speed.
2. Controlling the 3 low-side transistors for each leg is relatively straightforward. These 3 counter outputs start together but have a different value for "initial delay". They share the same frequency and 1/3 duty cycle which are defined in terms of "Ticks" from the master clock referenced earlier. An easy way to get them to start together is to start their tasks before starting the master clock task.
3. The 3 high-side transistors *might* be able to operate like this: Initially, think of them just like the 3 low-side counter outputs, using the same freq and 1/3 duty cycle but with their own distinct "initial delay" values.
4. Configure the 8th and final counter as a PWM generating counter whose freq and duty cycle can be changed on the fly. This one probably should NOT be driven by the master clock.
5. Configure your 3 high-side transistors to use the PWM counter as a "pause-trigger". Here's how I *hope* it works: the physical signal output from the 3 high-side transistors is like a logical AND of their internal output state with the PWM output state. When their internal output state is low, the PWM has no effect. When high, the PWM does what it should. (The alternate way it *might* work is that the internal timebase is logically AND'ed with the PWM so that "counting" is only enabled while the PWM is high. Not sure if I haven't ever tested this or if I just don't remember the results.)
Hopefully, this produces a system that allows you to vary both speed and torque by changing either the master clock or PWM duty cycle respectively. Not 100% sure though.
-Kevin P.
07-27-2007 01:37 PM
07-27-2007 02:21 PM
07-27-2007 02:24 PM
07-27-2007 02:26 PM