More tea please.

Rotary encoder pattern generator

Rotary encoder pattern on wheel.
In preparation for some hacking on the Student Robotics motor feedback, I’ve written a script for generating PDFs containing rotary encoder patterns. I wrote a utility that used cairo in C a while back. I thought I’d try out pycairo. It was pretty much the same experience. I’ve put it up on gitorious. Run it like this:

% git clone git://gitorious.org/rotenc/rotenc.git
% cd rotenc
% ./rotenc
	INNER_DIAMETER is the diameter of the inner circle in millimetres.
	OUTER_DIAMETER is the diameter of the outer circle in millimetres.
	N_SEG is the number of segments to draw
	OUT_FILE is the name of the pdf file to write to.
% ./rotenc 50 60 16 encoder.pdf

Rotary Encoder Screenshot

Update:I thought I’d experiment with Thingiverse, and upload it there.

Posted at 2:57 am on Wednesday 12th August 2009

2 responses to “Rotary encoder pattern generator”

  1. Chris says:

    This looks like something that the students could really make use of. Any chance we could put a link into the ide so they can generate a pdf using your script running on button2 ?

  2. rob says:

    @Chris: Already on the TODO list :-)

Site by Rob Gilton. © 2008 - 2019