[CentralOH] Simply Stated Problem Solved Simply

Brian Costlow brian.costlow at gmail.com
Tue Dec 10 14:36:53 CET 2013


The solution here is almost identical to the one I posted, except goo()
allows floating point discrepancies to creep in. Which usually will just
wash out, but could potentially round to the wrong step. That's dependent
on the expected range of d. Using the decimal library helps to prevent
that, and/or signals when you have an issue.

It's worth reading through the module's doc and understanding for this type
of application.


On Tue, Dec 10, 2013 at 12:23 AM, <jep200404 at columbus.rr.com> wrote:

> 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/
>
> _______________________________________________
> CentralOH mailing list
> CentralOH at python.org
> https://mail.python.org/mailman/listinfo/centraloh
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/centraloh/attachments/20131210/2090dd5b/attachment.html>


More information about the CentralOH mailing list