Close

Talking to the Big Easy Driver (BED)

A project log for Windicator

The weather tracking time-lapse camera and weather station.

john-leemanJohn Leeman 05/04/2017 at 04:320 Comments

The next step was getting the turntable rotating using the Big Easy Driver (BED) and the Raspberry Pi. Luckily, the BED is very simple to control, with three pins setting the step size (full, half, quarter, eighth, or sixteenth), one pin setting the direction, and another instructing the motor to take a step. I whipped up a little driver in Python and was ready to test it out.

I hooked up the BED to the Pi and a power supply for the motor. Running the code produced no rotation - after playing around and looking at the outputs, I determined that I needed a longer pulse to the step pin that actually tells the driver to move the motor. The documentation states that 1µs high and 1 µs low is adequate, but I found that values around 1 ms worked much better. There was also some tuning is the timing to get the motor to move smoothly and reliably. In fact, I wrote a quick test script that would move the motor a random number of degrees in the range 0-360, then back again. It did this a few thousand times to simulate many days of steering based on changes in the wind. The motor did return very close to its initial zero position!

My initial idea on making sure the turntable did not turn more than 360 degrees and wrap up the camera USB cable was using two magnets and some hall sensors. While that should still work, I think I like the idea of putting an inexpensive magnetometer on the table (maybe the MAG3110). Actually knowing the direction that the camera is pointing will prevent any weird edge cases with power cycling or winds that hover right around the point at which the table would need to switch direction. For the small amount of expense added, this is a huge boost to reliability.

So the motor is turning, now we need to design and add the wind-vane, as well as start taking photos. I’ve been working on the code for the wind vane, environmental sensors, and interface in the repo, but it is currently all untested.

Discussions