Bob Ammerman wrote: > > Roman, > > Very impressive idea. > > Do I understand correctly: > > -- The PWM PIC has no responsibility other than genearating the PWM signals. > > How does the PWM PIC know what value to output at any given time? The system was needed for a low cost 8th step microstepping stepper motor driver. I needed to control the current in two phases, ie two h-bridges, so that is 9 possible current "sets" of combinations, (9x2 matrix) which can give all 8 microsteps. I wanted to avoid a hardware solution as that would eliminate tuning for torque and degree compensation with large motors. The PIC chip (16F84) has 3 pins for the 3 industrial standard step/direction/enable inputs. It then drives the 4 halves of the 2 h-bridges directly via 4 output pins, each through a simple RC integrator. Using hardcoded PWM loops of differing frequencies allowed fine tuning of the PWM voltages. I also used 32 actual PWM settings, to give all 4 quadrants so there is no phase direction switching needed. The PIC runs very simple firmware to step forward or back, and also can select full/half/4/8 steps via dipswitches. Options include auto current reduce mode and boost and software anti-resonance (not really needed with 4 or 8 ustep though!) Using 4 PIC pins and 4 RC networks means that I don't need much external hardware, otherwise it needs some pins for PWM and others for phase direction switching. The power stage uses hardware current feedback, so the PIC only provides a reference voltage, the hardware then adjusts current to match. This is lightning quick and gives fabulous motor performance compared to chopper systems that rely on L of the motor in the feedback loop. I have had arguments re the chopper/linear issue before, but the motor performance of a microstepping linear driver and a big motor is something else! :o) I always use hardware current feedback as it provides a lot of safety. In the event that the two h-bridge halves might both be turned on, the whole bridge will still limit to the correct current. Also will limit to the correct current if one of the 4 switches in the h-bridge goes short circuit. -Roman -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu