Saturday, May 21, 2011

Connecting the Arduino to the heliostat

Four months. Ugh. Progress is always so much slower than hoped or expected. But anyhow… After some busy time at work and home, I’ve spent the last several weeks trying to get the heliostat to be software controlled – leveraging off Gabriel’s excellent work.

First job was getting an RTC going. I used this one from Adafruit, which is functionally equivalent to the one Gabriel describes here. It’s pretty easy to get this working.

The driver took a little more time. I am using very small DC motors because they are the cheapest game in town in terms of $/torque that you can buy new. (Steppers would be great but I just haven’t found them cheap enough). The plan was to use the half bridge circuit referenced in this post last August. That circuit may still be a good idea, but because I have limited experience with electronics, I decided to buy my way out of potential problems with an off-the-shelf motor driver. The L293D is an H-bridge motor driver built into an integrated circuit, it’s the chip at the top of the breadboard in the pic. It’s widely used with the Arduino so there’s lots of support out there. I used this excellent write up from someone at NYU to help figure out how to wire it and for code examples. I bought the L293D for $2.95 from Jameco, it may be cheaper elsewhere. Also the person who did the NYU write up mentioned an alternate chip, the SN754410, which was $1.95. The L293D apparently has “output clamp diodes for inductive transient suppression” which sound useful, but I don’t know if it’s applicable to this application or not. (Here’s a thread on the topic). But even at $3/stat (each chip controls two motors) it’s in line with my current budget to stay <$100/m2, and could likely be reduced. Efficiency and energy consumption when not in use also needs to be addressed.

What’s taken the most time and isn’t done yet for sure is modifying Gabriel’s code. I think I’m very close – it runs how it should based on the serial port messages it’s sending to the computer but I haven’t connected the ‘stat to it yet. I will post the code over at Gabrial’s forum. Right now it has lots of comments and is very messy. It uses the module he wrote for simple gears, modified a bit due to the different geometry of my ‘stat. Also, I took out the shift register part which is required for multiple stats, the module for multiple targets, and lots of the empty code for running additional ‘stats off the same Arduino. If the code works, my next step will be to add back the shift registers and set something up so it can control at least 4 stats. When it’s cleaner, I’ll post here but if you want it now, it will be on his forum.

So many plans, so little time. But, getting it running off code is an important step. I sure hope I can test the code on the 'stat before leaving for some travel on the 24th.

2 comments:

  1. Hej! If you dont use stepmotors, but usual dcmotors, then you need additional sensors. In my start of development for a low cost heliostat last november, my first decision was, to built my own drehgeber (rotation transducer). I soon abandoned that idea, but can give you the conception here.
    For a movement direction detection you have to have three signals. If the wind and not the motor maybe moves the mirror, you will be thus able to follow this induced movement also. A circular plate, on which three colored cracks are arranged. On the one side there are 3 color leds, wich oscillate fast, on the other side a photo diode or transistor. Other possibility, a white light and three sensors, wich have been made color sensitive with filters. But in any case, the light passes through a small gap, lets say 0,2mm. So the evaluating electronic will be able to count the steps up and down with high precision, which is, hundereds of steps in a relatively small room. This depends on the manufacturing of the mask, on wich the color gaps (windows) and black areas are printed on. You can use a standard laser printer for A4 translucent foils. The position zero has no coloring, to find the startpoint, after work, at dusk, again.
    This optical instrument is much more elegant as a mechanical, outwearing device. Nowhere could i find such a readymade thing for less than 50€. That is probably because it is the most advanced part of a heliostat. But, 3 LEDs, photodiode, foil and eventually a lightshielding cover, that you can get for around 10 bucks.
    I know, i know- its damn tricky. But, Brendan, if you want to do something really useful, then, in my opinion, this would be a great open source thing to have for every developer.
    The world is waiting for the printing PDFs and the electric circuit layout...its just a suggestion. NZ

    ReplyDelete
  2. Thanks for the comment, much appreciated. I'm going to have to think that one over a bit.

    My thought on what to add for better sense of positioning was a Hall Effect sensor ($1USD) and then put a magnet on one of the arms of the pinion gear and count rotations. I'll do a short post on this.

    ReplyDelete