You are not logged in.



#1 2010-04-11 13:54:49

Greg Nuspel
Member
From: Calgary, Alberta, Canada
Registered: 2009-10-06
Posts: 169

Papywizard and OpenMoco

The latest communication protocols for OpenMoco have been published. I think it should be a good match for Papywizard. The documentation is here http://openmoco.org/node/140

Can you write a plug-in for OpenMoco?


--Greg Nuspel

Offline

 

#2 2010-04-11 14:35:18

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

Re: Papywizard and OpenMoco

I don't have much time, these days. It would help if you could extract the usefull commands:

- start moving in a specific direction (at a given speed?)
- goto a specific position
- stop moving
- read position
- read status (moving/not moving)
- trigger the shutter

The communication should be asynchrone: Papywizard sends a command, the controller answer immediatly. For a goto position, Papywizard then polls the controller to know if the command is completed. Both axis should be independent.

Thanks.


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 2010-04-11 17:17:48

shutterdrone
Member
Registered: 2010-02-16
Posts: 15

Re: Papywizard and OpenMoco

Alas, it is slightly different than the systems you've been working with, but some of the compromises may be highly useful for you.

Unfortunately, motor move commands are synchronous.  You say to move a thousand steps, and the response tells you when it's done.  The vast majority of other commands (including expose camera) are asynchronous, and you can query their status while running.  edit: I can make the command non-blocking, but since the device is single-threaded, and not using interrupts for stepper movement, it would simply block the next command, else engine timing would be completely off.

One of the primary differences between OpenMoco and some of the other 'controllers' out there, is that it's a full scripting engine.  You don't actually have to monitor, and time everything yourself.  You can set parameters once, tell it to start, and then come back and check on them.  This is especially useful in timelapse shooting, as you can completely disconnect your computer/PDA, and then come back later and see how far along you've gotten.  Additionally, it supports pre-recorded actions and keyframes to call them.

An entire pano sequence could easily be scripted such that you enter the parameters, tell it to start, and then its done.  (Using a vertical movement between shot cycles to make the rows, the repeat shot setting equivalent to the number of columns you want to shoot, a movement action between each repeated shot, and a direction action upon completion of repeat shot cycle to reverse direction for the next row. Set the max shots to be number of rows, then tell it to start.) 

All four axes are "independent", if by that you mean, they should have separate commands, parameters, status, etc.

I'd be happy to discuss some use-cases with you, and talk about how to achieve them, and help you put together the commands.  If you just want to do "manual" control of the engine, everything related to that is listed right here: http://openmoco.org/node/142  (there aren't many manual commands).

I'm the author, btw, and would be glad to make any changes (it's fully open-source) you'd like - but it will be some time before the motor movement for steppers is non-blocking, as that's a complete re-write of the motor control code sad

!c

Last edited by shutterdrone (2010-04-11 17:19:11)

Offline

 

#4 2010-04-11 20:10:06

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

Re: Papywizard and OpenMoco

Ok, I think it will require a different way to write the plugin. As I said, I don't have enough time now, so I will put this on my todo list...


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 2010-04-12 19:49:52

shutterdrone
Member
Registered: 2010-02-16
Posts: 15

Re: Papywizard and OpenMoco

fma38 wrote:

Ok, I think it will require a different way to write the plugin. As I said, I don't have enough time now, so I will put this on my todo list...

Understood - it takes time to get through those to-do's (I remind people of that sometimes myself smile

To give an idea of how scripting works with it, I created a workflow example:  here's something I was playing around with yesterday, using the "Slim" script interface (which just basically converts all serial api commands into human read-able commands and allows one to enter them at a prompt - I use it for testing and 'advanced' scripting...)

This set of commands fully automates a 10x10 sequence image sequence (assuming 1000 steps movement between each), by shooting each column, and then moving on to the next row.  Each column alternates, so that it ends at the top of one, and moves to the bottom on the next to avoid wasted moves, it moves over one column after completing the current one:

Code:

 # set direction for motor axes (0= pan, 1= tilt)
motor 0 dir 1
motor 1 dir 1
 # create action id1 to move axis 1 1000 steps, in current direction
action motor 1 move 1000 1 3
 # action to move motor axis 0 in fixed direction 
action motor 2 move 1000 0 1
 # action to invert the direction of axis 1 (tilt)
action motor 3 set_dir 0 1 2
 # enable camera
camera on
 # set 72ms for camera exp trigger
camera exposure 72
 # wait 25 ms before moving motors.. actual exp time is 1/1000 on camera
camera post 25
 # set 10 shots per column
camera repeat 10
 # move motor 1 between repeat (column) shots
camera rep_act 0 1
 # call actions to invert direction of tilt and move to next column
 # when the current column has completed
camera rep_com 0 2
camera rep_com 0 3
 # limit to 10 columns (repeat sets 10 rows per column)
camera shots 10
start

That's it - it shoots the whole cycle fairly rapidly, automated, and then stops.  One can query the current shot, motor distances moved, whether camera is currently exposing, program still running, etc. while this is going on.  14 total serial commands sent (about 100 bytes total) to do the whole 10x10 shot.  Up to 255x255 (well, actually millions x 255) panos can be triggered with the same 100 bytes.  There are about a dozen other ways to do the same, but I think this is the most succinct and obvious way off the top of my head.

!c

Last edited by shutterdrone (2010-04-12 19:56:32)

Offline

 

#6 2010-04-13 09:04:08

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

Re: Papywizard and OpenMoco

As the openmoco goal is to have an autonomous head, I'm wondering if the best solution is not to write a script generator web service, as Jones did with several kinds of presets for Papywizard?


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 2010-04-13 16:37:55

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

Re: Papywizard and OpenMoco

Hmm that makes me ask can a script generator be included into Papywizard? this would be useful when using differing lens and bodies whilst shooting.

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

 

#8 2010-04-13 17:45:15

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

Re: Papywizard and OpenMoco

All jones generators can be executed locally on aby browser; I'm pretty sure they work on a Nokia. Then, the only thing to do, is a little uploader. How does the openmoco firmware communicate with the host?


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

 

#9 2010-04-13 20:55:57

shutterdrone
Member
Registered: 2010-02-16
Posts: 15

Re: Papywizard and OpenMoco

fma38 wrote:

All jones generators can be executed locally on aby browser; I'm pretty sure they work on a Nokia. Then, the only thing to do, is a little uploader. How does the openmoco firmware communicate with the host?

The host sends binary serial commands, and reads the responses. Depending on which Arduino you use, the interface will either be straight Serial, USB->Serial, or Wireless.  All you have to do is make a serial link, and start pumping commands at it.

The engine runs on any 328p-based Arduino (code size will outgrow the 128 chipset within a release or so, and RAM usage already exceeds 128's abilities), so the ways one can make a link are pretty numerous, but the important part about the serial protocol is that it is binary, and expects big-endian data.  So, if you send an unsigned int (16bits in the arduino-world), you would send two bytes: MSB,LSB.  This can be problematic from the client end until one realizes that if some of the commands were expressed as ASCII, they could be up to hundreds of bytes long, and no existing serial command supported requires more than 9 data bytes right now, so the longest stream is 11bytes. (Command+DLB+Data)

!c

Offline

 

#10 2010-04-13 22:45:45

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

Re: Papywizard and OpenMoco

Ok. So do you think a simple web-based interface could do the trick? One can imagine making a very simple web server (python build-in modules provide such server classes) to do the uploading part, in response to the web interface command...


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

 

#11 2010-04-13 23:55:44

shutterdrone
Member
Registered: 2010-02-16
Posts: 15

Re: Papywizard and OpenMoco

It should be totally do-able in that way.  If you can also load perl code, there's already an API with every capability mapped to a method, and does all the binary building/communicating with the engine for you.  The OpenMoco::Interface::TimeLapse module is pretty simple to use. I'm not terribly familiar with python, but as I understand, it uses a similar pack methodology to perl for building binary strings.  If one wanted to re-implement in python, could just convert the existing pack templates.

In fact, I like that way quite a bit (webserver) - it's efficient, light-weight, and easy to implement. smile

!c

Offline

 

#12 2010-04-14 08:56:17

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

Re: Papywizard and OpenMoco

Can you point me on that Perl module?


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

 

#13 2010-04-14 09:38:13

claudevh
Moderator
From: Mont-Saint-André (Belgium)
Registered: 2007-11-25
Posts: 1301
Website

Re: Papywizard and OpenMoco

Hello Frederic,

I presume that "shutterdrone" speak about "OpenMoco Slim" the user interface:

http://openmoco.org/node/99

Here is also the global link to all the software for OpenMoco:

http://openmoco.org/node/12

All the job done by "shutterdrone" is fantastic and make me think about a "certain" FMA38 lol


cool Claude cool
Merlin + Papywizard on Windows 7 & Nokia 770 § N810 & Acer (Netbook) + PanoramaApp Androïd + Deltawave PapyMerlin BT + Autopano
Spherical Pano (180 x 360) with Canon 40D + Canon EF-S 10-22mm f/3.5-4.5 Zoom & Pôle Pano with Canon 5D MK2 and shaved Tokina 10-17 3.5-4.5 AF DX Fisheye
Gigapixel photography with Nikon D200 + Sigma 70-200 F 2.8 EX DG APO HSM

Offline

 

#14 2010-04-15 06:04:44

shutterdrone
Member
Registered: 2010-02-16
Posts: 15

Re: Papywizard and OpenMoco

I just uploaded new zips for the latest version of everything - so no need to muck with SVN.  This version, 0.82, is 'released.'

Here's the direct download page for the perl module: http://openmoco.org/node/27  -- I haven't updated the doc on the website yet, but if you just install the module and then type 'perldoc OpenMoco::Interface::Timelapse' you'll get full up-to-date docs on the perl API.  I'll have the new docs on the website for Slim and the perl API in the next few days.

Thanks for the good words Claude smile

If you guys want anything added, let me know - always happy to make it more useful.

!c

Offline

 

#15 2010-04-15 06:07:29

milapse
New member
Registered: 2010-02-16
Posts: 4

Re: Papywizard and OpenMoco

This is the best thing since peanut butter and jelly sandwiches! (and believe me I don't say that every day...)

Offline

 

#16 2010-04-16 17:12:05

shutterdrone
Member
Registered: 2010-02-16
Posts: 15

Re: Papywizard and OpenMoco

... if y'all still want to do your standard control mechanism, I started working on the asynchronous stepper control last night, and I have a path to do it without (hopefully) too many problems in integrating it with the program state logic.

A quick question though: do you guys normally do multiple motor axes async control at once, or do you do single motor axis at a time?  It's important as managing velocity ramps across more than one motor at a time asynchronously greatly increases the complexity and slows down the speed at which I can run them.  Whereas only allowing one motor to move at a time (async) simplifies the code and increases the rate at which I can drive the motors - unless, of course, they're both going the exact same distance smile  During some tests last night I was able to drive two steppers, with a configurable velocity, simultaneously at 10kHz using completely non-optimized async control code, which means I should be able to well exceed this in the final implementation.

!c

Offline

 

#17 2010-04-16 17:39:42

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

Re: Papywizard and OpenMoco

Well, it depends; in preset mode, it is usefull to drive both axis at the same time. But in mosaic, only one axis generaly moves at a 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

 

#18 2010-04-20 04:21:42

sjhenry
Member
From: Colorado, USA
Registered: 2009-03-10
Posts: 148
Website

Re: Papywizard and OpenMoco

If I understand it correctly the OpenMoco is like a firmware to control the servo motor. Then Papywizard can be a very good client provided a good plugin is developed. It is also possible to write a script generator to output the necessary instruction (like the one shown above) that can be fed to a Perl module etc.

As far as the preset generators, it can be bundled with the Papywizard itself. I don't see any problem in that. The main intent is to use it with Papywizard in the field and generate any preset needed.

Jones

Offline

 

#19 2010-04-20 04:33:14

Greg Nuspel
Member
From: Calgary, Alberta, Canada
Registered: 2009-10-06
Posts: 169

Re: Papywizard and OpenMoco

It would be very useful to have a script generator for now until a driver is written for Papywizard. For VR photos it would be easy to have pre-written scripts for OpenMoco but when you get into gigapixel panoramic shots a script generator would be very handy. Then we'll get into the timelapse stuff and that can get very complex to move the camera on a boom/trolley while panning to keep an object as the center of rotation in the image.


--Greg Nuspel

Offline

 

#20 2010-04-20 05:59:47

sjhenry
Member
From: Colorado, USA
Registered: 2009-03-10
Posts: 148
Website

Re: Papywizard and OpenMoco

Greg,

Let me take a look at the OpenMoco pages linked here. I'll post if I have any questions.

Jones

Offline

 

#21 2010-04-20 16:23:05

shutterdrone
Member
Registered: 2010-02-16
Posts: 15

Re: Papywizard and OpenMoco

Jones,

Just one correction - right now it only works with stepper motors, not servos.  Servos, DC motors, etc. will be selectable in the not-so-distant future smile  The firmware can either be used to do interactive control of up to 4 axes of motion and a camera, or can be used as a scripting engine, and run in an 'autonomous' mode to fulfill your desire after being setup.  The more 'autonomous' mode makes it very easy to do complex shots, but the 'interactive' mode can be more easy to integrate with to start with.

Greg,

It's funny that you mention object tracking - Matthias had posted a video where he did that using his dolly+pan+tilt using 0.81.  Here's that video: http://www.vimeo.com/11016934

I think he did it the hard way (I've seen his windows GUI, and I don't recall a special set of functions to calculate such moves for you), and simply calculated the relative speed for the pan vs. the output speed for the dolly.

!chris

Last edited by shutterdrone (2010-04-20 16:25:25)

Offline

 

#22 2010-04-21 04:06:54

sjhenry
Member
From: Colorado, USA
Registered: 2009-03-10
Posts: 148
Website

Re: Papywizard and OpenMoco

Chris,

Thanks for clarifying what type of motors currently supported by the OpenMoco. I checked the slim interface commands mentioned http://openmoco.org/node/99 and the motor commands at http://openmoco.org/node/142. All of the commands are dealing with the number of steps. I assume this firmware is to drive different types of steppers as well. What I am not to find is that the number of counts to cover the 360 degrees or a single degree. At least this information is needed for the pan, tilt directions so that the head can be moved precisely by the steps. Also this information is needed for the panorama due to different focal length resulting in different field of view in degrees. The current architecture will work only for the linear movement where you do not need to know how far you can move the motor until you hit some physical limitation.

I think there should be a generic command to figure out the degrees per step or steps per degree. Without this information, it is not possible to move the motor independent of motor used or motor plus any step up or step down gears used. If this information already exists, please point to me as well.

Jones

Offline

 

#23 2010-04-21 06:18:57

Greg Nuspel
Member
From: Calgary, Alberta, Canada
Registered: 2009-10-06
Posts: 169

Re: Papywizard and OpenMoco

I think it would be best if the number of steps per 360 could be a field you fill in since there are many different variations. My system has 18000 steps if using full stepping but I can also increase that if I use micro-stepping. I think Chris is using 20000 steps at full stepping right now.


--Greg Nuspel

Offline

 

#24 2010-04-21 17:48:39

shutterdrone
Member
Registered: 2010-02-16
Posts: 15

Re: Papywizard and OpenMoco

Greg is correct, the "firmware" only knows how to drive stepper drivers, it is unaware of the gear ratio of your setup, the microstep capabilities of your driver, etc.  It is expected that the application configuring it be aware/provide some input from the user about what the physical model of their setup is.  Given that the "interface" to it would have to be aware of these values to give the user meaningful inputs, it is presumed that the interface application can simply convert that to steps to make life more simple on the engine. (Something would have to tell the engine the gear ratio/uStep settings, and if you know all that, might as well save cycles/memory on the engine and just tell it the steps instead.)

Slim may provide that capability at some point, but I wrote Slim primarily as a means for scripting out common activities to test the firmware, and it's just filling a gap until a real GUI comes along.  If you take a look at the Processing-based GUI I started on (http://openmoco.org/node/122), it has the concept of 'distance/degrees' for motor movements, instead of steps.  It would just do the conversion and send the right values to the engine.

FWIW, it will drive _any_ stepper driver that has step/dir pins, so unipolar, bipolar, microstepping, etc. is up to how you want to use it.

Greg is close, my setup has 24,000 steps/360' at full-step, but I use 8x microstepping, so 192,000 steps / revolution.

!c

Last edited by shutterdrone (2010-04-21 18:04:08)

Offline

 

#25 2010-04-22 04:50:56

sjhenry
Member
From: Colorado, USA
Registered: 2009-03-10
Posts: 148
Website

Re: Papywizard and OpenMoco

Now I see the main firmware is dealing with the steps and the client takes the responsibility of figuring out how many steps etc. Thanks for the explanation.

Jones

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson