Sunday, June 2, 2013

GPS Tracker V3 with Stepper and WiFi

Film yourself

The GPS Tracker is a motorized tripod to constantly record a movie of you. 
(complete source code posted in the openpicus forum here)

If you want movie clips of yourself you have multiple options

  • An action camera like the GoPro - nice for having a close up of you near to the action but the shaking movies and just seeing parts of you is not perfect most of the time. A nice addition but not for the main movie.
  • Ask somebody to film you - That is not much fun for the person and because the camera will be held free hand lots of shaking again. Resulting video often cannot be used.
  • Use a tripod - Then you are immobile and the person recording you would need to wait until you are nearby, film you for a few seconds and then wait again. This is certainly the option with the best quality if you can find somebody doing that, having the time and enough experience with the camera.
The GPS Tracker adds two more options
  • Follow you automatically - Not as perfect as a human but better than nothing. The GPS Tracker cannot zoom as none of the cameras allow for that reliably by cable and it is not as precise as keeping you in the center of the image manually.
  • Set the camera to cover an area and turn it on while you are inside that area - Good for overview shots but no close up

Video of a test run






Concept

When the tripod is turned on, the current GPS position is assumed as the home position, then you take the GPS sender and walk away from the tripod towards the object the camera is looking at currently. Once you are far away enough, the tripod will start following you and while you are inside a defined area, it will turn on the camera automatically.
The GPS tracker is connected via WiFi and operated via the browser of your computer or smartphone and allows you to control all settings.
The hardware is quite simple, an OEM GPS module is connected to a XBee RF node sending five GPS NMEA sentences per second via the 2.4GHz band to a second XBee built into the tripod. There an OpenPicus Flyport module does decode the sentences and based on the difference between the initially set home position and the current GPS position does calculate the angles. These angles are transformed into the required motor position and via I2C the motor controller gets the task to move to this position. The used TMC222 motor control does this job nicely with soft accelerations until a maximum speed and then decelerating before reaching the desired position. And if the position gets updated while the motor is moving still, the new position is merged into the current movement.

There are two commercial alternatives available I am aware of at the moment
http://soloshot.com/: Pan only, fixed tripod, no control over the camera
http://www.movensee.com: Pan and Tilt, supports camera zoom via LANC

Enduser Experience

When you turn on the GPS Tracker it does not know at what point it is looking at. So when the GPS Tracker is turned on it will receive from the GPS handheld sender the correct position while you are standing next to it. Once the signal quality is good enough, this GPS location is set as the home point. Now you walk away from the Tripod carrying the GPS sender with you into the direction the camera is pointing to, e.g. walking towards the same landmark the camera was centered to, and once the distance is over 50m the tripod starts tracking you.
If you happen to get closer than 10m, the GPS error is assumed to be too large and tracking is paused to avoid unnecessary and arbitrary head movement.
Via the smartphone's browser you can see the home position, the remote position, the angles calculated and make all kind of settings, e.g. by clicking on the arrows to re-center the object to track.

The screen is very basic at the moment and more meant for debugging than anything else but shows what can be done already.

The GPS Sender is very simple, a battery, an XBee carrier board with a voltage regulator and the GPS receiver connected to its UART port. All of that put into a simple small casing.

Modus Operandi

Once the GPS Tracker knows the position it starts following the GPS Sender. There is nothing else to do. Using the browser you can make a few settings however. First and most important are the limits. With these you can control the maximum angle and distance you want to cover.
The idea is that usually you do not want to track all the time but only when you are within a certain area. For example while I am standing on the beach completely exhausted from the Windsurfing session, I don't need that to be recorded. Hence I set an angle limit of +- 60° so it does stop recording while I am 90° off to either side. And if I am more than 600m away, filming does not make much sense either, I would be a small black dot on the screen only.
So the head will turn only within that angle limit and only while you are inside the range. Whenever you enter or leave that area the camera recording will be turned on or off.

The other setting you can make is tracking on/off. Instead of the head following you, the alternative is to keep the head static, e.g. it is adjusted to have the entire skiing slope in the view finder and it should video tape you whenever you are inside that area. So you can go up the hill with the lift, camera is off, then you gain speed and once you are inside the tracking area the camera will be turned on and turned off once you are leaving the area again.

Noteworthy details

In order to turn on and off the camera, the GPS Tracker has a 3 Pin Stereo Plug to connect the camera specific wired remote control trigger cable. While for taking images it would be quite easy to take one picture every second and hence release the shutter, the logic has to be a bit more fancy. First, for videos we need to be 100% sure about the state we are in, not that a signal was too fast and the camera did not even start recording. Result would be that we start recording whenever it should have stopped actually and vice versa. Second problem is the autofocus. You cannot simply send the trigger signal, you have to send the focus signal first, wait a second and then start the recording. And the third problem was jitter whenever the GPS signal is near the tracking area limits. You cannot turn on and off the camera too frequently and also there have to be timeouts, e.g. when the GPS signal was lost for a minute or so. All of that needed a bit of tweaking until it worked flawlessly.

Those XBees are amazing. For one test I tried to cut the RF line, so I walked behind trees in a forest, out if direct sight down a little hill and yet the signal was stable not losing a single GPS position.

Suggested changes

Top of my list is to rework the mechanics. The reason I wanted to have Pan and Tilt functionality was so that I can use this for gigapixel panoramas as well. But frankly, the requirements are too different. With the GPS Tracking it is about speed and for use as panorama head it is about precision, stability and backlash of the gear. I hoped I can have both with one head but that was a mistake.
So the next construction will have Pan movements only making the unit much more simpler to build and more compact. And the gear ratio I will be increase a lot, something else I learned. Yes, if you want to follow a race car passing by in 10m distance, the head needs to turn by 180° in virtually no-time. But for smooth movements of a 100m far person the 1.8° resolution of the stepper plus the 1:6 gear I have at the moment is not precise enough. Next time I go for the other extreme, I add a 1:100 gearbox and as a planetary gear for virtually no backlash. Depending on how that turns out I might add the camera tilt option later again.

The basis of the new pan head

Where I would need help is the GPS sender. As said, at the moment it is just the GPS receiver connected to the XBee and therefore you get no visual information about the current state. For debugging no big deal, I have the smartphone with me all the time and can watch the values in the browser but longterm I would like to have a microprocessor on the handheld unit as well. Maybe as simple as a LED, maybe even allowing for push buttons but frankly, what I have in mind is more:

  • visual indicator if you are in the tracking area or not
  • visual indicator about the XBee and GPS quality
  • switch the tracking mode on/off
  • override the camera to take a picture now, even if outside the tracking area
  • button to set the maximum tracking distance to the current position instead of you estimating that it might be 600m and entering that upfront
  • use it as a wide distance remote trigger with various triggering methods. e.g. setup a photoelectric barrier at the slope, connect it to the sender and whenever somebody passes through, it will trigger to film or take photos for a few seconds. We had a use case for that, a snowboard training course and at one gate we wanted to take pictures from each person passing

I had used one of these MicroMedia PIC32 boards in the past, maybe that will be the basis for the sender?






Post a Comment