Page 2 of 3

PostPosted: Tue Nov 17, 2009 10:13 pm
by claudevh
Hi all,

Can we have some dreams ?

As axis we have Yaw and Pitch ...

Can we have also :
-Zoom (some camera's have this possibility and I believe that this will become current.)
-Lift (for Vertical displacement)
-Travel Horizontal (for horizontal displacement on dolly)
Even if this will not be used at the beginning, this will be helpfull for "Timelapse" and "TimeScape".
exemple :

It is also very important to respect the actual layout of Arduino Wireless communication shield, so we will be able to use one of the numerous Bluetooth or Wifi or ... modules compatible with Arduino. This will provide cheap communication capabilities !

PostPosted: Tue Nov 17, 2009 10:55 pm
by klausesser
An alternative it would be Josef´s TC-Controller which plugs into the Merlin´s telephone-jack and provides a camera-release straight from the controller via a standard 3,5mm jack.
I use my N800/PW via Bluetooth for distances and the TC-Controller when i can stand beneath the camera - though it can handle more than 30 meters of telephone cable.

best, Klaus

PostPosted: Tue Nov 17, 2009 11:20 pm
by claudevh
Hello Klaus,

You can maybe inform us ...
With the hand controller of Josef, is that also the same "speed "problem with the new Merlin Heads, as described in the next post ?

PostPosted: Tue Nov 17, 2009 11:59 pm
by fma38
I don't think so, as Josef don't use the goto function. It is possible because it uses a µ-controller, and can scan very quikly the position. But Josef finally used a wired connexion, because he had a lot of troubles when using bluetooth or zigbee...

Be don't mix threads please; there is already a Josef controller dedicated one.

Claude, my purpose is to replace the original controller, to improve it, but not that much ;) I think these ideas should be discussed on Greg thread, which is a more open controller project. And there is not enough space in the Merlin to put a full feature controller!

PostPosted: Wed Nov 18, 2009 12:40 pm
by klausesser
fma38 wrote:Be don't mix threads please; there is already a Josef controller dedicated one.

Where is it? I know i started it . . . but i can´t find it.
Can we make it sticky?

best, Klaus

besides: Josef altered the controller (update via web) and uses a mix now: full speed first and then goto for the very last millimeters to final positioning.
Works very precisely - perfect results.

PostPosted: Wed Dec 09, 2009 6:40 pm
by claudevh
Hello Fréderic,

Any news about the design of the Arduino shield ? :rolleyes:
Will the shield accept the connections of the 2 motors, shuter, TTL and power without changing the connectors ? ;)

PostPosted: Wed Dec 09, 2009 8:37 pm
by fma38
I got the components (both in CMS and normal). I have to make a PCB with the normal components (I will have room for only 1 axis, but it will be enough for tests). But I first want to finish the base board for the Roving Network wifi module...

PostPosted: Sat Jan 09, 2010 1:28 am
by panomax
My idea is to use an IR diode on one pin of the arduino for IR-remote on cameras with no remote plug.
I found these two projects for nikon:

Were do you buy the LS7366? I could not find a distributor for it....

Best regards,

PostPosted: Sat Jan 09, 2010 11:09 am
by fma38
panomax wrote:Were do you buy the LS7366? I could not find a distributor for it....

I asked for samples, long ago. LSI sent me 2 'normal' chip (not CMS).

You can find CMS chip here:

PostPosted: Sun Jan 10, 2010 1:00 am
by panomax
Hello Fréderic,
I found an implementation of the LS7366 on the arduino, maybe it's of interest for you... also has the LS7366 in stock ($3.95)


PostPosted: Sun Jan 10, 2010 9:19 am
by fma38
Great! Thanks for the links, especially the first one!

PostPosted: Tue Jan 26, 2010 6:38 am
by panoguy
UrsaMinor wrote:My opinion: Building a new electronics maybe not needed.

The existing electronics in Merlins can be re-used.
It has a L293 driver, two nice PIC microcontrollers etc...

Just write a new firmware and reprogram the PICs.
They can be reprogrammed as soldered into the circuit.

Second idea:
I've developed a complete stepper motor driver circuit.
It can drive two bipolar stepper motors (motor current can be configured, max 600mA per windings)
It uses only one PIC microcontroller and can drive the motors in microstep. No speed problems as with the Merlin.
This circuit is almost complete. Some days needed to finish.

Originally I developed it to use with equatorial telescope mounts.


I fully agree to this, specially after the recent firmware upgrades, it is clear the PIC is not locked and has got a bootloader installed. This means you can flash it with your own firmware. You only need to find out how the bootloader works so you can reuse the original program to load the code to the PIC.

PostPosted: Tue Jan 26, 2010 7:32 am
by fma38
I'm not sure if the v1 can be flashed as well...

I agree that developping a new firmeware using the same controller could be nice. We just need to find someone with the knowledge :rolleyes: And PICs are far to be the easiest µ-controllers to use...

PostPosted: Fri Feb 05, 2010 7:28 pm
by odyssey
Hello All,

Sorry I have not posted here in ages, have been busy with other projects, but am looping back to the excellent Papywizard/Orion project for a spin.

I just came across this Serial Motor Controller from Sparkfun It controls two motors via very simple serial commands and has six IO pins free as well as a serial port of course. It's Atmel 328 is reprogrammable. I was wondering what the feasibility of this $20 part as a replacement controller for the Orion. I don't know if it would be possible to add code to decode the encoder output on the Orion's motors or if six pins would be quite enough (one for shutter leaves only five for decoding the motor encoders? But you could hook the serial port directly up to a serial Bluetooth receiver. It has a 5-16v input and a 5 volt output to power a Bluetooth receiver. Here are the full specs and instructions Seems like the only challenge is those encoder outputs, and programming it... Maybe team this up with another Arduino Pro whose sole purpose would be to decode the encoder positions and report back to this unit the positions whenever requested, that way the interupts would not get overloaded.



PostPosted: Fri Feb 05, 2010 7:52 pm
by fma38
For the encoder, you only need 4 pins (2 per encoder, as they deliver quadratic signals). The problems is: is it possible to follow the rate of the encoder signals during a move? If you loose some pulses...

PostPosted: Fri Feb 05, 2010 8:07 pm
by panoguy
fma38 wrote:For the encoder, you only need 4 pins (2 per encoder, as they deliver quadratic signals). The problems is: is it possible to follow the rate of the encoder signals during a move? If you loose some pulses...

Yes it is possible, the Atmega 168 can handle this easily.
The encoder counter needs to be handled in a interrupt routine, so you won't loose any steps. Also the Atmega 168 should have just enough I/O pins to connect the 2 motors, 2 encoders (4 pins) and shutter (1 or 2 pins), 1 ADC pin to check the battery voltage.
But then you would need to develop the software from scratch anyway.
Looking at the example code which they provide, you may get at least an idea how to build your own program, but in the end you need to replace it.
You may even consider to take 2 of this boards and use one per axis, like Merlin does.
In that case it only depends on your programming skills, I see no issue from a HW point of view.

On top of that you should consider to add a BT board like the Rayson BTM222 module.
You can get a ready to use board at least in Germany
This can be connected directly to the Atmega 168 RX,TX lines and you are ready to communicate via BT with your device.

PostPosted: Sat Feb 06, 2010 1:31 am
by odyssey
Yes, this encoder problem is my worry (I dont know the program on this device and how overloaded it is already), so I am thinking about using another $20 Arduino Pro Mini whose sole purpose would be to keep track of the encoder pulses and report back to this unit via Softserial on a couple of those pins on the Sparkfun controller, this would mean $40 in total for parts that are all already put together- just needs a program. Before I order it does anyone know of a reason why it would not work????

PostPosted: Sat Feb 06, 2010 9:03 am
by fma38
Another solution for encoding is to use a dedicated chip, like the LS-7366. This is the one I plan to use:

Also keep in mind that you have to convert the encoder signals to proper TTL...

PostPosted: Sat Feb 06, 2010 11:04 am
by Paul
in the Arduino-forum you can find a library for a rotary encoder (look for sunbox' posting)

PostPosted: Sat Feb 06, 2010 3:54 pm
by odyssey
What is crazy is that I bought a $3 non-optical scroll mouse and it has a controller within it for three-axis quadrature encoding as well as three buttons and it has a well documented PS2 interface that Arduino can communicate with. If I could just figure out how to use the physical parts from this...

Thank you for the guidance so far. I ordered the Sparkfun part, well just to have fun. I would like to see how cheaply one could make an open source, easy to make, dslr ready mount that will work with the excellent Papywizard. I have three working motorized mounts already- but none are perfect for what I like to shoot- which is moving around two digicams (Panasonic FZ-50) mounted together base to base for stereo photography. My Gigapan unit is not set up for having the cameras vertical, can not change the aspect ratio for movements from horizontal. Papywizard does that though! But I need to modify the Orion mount to get two cameras to rotate around and as close to the lens nodal point. Its all fun though. I don't actually need a new controller in the Orion, its just something I have been interested in working on.

So does anyone have a source for more female receptacles that fit the motor harnesses (like that are on the Orion circuit board)?



PostPosted: Thu Feb 11, 2010 8:37 am
by odyssey
I received the Sparkfun Serial Dual Motor Controller and an Arduino Pro Mini today and I have hooked them up to my Orion.

The Arduino Pro Mini is the brains and runs the primary program. It is hooked up to the Sparkfun Serial Dual Motor Controller using two pins for software serial interface. It can give commands to turn on each motor, set direction, and speed in 10% increments. The Serial Motor driver is hooked to the 9.6v from the 8-1.2v batteries and outputs 5v regulated which I use to power the Arduino and the PS2 mouse circuit). It receives simple serial commands like 1f8, which is motor 1, forward, 88% speed (0-9 on speed)

The Arduino Pro Mini is also hooked up to a PS2 mouse circuit (from this PS2 Arduino Playground article, using two digital pins, one for data, and one for clock, plus ground and 5v. I have removed the IR receivers from the mouse, soldered in wires to the IR sockets on the mouse circuit board, and REPLACED the IR receivers on the Orions motors with the ones removed from the mouse as the mouse IR receivers produce a digital output that is ready for the PS2 mouse IC to decode into movement counts. (I did not have the patience to build a circuit to convert the Orions analog quadrature pulses into digital, but it could easily be done, I just figured I could get it done this way in 10 minutes by just some desoldering and soldering...) The PS2 mouse circuit is hooked up to the two motor encoder outputs for each axis. Here is PS2 mouse protocol

I have a PS2 mouse sketch loaded into the Arduino that puts the mouse into 'Remote' mode and requests any mouse movement data with a 2 microsecond delay in the loop. It then adds or subtracts the mouse movements to 'mx' and 'my' 'long' variables. The sketch is modified from this mouse sketch The mouse movement buffer will overflow at 256 ticks in 'Remote' mode so data requests have to come fast enough to not let it go into overflow.

When I run the motor at 100% (my meter reads 8v at 100% from the Serial Motor Controller motor PWM outputs) it turns the Orion base at 2 RPM and produces approximately 100,000 ticks per revolution or 280 ticks per degree of turn (the encoder has 45 spokes and each spoke adds 2 ticks to the encoded count. At 8volts the motor is turning fast at about 2000 RPM) The motor is rated for 5v but does not smell funny or heat up when I let it turn 12 revolutions at 8 volts...?

I am now coding the full Arduino sketch that will pull all this together with something like this:

Code: Select all

wait for GOTO position request from serial port:

GOTO axis position (in degrees) request received
-calculate distance from current position to requested position
-calculate initial motor speed based on distance from current position (9 speeds to choose from)

-turn on motor(s)
--Movement Loop:
---check position
---listen for emergency stop from serial
---report position over serial if requested
---report moving over serial?
---calculate distance from current position
---adjust motor speed to be slower as we approach position
---stop motor if reached requested position, report position and motor stopped over serial,  and exit loop

wait for TAKE PHOTO request from serial port:
--signal pin for autofocus
--wait delay
--signal pin for take photo
--check for 'FLASH' input that photo was taken

The movement loop can not take too long to do any calculations as the PS2 mouse protocol will only count up to 256 ticks before reporting overflow when in REMOTE mode. I have not tested the loop speed yet, the tight loop in the PS2 sketch was reporting mouse movements at full speed of about 20 ticks per data report so hopefully there is room for some more delay in the code.

Seems like this will do the trick! And its simple;)

[ul][uli]1 Sparkfun Serial Controlled Dual Motor Driver $20 [/uli][uli]1 Arduino Pro Mini $19[/uli][uli]1 PS2 non-optical scroll mouse ($4 from Big Lots)[/uli][uli]1 5v FTDI basic breakout(USB to Serial) $15[/uli]OR[uli]1 Bluetooth Mate (Bluetooth to Serial receiver) $65[/uli][/ul]

I will need to make this sketch respond to the protocols already set up for plugins (documentation???)

Well, hopefully this will all work as I have hacked up my quadrature encoders (I can return it to normal still if I were to choose, but it would be only in admitting defeat).

I did not bother to time how long it takes to do 1 360 degree revolution with the standard Orion controller and Papywizard, is 2 RPM a speed improvement??? (Can someone measure this please). I realize this controller is mainly for fixing the speed of the small movements which it definitely will be able to do, but I am hoping to speed up all movements if possible.

This will still not be as fast as a Gigapan Epic+, which can do 1 revolution in 15-22 seconds (depending on set motor speed) but it can drive two axis at once and has a much smoother ramp up and down, and does not have to do carriage returns on the movements, so hopefully in the end it will be comparable.

Comments, suggestions most kindly requested!



PS, when I get it all working I will post all code, schematic, and photos. I also realize a full dedicated circuit like what has been described already in this thread would be the ideal way to go, but I do not have the software to make a circuit board, can not do surface mounted soldering (so the board would be bigger) and I just wanted to see if I could make a controller with off the shelf parts for less than $50.

PostPosted: Thu Feb 11, 2010 9:49 am
by fma38
Nice work!

About the protocol, you can use the one from the GigaPanBot plugin (I will release a version of Papywizard including the last changed very soon). The protocol is described in the header:

Feel free to ask if needed. You can also have a look at this thread:,papywizard-compatible

If you want to use another protocol, I can write another plugin ;)

PostPosted: Thu Feb 11, 2010 10:11 am
by Paul
Hi Jason,

great work !

a source for Arduino and BT - quite a bit cheaper:
Arduino Nano called RFRoduino (AtMega328) but with integrated USB (~24$) - no need for FTDI breakout
look on ebay for item 320476527475 and 220546284671 / 140379798618 BT-Module (~42$) incl. BT-Dongle

140374541892 another Arduino Nano with USB

PostPosted: Thu Feb 11, 2010 3:57 pm
by odyssey
Thank you for the complementary words of encouragement!

Hi Paul,

Yes, those are some great prices on Bluetooth modules and with free nano sized adapters too!

I already actually had an old 'Bluesmurf' modem so was just posting what would be needed, and I had the FTDI breakout connectors which are reusable from project to project so I kind of like the Arduino Pro Mini over the Nano as its a bit cheaper when you keep the FTDI connector for something else (don't factor in its cost) and the USB bit would not be drawing power when not needed (assuming it does even when not in use?), but I could see where maybe you could design code to control this thing over USB, in which case the Arduino Nano wins. I already had all the parts except for the Serial Motor Controller in my treasure chest. Also I am quite fond of Sparkfun, myself being from Colorado and all, so I am biased;)

Thank you for the tips though, I am sure they could help someone else attempting such a project!

Hi Frédéric,

I just examined the Gigapanbot driver protocol and code and am sure I can implement it probably without any change requests;) ! One question is how do these current units report when you have gone past 360 degrees of rotation, and is it currently possible to ask for say '420 degrees'? Going past 360 is not important for stargazing, but it is for greater than 360 degree panoramas (overlap, looping past start point, timelapse stuff).

Is there really an advantage to using 6-byte-hex high byte first in reporting axis positions versus just an integer, or is this just left over from the Orion controller and is it time to move on? (I can do it that way but for bus sniffing the serial port I would just assume have something my mind can instantly understand, I understand the value of not passing around floats, but what about a multiplier like 3600 which would include the 1/10th degree accuracy {these encoders actually have far to many ticks compared to gear precision})

Also, is there any implementation for Autofocus trigger in the shutter module (can Papywizard directly request 'Focus')? And what is the current command protocol for shutter release request (it was not in the header)?

Thanks, I hope not to be in touch too much;)


PostPosted: Thu Feb 11, 2010 4:20 pm
by fma38
Going over 180°, or bellow -180° (as starting psition is 0) depends on your encoders capacity. On the Merlin/Orion, you can do more than 8 turns in each direction before overflow! Don't know for the GigaPanBot hardware...

About the 6digits hex value (24bits), the Merlin used it (with low byte first), and Panoguy asked me to use it too (but with high byt first). I think it is easier for its implementation. But again, if it is easier for you to use decimal, I can write another plugin.

Papywizard has no autofocus driver; it is usually triggered together with the shutter.

The command to trigger the shutter is 'O<1d><1d>' (first digit is axis number, which should be 1 for Merlin, and second digit is 0 or 1, to open / close the contact). I added this info to the header. Note that the GigaPanBot firmware seems to have 1 contact per axis. But Papywizard only manages 1 contact for the shutter.