Thursday, June 9, 2011

Hello hall sensor

Got the Hall Effect Sensor working. This is the code it's using. The other gotcha for me was wiring it up right -- took awhile to see the teeny tiny notations in the specs that tell you the wires are V, Ground and Signal read from left to right with the printing facing up. Feed signal wire into input 2 on the arduino (one of the two available interrupt pins). Also the Arduino sketch wasn't compiling until I put the pin information inside the (setup) section, but I think that's just me not understanding rules for declaring variables and such.

Here's what worked:
void setup()
{
pinMode(2, INPUT); //set the interrupt0 pin2 to input
digitalWrite(2, HIGH); // and enable it's internal pull-up resistor
Serial.begin(9600);
and so on.

This adds some useful options for position control on an otherwise simple gear motor.

Friday, June 3, 2011

Center mount issues and position sensing

Not real progress to post, but a couple things I've been thinking of lately.

First, the center mount needs to be replaced. Much as I love how easy, cheap and sturdy it is, the problem is that a simple ball in socket connection allows rotation (undesirable!) in addition to free movement in the X and Y planes (desirable). Consider when the mirror is parallel to the ground. It can move (by wind or due to the play in the linkages) easily clockwise (or counter) and this puts lots of strain on the threaded rods. I've had them bend and had failures due to this. So I think that center point needs to be re-thought so it can't move except for in the altitude and azimuth axis. In addition I'm going to use purchased, metal clevis yokes with tight fitting push rods to reduce play/slop in the mechanical linkages. Also, I think I'll uptick the threaded rods to 3/8". After having it spend some time outside, it just isn't feeling sturdy enough. The other idea along these lines is to make it into more of a monolithic frame. I submitted a design to shapeways to see about doing this sooner than later, but because they charge by the cubic centimeter, it will cost upwards of $1500 to print. So I'll hold off on that for a bit.

Second, responding to a comment on the last post, I agree that it's very likely I will require additional positional information. Right now I'm leaning toward using some Hall Effect Sensors. These sensors put out a voltage whenever they are close to a magnetic field. This is the omnipolar one I got from Digikey. And here is an excellent write up of how to use interrupts on the arduino to integrate this sensor into a counter. The idea would be to embed a magnet in one arm of the pinion gear and count how many times it has rotated. A count of how many times the gear has rotated, that's a decent proxy for mirror position. There are bipolar sensors but I think they'd be a bit harder to integrate based on the comments section for this part.

Anyway, a short post but just wanted to lob that out there.