Micro-Stepping Hurdle (Solved)

lardomlardom Posts: 1,632
edited 2020-12-19 02:48 in Propeller 1
After learning how to produce a DC sine wave with a counter in duty mode I wanted to see if I could use sine waves to drive a bipolar stepper. My idea was to use two counters in differential duty mode with the second counter shifted ninety degrees. My only requirement is that I have to be able to do it with one cog.
I found that CTRB would spike at 3.3V @E000 if any CTRA expressions were in the repeat loop. I had to comment all expressions associated with CTRA to get rid of the spike. My oscilloscope is dual trace so I have to move the probes around.
The first image is CTRA which is what I expected. The second is CTRB which shows the voltage spike. The third shows CTRA and CTRB with the 90° offset with that annoying glitch.
There's got to be a way to do it. I'm not ready to give up. I'm kind of hoping somebody has seen this and can suggest ways to solve the problem,


  • A step driver would easier, motors and steppers don't really require sine waves to operate, modified square waves work the same. VFD drives put out a stepped square wave, same with step drivers.
  • I reduced the resolution and slowed it down so I could see what was happening. The circled pulse for both counters was the same. It is half the size of the other pulses. The solution is to write separate methods for CTRA and CTRB.
    800 x 480 - 136K
Sign In or Register to comment.