Giter VIP home page Giter VIP logo

panocontroller-firmware's Introduction

Actions Status Actions Status

Pano Controller Firmware 2.2

Open Arduino-based Platform for high-resolution panoramic photography controlled via Bluetooth App. Can be used to upgrade the board of a Gigapan EPIC 100, with the 3D-printed PanoController V4 Platform (On Thingiverse) or with other platforms with stepper motors.

The design goals for the new versions 2.2 and beyond are as follows:

  1. Expose all basic operations that the platform is capable of as discrete G-Code commands via Serial/UART
  2. On-demand send platform parameters and current status (position, battery etc) needed to configure an application and track the execution.
  3. The External (iOS) App (Bluetooth LE) or similar application will create and send the G-Code program to run the panorama or other activities.
  4. As the above App can display all the information, a display is no longer necessary on the platform.

See the Official Facebook page for demo videos and more progress photos.

Adafruit Feather M0-based Pano Controller installed in Gigapan EPIC 100Adafruit Feather M0-based Pano Controller installed in PanoController V4 3D-Printed Platform

G-Code Panorama Program

Features:

Software

  • Zero-motion shutter delay! When gyro is connected, waits for platform to stabilize before triggering. Extremely useful feature to compensate for tripod stability, platform's own movement or wind gusts.
  • Supports a subset of G-Code allowing full remote operation of the platform via a Bluetooth LE or serial. This enables running other programs than just panoramas (time lapse for example)
  • Precision sub-degree movement using the StepperDriver library
  • Smooth movement and iOS App Demo (2.1)

Hardware

  • 32-bit ARM controller board (Gigapan had 8-bit AVR)
  • Bluetooth LE control via iOS App
  • Battery voltage from 10V down to 6V due to the DRV8834 stepper driver used. Other drivers will enable different voltage ranges if necessary.

Wiring map

An Adafruit BLE device is now required for Bluetooth LE connectivity. Wiring is mostly stable but subject to change if new devices or options are added.

Controller

The controller unit comes with no display. All the controls and status are presented via the iOS App.

Feather M0 / Bluefruit

Status: in active development. Using onboard Feather/BLE. Builds in Arduino or PlatformIO.

  • A0
  • A1
  • A2
  • A3
  • A4 - Battery Voltage via divider: Vin---[47K]---A0---[10K]---GND
  • A5
  • SCK - BLE(internal)
  • MOSI - BLE(internal)
  • MISO - BLE(internal)
  • RX/0 - CAMERA_FOCUS active LOW
  • TX/1 - CAMERA_SHUTTER active LOW
  • 4[BLE] CS (internally connected)
  • 7[BLE] IRQ (internally connected)
  • 8[BLE] RST (internally connected)
  • SDA/20 - MPU-6050 board
  • SCL/21 - MPU-6050 board
  • 5 - DIR
  • 6 - VERT_STEP
  • 9[A7] - HORIZ_STEP
  • 10 - nENABLE
  • 11 - MPU-6050 Vcc (to be able to power on separately)
  • 12 - MPU-6050 INT
  • 13[LED]

Teensy LC / 3.x

Status: builds on PlatformIO. Bluefruit SPI Friend is required.

  • A0 - BATTERY - Battery Voltage via divider: Vin---[47K]---A0---[10K]---GND
  • A1
  • A2
  • A3
  • A4 - SDA - MPU-6050 board
  • A5 - SCL - MPU-6050 board
  • A6
  • A7
  • D0/RX - CAMERA_FOCUS active LOW
  • D1/TX - CAMERA_SHUTTER active LOW
  • D2 - MPU-6050 INT
  • D3 - MPU-6050 Vcc (to be able to power on separately)
  • D4 - BLUEFRUIT_SPI_RST
  • D5 - DIR
  • D6 - VERT_STEP
  • D7 - BLUEFRUIT_SPI_IRQ
  • D8 - BLUEFRUIT_SPI_CS
  • D9 - HORIZ_STEP
  • D10 - nENABLE
  • D11 - SPI_MOSI - BLUEFRUIT
  • D12 - SPI_MISO - BLUEFRUIT
  • D13 - SPI_SCK - BLUEFRUIT

All

  • Vin is 6-10V when using DRV8834
  • 3.3V step-down adapter from Vin to Vcc for logic power
  • All ~SLEEP tied to Vcc
  • All VMOT tied to Vin
  • All M1 tied to Vcc (preset 1:32 mode)
  • All M0 left unconnected (preset 1:32 mode)
  • All ~ENABLE tied together
  • All DIR tied together (multiplexed in software)
  • 100uF capacitor at Vin
  • 10uF capacitor at Vcc
  • 10K pull-up resistor from Vcc to ~ENABLE
  • Voltage divider Vin---[47K]---A0---[10K]---GND

Notes

  • Atmega328-based boards are not supported, see issue #57
  • Serial or Bluetooth LE is required for the current design. Only the Adafruit_BluefruitLE library is supported for now, but any UART-type protocol should work with minimal changes.

Setting stepper motor current limit for DRV8834

  • Vref0 = 2V +- 0.1V
  • Pololu schematic shows Risense = 0.1 ohm
  • Itrip = Vref/(5*Risense)
  • So set Vref = Itrip/2

Gigapan EPIC 100

Gigapan motor spec is 1A, so 0.5V. At full step the current limit is 0.7*Itrip, so we have to set Itrip to 1.4 and Vref to 0.7V as upper bound.

Lower current

Tested with ~1.5lb zoom lens+camera. The minimum Vref that avoids skipping is about 0.3V (0.6A to motor), but it will vary with camera weight. It may be possible to use lower current even, if we reduce the speed.

Bill of Materials

Electronics

Libraries

Hardware

Well, this is a controller, so it needs a pano platform to control. I used the Gigapan Epic 100 but any platform with two motors (or even one, I suppose) can be used. The only thing required of the platform is the two stepper motors, one for horizontal movement and the other for vertical.

  • 2 x Bipolar Stepper Motors and reduction gears.
    • Examples:
      • 39BYG101 0.5A
      • 39BYG001 1A (used in Gigapan platform)
    • Notes:

Previous Versions

The previous versions of this project had different goals and do not require an external app:

panocontroller-firmware's People

Contributors

laurb9 avatar per1234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

panocontroller-firmware's Issues

Add compass support

Remember start orientation when platform is moved or rotated. Possibly record this somewhere so it could be stored in exif for the pano.

Zero-motion shutter delay mode (gyro-based)

The MPU needs to be installed on camera platform, not base - need vertical flex wiring
Adds more complexity but has significant benefits:

Most important is "Shutter zero-motion wait mode": wait until platform is stable relative to the shutter and focal length selected, before activating shutter.

Remember vertical position

Vertical carrier orientation is relative to platform but as there is no end marker, calibration is not possible. Do not want to keep motors on all the time, but it may be what needs to be done.

Smooth out motor movement

Starting the motor at full power causes it to miss step sometimes, depending on which intermediate position it was on. We should start slow and build up to max rpm, then slow back down to reduce shake.

This is a StepperDriver issue mostly likely.

Repeat shot if motion detected

Suggested by Nick Fan: repeat shot if motion is detected during shot.

This is different than waiting for no motion. We probably have to set upper and lower bounds and listen for the entire photo taking wait interval. This interval might be different than actual shutter though (think bracketing).

Redesign pano operation display

It could be more like a camera settings page showing all important settings at a glance.
Switch to using graphics instead of text where needed.

SAMD support (Adafruit Feather M0)

Support new Cortex M0 boards:

pin allocation needs revisiting
This focuses on handling the M0 only. BLE integration in #10

decode flash protocols ?

Find documentation or decode flash protocols for Sony / Canon etc. If we can fake a flash unit, then we can automatically sync focal length, shutter from the camera.

Need help to find out if these protocols are documented anywhere.

Sony/Minolta: http://mhohner.de/sony-minolta/flashcomp_techref.php
Canon: https://billgrundmann.wordpress.com/2009/03/18/sniffing-canons-ettl-protocol-2/
Nikon: http://cms.diodenring.de/de/electronic/microcontroller/110-ittlanalysis
http://off-the-clock.timothy-nicole-marks.com/computers-and-electronics/nikon-flash-analysis

Hangs when returning from pano setup via IR remote.

Canceling pano setup via IR remote ("0" button) goes back all the way to main menu then hangs.
The battery is not displayed.
No controls are responding.
Reset via battery disconnect is the only recovery option.

This may not be related to the remote per se, since canceling is not available on joystick.

IR shutter remote

Add an IR transmitter to trigger the shutter.

  • simpler: no more shutter cable to plug and unplug and expose opening to dust
  • on A6000, IR remote can trigger a full bracketing sequence in one quick press, whereas the wired shutter needs to be held down the entire time otherwise

possible problems:

  • strong sunlight issues ?

zero motion, shutter and bracketing/HDR

Shutter speed is not the real value when bracketing or using HDR. In these cases, the "shutter" covers all the shots in the bracket, so it will be a lot slower than reality. But zero motion is based on shutter among other things, so it will require the platform to be more steady than needed.

Stop supporting 8-bit AVR (AtMega328)

The effort and code complexity for continuing to support AtMega328 and friends are not worth it and could be better invested elsewhere.

I see no good reason not to move to 32bit platforms. Teensy LC is an Arduino-compatible 32bit ARM board close to the official Arduino Pro Mini price point.

Advantages

  • get rid of PROGMEM hacks for split data/code memory, use const as intended
  • more freedom to choose add-on boards (displays, etc)
  • no more bumping into 2K memory limit (can revisit menu definition)
  • get rid of 16-bit integer problems

Disadvantages

  • some Pro Mini clones are cheap but I'm not trying to save pennies.

Auto Shutter mode (maybe never)

Listen to camera shutter noise (or vibration via accel). This could be useful to adapt to camera settings, but the following would need to be taken into account:

  • both front and end shutters make noise
  • electronic front shutter (only end shutter makes noise)
  • camera profiles
  • long exposure

clean up pano interruption mode

  • next/prev works well
  • need a clean way to continue/end pano
    (right now OK ends and there is no way to continue)
  • should have a clearer display indicating which button does what

Refactor menu system

Menu system definition and operation is confusing.

If we remove the dependency on AVR (#57) and therefore the restricted RAM usage, the menu can be refactored to be easier to define and use. Maybe move HID handling inside menu instead of in the main .ino

360 pano is not continuous

In normal mode, the pano covers exactly as much FOV as requested. But for 360 pano, we need an extra overlap to wrap around, or the pano cannot be made seamless.

Pano log

Record information for each panoramas taken in EEPROM.
Dump the EEPROM over serial when connected to PC, for identifying the photo sets and settings easier.

Backlash compensation

The gigapan unit's vertical backlash is significant at high zoom.
Add backlash compensation with predefined values in pano.h.

A nicer option is backlash autoadjust using the gyro.

Add radio transmitter (opt)

  • All of the display and input work could be offloaded to handheld radio remote device but the system is no longer self-contained.

Fix pano modes setup

Clean up pano options

  • new pano currently needs horiz/vert FOV but configures at start (does not use preset)
  • 360 pano needs vert FOV (it currently uses Vert FOV preset)
  • repeat pano needs nothing (it reuses saved presets)
  • maybe Horiz/Vert FOV are no longer needed in menu ?

Break code into platform module and remote control module

The display and controls are not usable while platform is rotating or is out of reach on a tall pole, which I think are common use cases.

Split the code and hardware into

  • platform module (sensors, motor control, simple status display)
  • remote control module (buttons, joystick, menus display)

The communication between the two can be serial (wired) or radio. The remote can be replaced by phone eventually. May need two boards otherwise.

Release SPI0 pins (10,11,12,13)

Pins 10,11,12,13 on UNO are hardware SPI CS0, MOSI0, MISO0, SCK0.

See if we can move the microstep control (DRV_M0, DRV_M1) and motor enable (MOTORS_ON) elsewhere. 12 is defined as OLED_RESET but not actually connected.

Having builtin motor enabled feedback via LED is nice but should figure out another way.

Reference: https://www.arduino.cc/en/Reference/SPI

Next row position is offset to the left

Each next row starts further to the left compared to previous one, resulting in progressively more space lost at the other end.

This doesn't seem to affect 360 panos (probably because there's no row return there)

Direct current control

Investigate ways to control Aref (and motor current) dynamically. It is currently controlled via a pot on the DRV board. Possibilities include

  • break pot and use DAC + voltage divider
  • use 1-2 digital pins with resistors to drain from divider and create a couple preset intermediary steps by adding resistors in parallel to GND branch of the pot.
  • ?

Need column-first mode

Switch from row-first to column-first might be useful sometimes (360 panos with people)

Real Time Clock

Add an RTC.
Options are:

  • a standalone DS3231 (works with any Arduino), or
  • add a CR16 battery + crystal to the teensy board

Possible uses:

  • display timestamp on pano info screen, so a screenshot can be used to match against photo sets.
  • record panos taken in eeprom, and dump them via serial later.

Need higher shutter speeds

(from field testing)

Shutter speeds faster than 1/100 were initially assumed to be unnecessary, since camera responds to shutter command slower than that and the impact of faster times on total shooting time is negligible.

But shutter is also used in the zero-motion calculation (for acceptable angular velocity), and 1/100 is slow for long focal lengths (300-400-500 etc) so it causes unnecessarily long delays waiting for the platform to stabilize.

Add IR receiver

  • This should work in parallel with joystick
  • how to make use of more keys (cancel would be nice) and still work with joystick ?
  • how to interrupt on receive
  • smooth motor move might not be possible with IR because of the time to read codes

Bluetooth 4.1 support

Same as (or depending on #8) but would need iOS app to control.

Major advantage would be that we can manage many pano profiles and pre-generate stitch files with photos already in position. The pano execution can be GPS-tagged and timestamped and used to identify the photo set once downloaded to the PC. Then we need a tool to preorder the images.

Add manual shutter mode

  • pano moves to next position and waits for input to go next.
    this can be either OK or > as in the interrupted mode (maybe the layout can be shared)

Hanging setting up tall pano with wide lens

Setting up a pano over 180 degrees tall with a wide lens causes the system to hang.

It probably happens with tele lenses too but it's less likely to accidentally get there.

Single-board PanoController example no longer works

Since the split to Executor / Navigator, the single-unit PanoController no longer works.

Not sure if I want to keep it and fix, or just discontinue it. While the self-contained unit does have the set-it-and-forget-it advantage, I think remote control is the way to go.

Standby Mode

Normal (motors off) power consumption is about 15mA.

Standby Mode should

  • turn off motors (drive nSLEEP LOW)
  • turn off display (this is impossible with current wiring) - maybe power display from a high current pin or ?
  • put uC to sleep, wake up via button interrupt

Another way to achieve all this is to use one of these for a little extra cost:
https://www.pololu.com/product/2810 or https://www.pololu.com/product/2808 (Mini Pushbutton Power Switch)

Support 16:9 and 1:1 modes

This can be simply an issue of calculating and adding the right FOV, or we could custom-define FOV via camera in the way that gigapan does (but is not great because it needs changing with zoom)

PCB board

  • design a smaller pano platform using the 0.5A steppers or servos, and integrated MPU into carrier.

Goals:

  • more portable: lighter, smaller)
  • thin profile: less nadir problems)
  • more battery life

Determine gear ratio using gyro

The gyro can be used to determine the gear ratio. This is probably not very useful unless somehow we can change gears easily.

Increase movement precision

  1. Currently platform movement precision is limited by reduction ratio. We need more precision.
  2. The FOV angles are stored as integers, which for longer lenses is imprecise (3 instead of 3.48, etc)

Switch the movement calculation code to floats entirely. Should be ok even with Arduino, it only adds <1K to the code.

Add a start delay

Need a start delay so the platform doesn't try to move while we're still pushing the OK button. This of course would not be needed with the remote.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.