# [CentralOH] Simply Stated Problem Solved Simply

jep200404 at columbus.rr.com jep200404 at columbus.rr.com
Tue Dec 10 06:23:42 CET 2013

```On Mon, 9 Dec 2013 19:01:38 -0500, Louis Bogdan <looiebwv at gmail.com> wrote:

> On Mon, Dec 9, 2013 at 5:06 PM, <jep200404 at columbus.rr.com> wrote:

> > Does the following correctly describe what you want to accomplish?
> >
> >     Given position d and stepper motor resolution steps_per_unit,
> >     calculate the position closest to d that a
> >     steps_per_unit stepper motor can achieve.
> >
> > A terse yes or no without explanation is best.

> yes

Good. That's the clarity and simplicity that both you and I needed.
I think I already solved that problem.
See the goo() function near the bottom of an earlier post[1].

I exercised that code in Ipython Notebook and brought it to
tonight's meeting to show, but you were not there,
so I did not show it. I have attached a cleaned up version
of that notebook in the attached tarball.

You can play with that notebook, either by installing
Ipython Notebook[2] or running it on a remote server,
such as Ipython Notebook Viewer[3].
Scrutinize the output of cell #4.
Study the foo() function also. You might find it to be handy
for determining how many stepper motor steps to do.

[1] https://mail.python.org/pipermail/centraloh/2013-December/001919.html
That post might be longer than you thought.
Scroll all the way to the bottom.

[2] IPython & Notebook on Xubuntu 12.10 Desktop i386
https://mail.python.org/pipermail/centraloh/2013-February/index.html

[3] http://nbviewer.ipython.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stepper-solution.tgz
Type: application/x-gzip
Size: 1160 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/centraloh/attachments/20131210/395f8192/attachment.bin>
```