Motorised XY stage
Moderators: rjlittlefield, ChrisR, Chris S., Pau
-
- Posts: 142
- Joined: Tue Dec 09, 2014 3:25 pm
Motorised XY stage
I have a Zeiss XY manual stage which appears to be the same as the motorised version they produced. I'm looking for a solution to add two servo motors that would be controlled with a joystick. All ideas are welcome! I've been looking at using PC Control hardware and software but have realised that there is an almost endless number of opensource projects out there.
-
- Posts: 476
- Joined: Fri Apr 13, 2012 3:54 pm
- Location: Canada
- Contact:
For this, you will want a nice pair of high end continuous rotation servos. And then, I recommend an Arduino Uno which gives you both a way to read analog input from a joystick, as well as a direct way of controlling continuous rotation servos via the ServoWrite function.
I think this will be very easy even if you know very little about electronics. The hardest part may prove to be the hardware connection between the motors and the XY stage. All a continuous rotation servo needs is the right voltage and current. After that, the ServoWrite function controls both speed and direction. It's like magic.
Just be sure your servos have the necessary torque and aren't too flimsy.
Here's a parts list based around Arduino UNO:
- Two continuous rotation servos that take 7-12V and use less than 600 mA at peak, and the hardware needed to mount them to your stage
- Two transistors (eg, P2N2222A, which is 600mA max), one for each motor. A microcontroller can quickly be destroyed by attempting to power a motor directly from it (the UNO can only sink 400 mA max). Use a transistor for each motor that shunts power directly from your power supply and also connect the motor's ground wire dirrectly to the power supply. The Ardunio's ground pins can only sink 200mA each! There should be no wires going directly from the Arduino to your servos. Only one wire going from the Arduino to the resistor in series with the transistor's base for each servo.
- Two resistors, one for each transistor's base. Value will depend on the current draw and transistor specs. Use this calculator.
- One Arduino UNO
- One analog joystick, something like this
And a bit of code, but nothing complex.
The joystick will have at least two potentiometers - one for x axis, one for y. It might have others too depending on how many axes it has.
You connect the x and y pots up to two analogue input pins on the microcontroller. You either wire the other lead of the pot to ground, or to 5V/3.3V, depending on whether you prefer to pull the analog inputs high or low. I think setting the input pins to high, which enables the Uno's built-in pullup resistors, and then connecting the pots to ground, will result in the most reliable setup. In the software, you use the AnalogRead function, the output of which will change with joystick position. Now you need to figure out a range of values for a "dead zone" which is when the joystick isn't being pushed in any direction. It will not just be one number, but a range. Try a 10% deadzone to start with (meaning 5% of the range of joystick movement off center to either side will be ignored).
When the value is above the dead zone, you move the motor in one direction, when it is below, you move it in the other. The ServoWrite documentation tells you what numbers you need to give it to change direction and speed. So it's just a matter of using some basic math to convert the numbers you get from the analog in pins into the numbers the ServoWrite function wants, with the deadzone added in.
I'm in a rush so didn't check this post as carefully as I could have for factual errors. You may need some additional resistors to current-limit stuff, and I might be wrong about wanting to pull the analog input pins high. Double check those things before you build it.
Here's a guy who did something like this: http://forum.arduino.cc/index.php?topic=261740.0
I think this will be very easy even if you know very little about electronics. The hardest part may prove to be the hardware connection between the motors and the XY stage. All a continuous rotation servo needs is the right voltage and current. After that, the ServoWrite function controls both speed and direction. It's like magic.
Just be sure your servos have the necessary torque and aren't too flimsy.
Here's a parts list based around Arduino UNO:
- Two continuous rotation servos that take 7-12V and use less than 600 mA at peak, and the hardware needed to mount them to your stage
- Two transistors (eg, P2N2222A, which is 600mA max), one for each motor. A microcontroller can quickly be destroyed by attempting to power a motor directly from it (the UNO can only sink 400 mA max). Use a transistor for each motor that shunts power directly from your power supply and also connect the motor's ground wire dirrectly to the power supply. The Ardunio's ground pins can only sink 200mA each! There should be no wires going directly from the Arduino to your servos. Only one wire going from the Arduino to the resistor in series with the transistor's base for each servo.
- Two resistors, one for each transistor's base. Value will depend on the current draw and transistor specs. Use this calculator.
- One Arduino UNO
- One analog joystick, something like this
And a bit of code, but nothing complex.
The joystick will have at least two potentiometers - one for x axis, one for y. It might have others too depending on how many axes it has.
You connect the x and y pots up to two analogue input pins on the microcontroller. You either wire the other lead of the pot to ground, or to 5V/3.3V, depending on whether you prefer to pull the analog inputs high or low. I think setting the input pins to high, which enables the Uno's built-in pullup resistors, and then connecting the pots to ground, will result in the most reliable setup. In the software, you use the AnalogRead function, the output of which will change with joystick position. Now you need to figure out a range of values for a "dead zone" which is when the joystick isn't being pushed in any direction. It will not just be one number, but a range. Try a 10% deadzone to start with (meaning 5% of the range of joystick movement off center to either side will be ignored).
When the value is above the dead zone, you move the motor in one direction, when it is below, you move it in the other. The ServoWrite documentation tells you what numbers you need to give it to change direction and speed. So it's just a matter of using some basic math to convert the numbers you get from the analog in pins into the numbers the ServoWrite function wants, with the deadzone added in.
I'm in a rush so didn't check this post as carefully as I could have for factual errors. You may need some additional resistors to current-limit stuff, and I might be wrong about wanting to pull the analog input pins high. Double check those things before you build it.
Here's a guy who did something like this: http://forum.arduino.cc/index.php?topic=261740.0
Or ... if you're not worried about feedback with the positioning, you could go the cheap route ... ...
You could use 2 servos and 2 servo testers (I have an unfinished project where I will be using this setup but only 1 servo and 1 servo tester for a remote follow focus system on my DSLR Rig, using cogs) ...
Basically take the potentiomter connections from the servo testers and connect them to your joystick pots accordingly ... you could gear the servos to cover the whole slide in one swoop ... the testers normally have 3 modes ... Neutral point return (centered), test loop backwards/forwards and manual using the potentiometer itself ...
If there is some slack in the joystick control just use extra calibration pots (board mounted types), to tighten up the movment, I reckon this would work ... cheap as chips, as the servo testers are about £5 - £10each ... and the joystick can be from an old game console ... the Nintendo Wii Nunchuck joystick is perfect if you want it handheld ... joystick one hand focus with the other ...
Whichever system you go for just make sure, as Rylee said, get nice solid quality servos (for reliability) ... not the cheap noisy types that have too much plastic gearing in them ... Futaba or Tamiya should be fine ...
Rylee ... I was going to use this setup for building a specimen washing tank, like the one you built but using this servo/tester setup but in the automatic backwards/forwards mode (washing machine cycle) ...
You could use 2 servos and 2 servo testers (I have an unfinished project where I will be using this setup but only 1 servo and 1 servo tester for a remote follow focus system on my DSLR Rig, using cogs) ...
Basically take the potentiomter connections from the servo testers and connect them to your joystick pots accordingly ... you could gear the servos to cover the whole slide in one swoop ... the testers normally have 3 modes ... Neutral point return (centered), test loop backwards/forwards and manual using the potentiometer itself ...
If there is some slack in the joystick control just use extra calibration pots (board mounted types), to tighten up the movment, I reckon this would work ... cheap as chips, as the servo testers are about £5 - £10each ... and the joystick can be from an old game console ... the Nintendo Wii Nunchuck joystick is perfect if you want it handheld ... joystick one hand focus with the other ...
Whichever system you go for just make sure, as Rylee said, get nice solid quality servos (for reliability) ... not the cheap noisy types that have too much plastic gearing in them ... Futaba or Tamiya should be fine ...
Rylee ... I was going to use this setup for building a specimen washing tank, like the one you built but using this servo/tester setup but in the automatic backwards/forwards mode (washing machine cycle) ...
Canon 550D(T2i) ML (Nightly Builds) | Canon 5D MKII | Raynox 250 | Palinar 35mm f2.8 (reversed) | EL-Nikkor 50mm f2.8 N | EL-Nikkor 50mm f4 N | EL-Nikkor 50mm f4 | Bellows | Objectives: LOMO 3.7x 0.11 : 8x 0.20 : 40x 0.65
RiG II - 'Bamboo': Olympus CH Focus Block with Inverted Arca/Swiss | Canon 430 EX (x2) | Olympus T20 flash (x2) | Youngnuo YN-622C Wireless triggers (x3) | Ikea Jansjo 3W LED Lighting (x3)
Stepper Motor Focusing System (Helicon Remote)
RiG II - 'Bamboo': Olympus CH Focus Block with Inverted Arca/Swiss | Canon 430 EX (x2) | Olympus T20 flash (x2) | Youngnuo YN-622C Wireless triggers (x3) | Ikea Jansjo 3W LED Lighting (x3)
Stepper Motor Focusing System (Helicon Remote)
-
- Posts: 476
- Joined: Fri Apr 13, 2012 3:54 pm
- Location: Canada
- Contact:
Yeah I think you're right mate ... all depends on how accurate Andy wants it really ... adding encoders starts to get complicated
Canon 550D(T2i) ML (Nightly Builds) | Canon 5D MKII | Raynox 250 | Palinar 35mm f2.8 (reversed) | EL-Nikkor 50mm f2.8 N | EL-Nikkor 50mm f4 N | EL-Nikkor 50mm f4 | Bellows | Objectives: LOMO 3.7x 0.11 : 8x 0.20 : 40x 0.65
RiG II - 'Bamboo': Olympus CH Focus Block with Inverted Arca/Swiss | Canon 430 EX (x2) | Olympus T20 flash (x2) | Youngnuo YN-622C Wireless triggers (x3) | Ikea Jansjo 3W LED Lighting (x3)
Stepper Motor Focusing System (Helicon Remote)
RiG II - 'Bamboo': Olympus CH Focus Block with Inverted Arca/Swiss | Canon 430 EX (x2) | Olympus T20 flash (x2) | Youngnuo YN-622C Wireless triggers (x3) | Ikea Jansjo 3W LED Lighting (x3)
Stepper Motor Focusing System (Helicon Remote)
Andy there's also this ... I dn't know how you are with metal work/Mechanical engineering but could this be adapted? ...
http://www.ebay.co.uk/itm/Carl-Zeiss-Je ... 27f1cf2644
http://www.ebay.co.uk/itm/Carl-Zeiss-Je ... 27f1cf2644
Canon 550D(T2i) ML (Nightly Builds) | Canon 5D MKII | Raynox 250 | Palinar 35mm f2.8 (reversed) | EL-Nikkor 50mm f2.8 N | EL-Nikkor 50mm f4 N | EL-Nikkor 50mm f4 | Bellows | Objectives: LOMO 3.7x 0.11 : 8x 0.20 : 40x 0.65
RiG II - 'Bamboo': Olympus CH Focus Block with Inverted Arca/Swiss | Canon 430 EX (x2) | Olympus T20 flash (x2) | Youngnuo YN-622C Wireless triggers (x3) | Ikea Jansjo 3W LED Lighting (x3)
Stepper Motor Focusing System (Helicon Remote)
RiG II - 'Bamboo': Olympus CH Focus Block with Inverted Arca/Swiss | Canon 430 EX (x2) | Olympus T20 flash (x2) | Youngnuo YN-622C Wireless triggers (x3) | Ikea Jansjo 3W LED Lighting (x3)
Stepper Motor Focusing System (Helicon Remote)
-
- Posts: 476
- Joined: Fri Apr 13, 2012 3:54 pm
- Location: Canada
- Contact:
Haha, it just occurred to me... you can probably do this just with a pair of 555 timers, no micro-controller necessary, with the joystick x and y pots as timing resistors and a few trimpots for calibration. But that would make the deadzone trickier... probably need a pair of transistors for each axis with trimpots and an or logic gate or something...
Nah, the microcontroller is easier. Or the servo testers.
Huh, although I have absolutely no use for such a device (currently) I now want to build one.
By the way, Gem, nice idea about using a servo for the insect wash machine, haha. The stepper I used was opportunistic only. I had the part and the code, so I rolled with it.
Nah, the microcontroller is easier. Or the servo testers.
Huh, although I have absolutely no use for such a device (currently) I now want to build one.
By the way, Gem, nice idea about using a servo for the insect wash machine, haha. The stepper I used was opportunistic only. I had the part and the code, so I rolled with it.
... yep you could use the timer chips also ... I think the pre-built testers may use PIC micro controllers to make the mode functions possible ...
Ha ... once you get one you won't use it ...
Ha ... once you get one you won't use it ...
Canon 550D(T2i) ML (Nightly Builds) | Canon 5D MKII | Raynox 250 | Palinar 35mm f2.8 (reversed) | EL-Nikkor 50mm f2.8 N | EL-Nikkor 50mm f4 N | EL-Nikkor 50mm f4 | Bellows | Objectives: LOMO 3.7x 0.11 : 8x 0.20 : 40x 0.65
RiG II - 'Bamboo': Olympus CH Focus Block with Inverted Arca/Swiss | Canon 430 EX (x2) | Olympus T20 flash (x2) | Youngnuo YN-622C Wireless triggers (x3) | Ikea Jansjo 3W LED Lighting (x3)
Stepper Motor Focusing System (Helicon Remote)
RiG II - 'Bamboo': Olympus CH Focus Block with Inverted Arca/Swiss | Canon 430 EX (x2) | Olympus T20 flash (x2) | Youngnuo YN-622C Wireless triggers (x3) | Ikea Jansjo 3W LED Lighting (x3)
Stepper Motor Focusing System (Helicon Remote)
-
- Posts: 142
- Joined: Tue Dec 09, 2014 3:25 pm
Motors
I guess the important aspect of the motors is that they are able to move the stage very smoothly with fine control over speed/start/stop to be able to track moving subjects while shooting video. Will the servo motors from the model car/boat world such as those suggested by GemBro - Futaba or Tamiya be able to achieve this?
Andy ... they should be fine as they have decent components in them and have quite a bit of torgue ... even if the servo tester driving method is not upto the job, the servos themselves will be ...
Clutches can be used with the servos and they still rotate when stopped with your fingers (the clutch then kicks in) so they are pretty powerful ...
I would start with the servos (mount & couple them to the X-Y Stage and test using a servo tester ... if they work ok then it's worth pursuing the next step, moving onto the electronic drivers (servo tester adaptation or the Arduino system) ... it would be trial and error at this point but probably a lot cheaper to find out before spending a lot of money (if it ends up being the case) ...
To get an idea on how well the servos work check out some YouTube videos regarding servos and how they are driven ... most show how well they operate ... if they are good enough for retail companies to use them for DSLR Remote Focus systems (to control the lens focus & zoom) then I would think they would be perfect for your project ...
This should give you an idea of how smooth the servos can be controlled:
https://www.youtube.com/watch?v=WMtlymFdouA
Disregard the fact that an RC system is used in the video (another option I suppose?) as all servos using any control system will be as smooth ... it's what they are built for ...
But ... smooth movement and accuracy (for your project) will all depend on how the servos are coupled to your X-Y stage movement controls ... they need to be pretty solid fixtures ... and no reason why clutches couldn't be put into play either? ...
Clutches can be used with the servos and they still rotate when stopped with your fingers (the clutch then kicks in) so they are pretty powerful ...
I would start with the servos (mount & couple them to the X-Y Stage and test using a servo tester ... if they work ok then it's worth pursuing the next step, moving onto the electronic drivers (servo tester adaptation or the Arduino system) ... it would be trial and error at this point but probably a lot cheaper to find out before spending a lot of money (if it ends up being the case) ...
To get an idea on how well the servos work check out some YouTube videos regarding servos and how they are driven ... most show how well they operate ... if they are good enough for retail companies to use them for DSLR Remote Focus systems (to control the lens focus & zoom) then I would think they would be perfect for your project ...
This should give you an idea of how smooth the servos can be controlled:
https://www.youtube.com/watch?v=WMtlymFdouA
Disregard the fact that an RC system is used in the video (another option I suppose?) as all servos using any control system will be as smooth ... it's what they are built for ...
But ... smooth movement and accuracy (for your project) will all depend on how the servos are coupled to your X-Y stage movement controls ... they need to be pretty solid fixtures ... and no reason why clutches couldn't be put into play either? ...
Canon 550D(T2i) ML (Nightly Builds) | Canon 5D MKII | Raynox 250 | Palinar 35mm f2.8 (reversed) | EL-Nikkor 50mm f2.8 N | EL-Nikkor 50mm f4 N | EL-Nikkor 50mm f4 | Bellows | Objectives: LOMO 3.7x 0.11 : 8x 0.20 : 40x 0.65
RiG II - 'Bamboo': Olympus CH Focus Block with Inverted Arca/Swiss | Canon 430 EX (x2) | Olympus T20 flash (x2) | Youngnuo YN-622C Wireless triggers (x3) | Ikea Jansjo 3W LED Lighting (x3)
Stepper Motor Focusing System (Helicon Remote)
RiG II - 'Bamboo': Olympus CH Focus Block with Inverted Arca/Swiss | Canon 430 EX (x2) | Olympus T20 flash (x2) | Youngnuo YN-622C Wireless triggers (x3) | Ikea Jansjo 3W LED Lighting (x3)
Stepper Motor Focusing System (Helicon Remote)
-
- Posts: 142
- Joined: Tue Dec 09, 2014 3:25 pm
Andy ...
Here are a few examples using a servo and servo tester ... very basic but it works ...
https://www.youtube.com/watch?v=WtWCW4VwFLY
https://www.youtube.com/watch?v=veK7Fr3UpH4
Reciever & servo:
https://www.youtube.com/watch?v=m8_h7ZK ... ILGXQJsePB
Here are a few examples using a servo and servo tester ... very basic but it works ...
https://www.youtube.com/watch?v=WtWCW4VwFLY
https://www.youtube.com/watch?v=veK7Fr3UpH4
Reciever & servo:
https://www.youtube.com/watch?v=m8_h7ZK ... ILGXQJsePB
Canon 550D(T2i) ML (Nightly Builds) | Canon 5D MKII | Raynox 250 | Palinar 35mm f2.8 (reversed) | EL-Nikkor 50mm f2.8 N | EL-Nikkor 50mm f4 N | EL-Nikkor 50mm f4 | Bellows | Objectives: LOMO 3.7x 0.11 : 8x 0.20 : 40x 0.65
RiG II - 'Bamboo': Olympus CH Focus Block with Inverted Arca/Swiss | Canon 430 EX (x2) | Olympus T20 flash (x2) | Youngnuo YN-622C Wireless triggers (x3) | Ikea Jansjo 3W LED Lighting (x3)
Stepper Motor Focusing System (Helicon Remote)
RiG II - 'Bamboo': Olympus CH Focus Block with Inverted Arca/Swiss | Canon 430 EX (x2) | Olympus T20 flash (x2) | Youngnuo YN-622C Wireless triggers (x3) | Ikea Jansjo 3W LED Lighting (x3)
Stepper Motor Focusing System (Helicon Remote)
-
- Posts: 476
- Joined: Fri Apr 13, 2012 3:54 pm
- Location: Canada
- Contact: