Controlling the Merlin/Orion with Arduino  

Everything you need to motorize your head
no avatar
GuzZzt
Member
 
Topic author
Posts: 30
Likes: 0 post
Liked in: 0 post
Joined: Mon Jun 29, 2009 11:17 am
Location: Borås, Sweden
Info

Controlling the Merlin/Orion with Arduino

by GuzZzt » Mon Jun 29, 2009 11:26 am

I’m working on a panoramic head but I will control it by the Ardunio processor platform and not with Papywizard. I have ordered the Merlin/Orion mount but I have not received it jet (I will probably get it later this week) but I’m wondering if someone have any good suggestions on the electronics needed to connect the Arduino to the Merlin/Orion head. My idea was to replace the “remote control” with my Arduino. I have read the stuff on the autopano.net wiki but Google translate is not very good and I don’t speak French.

I have seen this image: http://www.autopano.net/wiki-fr/action/view/Image:Merlin-interface-bus-serie-schematic1.png. It looks like I should be able to connect the Arduino instead on the MAX232 unit. It saiys that the transistors are not necessary. Can someone explain a little more why you have them and what alternative you have without the transistors?

I’m planning on presenting the project online with all hardware/software as soon as I have something up and running.

Any help is greatly appreciated!

User avatar
fma38
Moderator
 
Posts: 5850
Likes: 2 posts
Liked in: 2 posts
Joined: Wed Dec 07, 2005 6:21 pm
Location: Grenoble, France
Info

by fma38 » Mon Jun 29, 2009 11:36 am

This is a very nice project!

Controlling the Merin/Orion through the TTL serial line is very easy. The internal controller uses only 1 line, connected to both RD and TX of both micro-controllers (PIC16Fxxx or something).

So, as for the TTL-RS232 or TTL-BT converters, you just need to wire the RD and TX signals of your Arduino to this line, through 2x 220 Ohm resistors (if these RD/TX signals are TTL; don't connect to RS-232 levels!). From the Arduino point of view, you read/write on your serial line as usual; you just have to think that the transmission is half-duplex: once you have written a command, you have to wait for the head answer.

You will find the Merlin/Orion protocol there:

http://www.papywizard.org/wiki/DevelopGuide#MerlinOrionprotocole

Hope this helps.
Frédéric

no avatar
GuzZzt
Member
 
Topic author
Posts: 30
Likes: 0 post
Liked in: 0 post
Joined: Mon Jun 29, 2009 11:17 am
Location: Borås, Sweden
Info

by GuzZzt » Mon Jun 29, 2009 12:08 pm

I’m not sure I fully get it. Do you mean something like this?

Arduino Port tx <---> [220 ohm]
}<---> Merlin/Orion data port.
Arduino Port rx <---> [220 ohm]

If it is just one port shouldn’t I be able to use one port on Arduino as well, and just change input/output when I want to read/write?
Arduino Port tx <---> [220 ohm] <---> Merlin/Orion data port.
Last edited by GuzZzt on Mon Jun 29, 2009 12:09 pm, edited 1 time in total.

User avatar
fma38
Moderator
 
Posts: 5850
Likes: 2 posts
Liked in: 2 posts
Joined: Wed Dec 07, 2005 6:21 pm
Location: Grenoble, France
Info

by fma38 » Mon Jun 29, 2009 12:16 pm

Yes, the wiring is that one.

I'm not sure you will be able to use only one pin: once you have send all the datas for a command, you will have to switch your line in input mode; doing this, you may miss datas from the head. And you will also have to implement the serial timing on a standard IO pin (9600-8-N-1); I think using the dedicated serial port of the Arduino is muuuuch more simple.
Frédéric

no avatar
GuzZzt
Member
 
Topic author
Posts: 30
Likes: 0 post
Liked in: 0 post
Joined: Mon Jun 29, 2009 11:17 am
Location: Borås, Sweden
Info

by GuzZzt » Wed Aug 05, 2009 11:27 am

I have now finally got my Merlin mount and I did a first communication test with it last night and it was a success! Thanks for the help on how to connect it. Now I will go on and setup all the commands I need.

User avatar
fma38
Moderator
 
Posts: 5850
Likes: 2 posts
Liked in: 2 posts
Joined: Wed Dec 07, 2005 6:21 pm
Location: Grenoble, France
Info

by fma38 » Wed Aug 05, 2009 1:18 pm

Good! Can you tell us what you plan to do? I'm interested to have a small controller with pre-defined presets, for full-spherical panos, for example...

I have an Arduino board too, so I can make some tests with your firmeware if you publish it from time to time...
Frédéric

no avatar
GuzZzt
Member
 
Topic author
Posts: 30
Likes: 0 post
Liked in: 0 post
Joined: Mon Jun 29, 2009 11:17 am
Location: Borås, Sweden
Info

by GuzZzt » Wed Aug 05, 2009 7:28 pm

My plan is to make a full featured Gigapixel rig. It will have a LCD display and a small joystick to set start,stop/corner positions and then be able to take all the photos.

I will publish everything as soon as I have a first version up and running (hopfully in a few days).

User avatar
Paul
Member
 
Posts: 778
Likes: 0 post
Liked in: 0 post
Joined: Sat Aug 30, 2008 4:46 pm
Location: Bonn, Germany
Info

by Paul » Wed Aug 05, 2009 7:41 pm

Hi Guzzzt,
a WII Nunchuk is a nice gadget to set positions via joystick, it is easy to combine with an arduino

code you can find on arduino playground "input devices"

or a lcd with joystick look under news in the arduino forum: Low-cost graphic Nokia 3310 LCD shield & Joystick
Last edited by Paul on Wed Aug 05, 2009 7:43 pm, edited 1 time in total.
Paul

close, but no cigar ... ... ...

no avatar
GuzZzt
Member
 
Topic author
Posts: 30
Likes: 0 post
Liked in: 0 post
Joined: Mon Jun 29, 2009 11:17 am
Location: Borås, Sweden
Info

by GuzZzt » Wed Aug 05, 2009 7:48 pm

Thanks for the tips but the LCD and Joystick parts are already finished. I use a simple little joystick and a 128x64 graphical display. I had to do something while I waited for the Merlin mount to arrive...

User avatar
klausesser
Member
 
Posts: 8836
Likes: 5 posts
Liked in: 64 posts
Joined: Mon May 22, 2006 12:18 am
Location: Duesseldorf, Germany
Info

by klausesser » Sun Aug 09, 2009 12:52 pm

GuzZzt wrote:I had to do something while I waited for the Merlin mount to arrive...

You also could have worked over your web-site . . . nice text on it . . ;):P
(i know the problem . . . :cool:)

best, Klaus

P.S.: a complete rig of head and controller would be interesting!
Simplicity is the keynote of all true elegance. Coco Chanel

no avatar
GuzZzt
Member
 
Topic author
Posts: 30
Likes: 0 post
Liked in: 0 post
Joined: Mon Jun 29, 2009 11:17 am
Location: Borås, Sweden
Info

by GuzZzt » Sat Aug 15, 2009 4:27 pm

The build is now finished! It is raing outside so I can't go out and test it just jet :( but I will as soonas it stops.

I will write a full description and release the code etc. but here is two photos of it to start with.
Image

Image

no avatar
GuzZzt
Member
 
Topic author
Posts: 30
Likes: 0 post
Liked in: 0 post
Joined: Mon Jun 29, 2009 11:17 am
Location: Borås, Sweden
Info

by GuzZzt » Sat Aug 15, 2009 4:44 pm

And here is a comparison photo so you can see the size of it compared to the Merlin/Orion mount.

Image

User avatar
fma38
Moderator
 
Posts: 5850
Likes: 2 posts
Liked in: 2 posts
Joined: Wed Dec 07, 2005 6:21 pm
Location: Grenoble, France
Info

by fma38 » Sat Aug 15, 2009 10:41 pm

That's a big box!
Frédéric

no avatar
GuzZzt
Member
 
Topic author
Posts: 30
Likes: 0 post
Liked in: 0 post
Joined: Mon Jun 29, 2009 11:17 am
Location: Borås, Sweden
Info

by GuzZzt » Sat Aug 15, 2009 10:57 pm

Yes, I know. A designed PCB with both the Arduino and the rest of the electronics plus smaller buttons or a toutch screen would make it a lot smaller. But now I know that it is possible to get it to work and I can start to take shots with it.

no avatar
Gordon
Member
 
Posts: 357
Likes: 0 post
Liked in: 0 post
Joined: Wed Oct 08, 2008 12:18 pm
Location: Deep in the woods, UK
Info

by Gordon » Sun Aug 16, 2009 12:03 am

Cool Arduino project, I like the 80's retro Video Game controller look, was that intentional :D
Just now wondering how easy you found it to build.

Best
Gordon
2000th Member :D

GigaPixel Experimenter
Gigapan Beta Unit, Canon Powershot S5IS, Canon 350D, Nikon D40, Manfrotto Tripod, BT-Serial + Papywizard on Nokia 770, Fully-Operational Merlin the Wizard Unit!!!

no avatar
GuzZzt
Member
 
Topic author
Posts: 30
Likes: 0 post
Liked in: 0 post
Joined: Mon Jun 29, 2009 11:17 am
Location: Borås, Sweden
Info

by GuzZzt » Sun Aug 16, 2009 8:15 am

I guess the retro look was a little bit accidental, but I like how it ended up :)

The project was suprisingly easy to implement. But in reality is it just down to three parts. 1. A display and others have already done nice libs for this. 2. Buttons, I used a shift register to shift it in but that is also easy with the arduino. 3. Communication with Merlin mount. fma38 and the other Papywizard developers have already done the hard work here on how to talk to the Merlin mount so it was just to convert it to Arduino code.

no avatar
GuzZzt
Member
 
Topic author
Posts: 30
Likes: 0 post
Liked in: 0 post
Joined: Mon Jun 29, 2009 11:17 am
Location: Borås, Sweden
Info

by GuzZzt » Mon Aug 24, 2009 7:53 pm

And here is my first panorma taken with the mount.
http://www.gigapixel.nu/photo.php?id=1

It took me 33 minutes to take the 312 photos. Is that a long time compared to Papywizard?

User avatar
Paul
Member
 
Posts: 778
Likes: 0 post
Liked in: 0 post
Joined: Sat Aug 30, 2008 4:46 pm
Location: Bonn, Germany
Info

by Paul » Mon Aug 24, 2009 8:39 pm

GuzZzt wrote:It took me 33 minutes to take the 312 photos. Is that a long time compared to Papywizard?

No thats quite a good value.

May you share your Arduino code? I have an Arduino with LCD shield and want to give it a try ...
Paul

close, but no cigar ... ... ...

no avatar
GuzZzt
Member
 
Topic author
Posts: 30
Likes: 0 post
Liked in: 0 post
Joined: Mon Jun 29, 2009 11:17 am
Location: Borås, Sweden
Info

by GuzZzt » Mon Aug 24, 2009 8:52 pm

Yes, I will publish the code, I will just add some comment and description to it first.

User avatar
Paul
Member
 
Posts: 778
Likes: 0 post
Liked in: 0 post
Joined: Sat Aug 30, 2008 4:46 pm
Location: Bonn, Germany
Info

by Paul » Mon Aug 24, 2009 9:09 pm

thanks, so I will wait for it ...
Paul

close, but no cigar ... ... ...

no avatar
GuzZzt
Member
 
Topic author
Posts: 30
Likes: 0 post
Liked in: 0 post
Joined: Mon Jun 29, 2009 11:17 am
Location: Borås, Sweden
Info

by GuzZzt » Sun Aug 30, 2009 6:42 pm

And now is the project online as well. You can download the source code for both the project and for the Merlin mount Arduino library.

http://www.gigapixel.nu/info_project.php

User avatar
fma38
Moderator
 
Posts: 5850
Likes: 2 posts
Liked in: 2 posts
Joined: Wed Dec 07, 2005 6:21 pm
Location: Grenoble, France
Info

by fma38 » Sun Aug 30, 2009 8:57 pm

Thanks! I'll put a link in Papywizard main site.
Frédéric

no avatar
gloob
Member
 
Posts: 31
Likes: 0 post
Liked in: 0 post
Joined: Fri Feb 18, 2011 9:19 am
Location: Germany
Info

by gloob » Sun Feb 27, 2011 12:38 pm

Did anyone get the Example from GuzZzt running?

I downloaded the files from his website but if i try to compile just the sample I get the following error and don't know what to do:

MerlinExample.cpp: In function 'void setup()':
MerlinExample:11: error: 'Serial' was not declared in this scope

It would be cool if somebody could help me. If the merlin is running with my arduino uno i will write a howto for the others.

Thanks
Stefan

no avatar
Briger
Member
 
Posts: 64
Likes: 0 post
Liked in: 0 post
Joined: Mon May 04, 2009 4:42 pm
Location: Switzerland
Info

by Briger » Sun Feb 27, 2011 3:02 pm

Strange i dont remember this Error i have a lot other Problems before and after but not this. :-) I have freez my work on arduino for a little time after he has blow up. My fault, not from the Code. :-)
D800, D300, D80, Seitz Roundshot VR2, Nodal Ninja5 RD16, Nikkor 10,5, Nikkor 24-70, Nikkor 70-200, Sigma 150-500, Nikkor 105VR, ....

no avatar
gloob
Member
 
Posts: 31
Likes: 0 post
Liked in: 0 post
Joined: Fri Feb 18, 2011 9:19 am
Location: Germany
Info

by gloob » Sun Feb 27, 2011 3:11 pm

At the moment I don't have a Merlin but I'm already testing with my Arduino.

After adding the following line:

#include <avr/pgmspace.h>

Which I found in the MX2 Project I could compile the project and upload it to my Arduino.

This is my testprogramm at the moment:

#include <avr/pgmspace.h>
#include <EEPROM.h>
#include <LiquidCrystal.h>
#include <merlin_mount.h>

// define the camera pins
#define CAMERA_PIN 8
#define FOCUS_PIN 12
#define STATUS_PIN 10

// setup action (run once the arduino is started)
void setup() {

// set the pin modes (OUTPUT or INPUT)
pinMode(CAMERA_PIN, OUTPUT);
pinMode(FOCUS_PIN, OUTPUT);
pinMode(STATUS_PIN, OUTPUT);

// initialise the serial interface
Serial.begin(9600);

// initialise the communication to the merlin
merlin.init();

// set the status led to high
digitalWrite(STATUS_PIN, HIGH);
}


// loop for ever (programm the arduino is running)
void loop() {

long pos_pitch = 0;
long pos_yaw = 0;

delay(5000);
// start to move downward
merlin.startMoving(AXIS_PITCH, DIR_DOWN);
delay(5000);

// start to move left as well
merlin.startMoving(AXIS_PITCH, DIR_LEFT);
delay(5000);

// stop continues moving
merlin.stopMoving(AXIS_YAW);
merlin.stopMoving(AXIS_PITCH);

// read current position
pos_pitch = merlin.readAxisPosition(AXIS_PITCH);
pos_yaw = merlin.readAxisPosition(AXIS_YAW);

// set the new yaw + 20 degree
pos_yaw = pos_yaw + merlin.fromAngle(20.0);

// move 20 degrees in yaw
merlin.driveToPositionBothAxis(pos_yaw, pos_pitch, SYNC_SYNCHRONY);

// do nothing anymore
while(1){
delay(5000);
}

}

Maybe it's a problem with the new Arduino version. I'm using an Arduino Uno and Arduino 0022 software.
Last edited by gloob on Sun Feb 27, 2011 3:12 pm, edited 1 time in total.

Next

Who is online

Users browsing this forum: No registered users and 3 guests