You are not logged in.



#1 2009-06-29 12:26:33

GuzZzt
Member
From: Borås, Sweden
Registered: 2009-06-29
Posts: 30
Website

Controlling the Merlin/Orion with Arduino

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/ … atic1.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!

Offline

 

#2 2009-06-29 12:36:26

fma38
Moderator
From: Grenoble, France
Registered: 2005-12-07
Posts: 6028
Website

Re: Controlling the Merlin/Orion with Arduino

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/DevelopG … nprotocole

Hope this helps.


Frédéric

Canon 20D + 17-40/f4 L USM + 70-200/f4 L USM + 50/f1.4 USM + Tokina 10-17 3.5-4.5 AF DX Fisheye
Merlin/Orion panohead + Papywizard on Nokia N800 and HP TC-1100

Offline

 

#3 2009-06-29 13:08:17

GuzZzt
Member
From: Borås, Sweden
Registered: 2009-06-29
Posts: 30
Website

Re: Controlling the Merlin/Orion with Arduino

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 (2009-06-29 13:09:19)

Offline

 

#4 2009-06-29 13:16:11

fma38
Moderator
From: Grenoble, France
Registered: 2005-12-07
Posts: 6028
Website

Re: Controlling the Merlin/Orion with Arduino

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

Canon 20D + 17-40/f4 L USM + 70-200/f4 L USM + 50/f1.4 USM + Tokina 10-17 3.5-4.5 AF DX Fisheye
Merlin/Orion panohead + Papywizard on Nokia N800 and HP TC-1100

Offline

 

#5 2009-08-05 12:27:40

GuzZzt
Member
From: Borås, Sweden
Registered: 2009-06-29
Posts: 30
Website

Re: Controlling the Merlin/Orion with Arduino

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.

Offline

 

#6 2009-08-05 14:18:33

fma38
Moderator
From: Grenoble, France
Registered: 2005-12-07
Posts: 6028
Website

Re: Controlling the Merlin/Orion with Arduino

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

Canon 20D + 17-40/f4 L USM + 70-200/f4 L USM + 50/f1.4 USM + Tokina 10-17 3.5-4.5 AF DX Fisheye
Merlin/Orion panohead + Papywizard on Nokia N800 and HP TC-1100

Offline

 

#7 2009-08-05 20:28:38

GuzZzt
Member
From: Borås, Sweden
Registered: 2009-06-29
Posts: 30
Website

Re: Controlling the Merlin/Orion with Arduino

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).

Offline

 

#8 2009-08-05 20:41:20

Paul
Member
From: Bonn, Germany
Registered: 2008-08-30
Posts: 846

Re: Controlling the Merlin/Orion with Arduino

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 (2009-08-05 20:43:53)


Paul

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

Offline

 

#9 2009-08-05 20:48:43

GuzZzt
Member
From: Borås, Sweden
Registered: 2009-06-29
Posts: 30
Website

Re: Controlling the Merlin/Orion with Arduino

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...

Offline

 

#10 2009-08-09 13:52:54

klausesser
Member
From: Düsseldorf, Germany
Registered: 2006-05-22
Posts: 4137
Website

Re: Controlling the Merlin/Orion with Arduino

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 . . winktongue
(i know the problem . . . cool)

best, Klaus

P.S.: a complete rig of head and controller would be interesting!


If you're going to tell people the truth, be funny or they'll kill you. - Billy Wilder

Offline

 

#11 2009-08-15 17:27:58

GuzZzt
Member
From: Borås, Sweden
Registered: 2009-06-29
Posts: 30
Website

Re: Controlling the Merlin/Orion with Arduino

The build is now finished! It is raing outside so I can't go out and test it just jet sad 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.
http://farm3.static.flickr.com/2628/3822749913_5b29ac9361.jpg

http://farm4.static.flickr.com/3502/3822749485_f798b893b4_b.jpg

Offline

 

#12 2009-08-15 17:44:24

GuzZzt
Member
From: Borås, Sweden
Registered: 2009-06-29
Posts: 30
Website

Re: Controlling the Merlin/Orion with Arduino

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

http://farm3.static.flickr.com/2574/3822803705_1f88262ec0.jpg

Offline

 

#13 2009-08-15 23:41:43

fma38
Moderator
From: Grenoble, France
Registered: 2005-12-07
Posts: 6028
Website

Re: Controlling the Merlin/Orion with Arduino

That's a big box!


Frédéric

Canon 20D + 17-40/f4 L USM + 70-200/f4 L USM + 50/f1.4 USM + Tokina 10-17 3.5-4.5 AF DX Fisheye
Merlin/Orion panohead + Papywizard on Nokia N800 and HP TC-1100

Offline

 

#14 2009-08-15 23:57:19

GuzZzt
Member
From: Borås, Sweden
Registered: 2009-06-29
Posts: 30
Website

Re: Controlling the Merlin/Orion with Arduino

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.

Offline

 

#15 2009-08-16 01:03:04

Gordon
Member
From: Deep in the woods, UK
Registered: 2008-10-08
Posts: 405

Re: Controlling the Merlin/Orion with Arduino

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

Best
Gordon


2000th Member big_smile

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!!!

Offline

 

#16 2009-08-16 09:15:58

GuzZzt
Member
From: Borås, Sweden
Registered: 2009-06-29
Posts: 30
Website

Re: Controlling the Merlin/Orion with Arduino

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

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.

Offline

 

#17 2009-08-24 20:53:50

GuzZzt
Member
From: Borås, Sweden
Registered: 2009-06-29
Posts: 30
Website

Re: Controlling the Merlin/Orion with Arduino

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?

Offline

 

#18 2009-08-24 21:39:53

Paul
Member
From: Bonn, Germany
Registered: 2008-08-30
Posts: 846

Re: Controlling the Merlin/Orion with Arduino

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 ... ... ...

Offline

 

#19 2009-08-24 21:52:59

GuzZzt
Member
From: Borås, Sweden
Registered: 2009-06-29
Posts: 30
Website

Re: Controlling the Merlin/Orion with Arduino

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

Offline

 

#20 2009-08-24 22:09:27

Paul
Member
From: Bonn, Germany
Registered: 2008-08-30
Posts: 846

Re: Controlling the Merlin/Orion with Arduino

thanks, so I will wait for it ...


Paul

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

Offline

 

#21 2009-08-30 19:42:19

GuzZzt
Member
From: Borås, Sweden
Registered: 2009-06-29
Posts: 30
Website

Re: Controlling the Merlin/Orion with Arduino

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

Offline

 

#22 2009-08-30 21:57:08

fma38
Moderator
From: Grenoble, France
Registered: 2005-12-07
Posts: 6028
Website

Re: Controlling the Merlin/Orion with Arduino

Thanks! I'll put a link in Papywizard main site.


Frédéric

Canon 20D + 17-40/f4 L USM + 70-200/f4 L USM + 50/f1.4 USM + Tokina 10-17 3.5-4.5 AF DX Fisheye
Merlin/Orion panohead + Papywizard on Nokia N800 and HP TC-1100

Offline

 

#23 2011-02-27 12:38:28

gloob
Member
From: Germany
Registered: 2011-02-18
Posts: 31
Website

Re: Controlling the Merlin/Orion with Arduino

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

Offline

 

#24 2011-02-27 15:02:41

Briger
Member
From: Switzerland
Registered: 2009-05-04
Posts: 37

Re: Controlling the Merlin/Orion with Arduino

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. :-)

Offline

 

#25 2011-02-27 15:11:07

gloob
Member
From: Germany
Registered: 2011-02-18
Posts: 31
Website

Re: Controlling the Merlin/Orion with Arduino

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 (2011-02-27 15:12:31)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson