Close

Testing v1.0

A project log for ESP8266 Stepper Driver

A cable-less connection for stepper motor control, using Forth

RigTigRigTig 12/07/2016 at 13:470 Comments

Reworked code to better use the existing words in PunyForth, and actually did some testing on a 28BYJ-48 stepper motor using a ULN2003 driver. Version 1.0 of code is working fine from serial monitor. See video at https://vimeo.com/194805134.

I decided to create a source file with minimal comments in an attempt to get the code under 1K bytes of source. Well the fist edit achieved 1098 bytes, and there are still some comments and whitespace I can cut out. Of course, I can also reduce the source code size by using much shorter names for the newly defined words, but that can be even more cryptic to read. Still it is an option, and I may need it, just to prove a point.

Just as an example of the usage for the topmost word, you type in 2 numbers and the word 'move'. The first number is the time for the move to take, in microseconds. The second number is the distance in micrometres (um) to move. So, if you wish to move 40 millimetres (40mm = 40000um) in 1 second (1000000uSec), then you type

1000000 40000 move
and it happens. Well, kind of approximately; the actual move might be up to a step short of the distance and the time might be a few microseconds longer, but quite ok for this project. Now, keep the numbers you try within the capability of the stepper motor, because there is no checking in this code (at least not yet) if you overstep (pun intended) the rather slow little stepper (28BYJ-48).

Talking of steps, the next step in this project is to give the commands via wifi.

Discussions