Tuesday, July 05, 2011

Picking up speed


The MIPS core that PIC32 uses is a very high performance CPU that was used in high end Windows workstations in the early to mid-1990s. It doesn't behave much like the 8 and 16 bit PIC chips, so it's taken me a while to get down the learning curve. The button function in the Mikroelektronika compiler library works, but requires about 10 msec to filter out the bounce when a limits switch is encountered.


Processing a button function for each step when I was running at half step slowed the y-axis down to 12-15 mm/sec. To get around that problem in firmware I wrote a smart limits switch routine that runs slow until it finds the first limits switch and then kicks the stepper motor up to full speed until it nears the other limits switch.


Using this approach lets me increase the maximum transition speed for the y-axis from 15 mm/sec to about 65 mm/sec for my firmware testing as you can see in the video clip.








It's worth noting that the Allegro driver chip has a maximum rating of 0.75 amps and the NEMA 23 is a six wire model drawing 0.5 amps per phase. I've wired it in series which brings that amperage down considerably. In spite of this I'm getting 65 mm/sec and both the stepper and the NEMA 23 are running quite cool. The driver chip requires no heat sink or fan.




5 comments:

Forrest Higgs said...

I've since tuned it down to about 52 mm/sec. Much more stable at that speed. :-)

Marcus Wolschon said...

Wouldn't it be simpler to develop the new wire-mechanics with some known working electronics first and only then start developing new electronics and firmware?

Forrest Higgs said...

Which would you suggest?

Marcus Wolschon said...

The one you are most familar with.
Writing things like smooth acceleration in XY independent from Z,
g-code interpretation,
pause and abort,
...
is a LOT of effort.
I fear that the very cool mechanical development
may suffer from a lack of time that is instead spend on duplicating the effort done by others.

Forrest Higgs said...

I do tend to use existing firmware for reference, but not necessarily as a starting point for my own.

I won't be using acceleration code, for example, for the simple reason that it isn't necessary given the torque of my NEMA 23's and, when it is used, you can't vary extrusion flow rates quickly enough to keep an even print line.