Automated Stack & Stitch System Videos

Have questions about the equipment used for macro- or micro- photography? Post those questions in this forum.

Moderators: rjlittlefield, ChrisR, Chris S., Pau

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

Lou,

The video doesn't show much (IQ is poor, but that's not what I cared about) other than the motor/rail don't induce any apparent vibrations into the subject or water, as well as not moving themselves. Think this could be valuable with your subjects suspended in liquid.

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

Lou Jost
Posts: 5944
Joined: Fri Sep 04, 2015 7:03 am
Location: Ecuador
Contact:

Post by Lou Jost »

Yes, I am sure you are right, this would eliminate that problem.

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

Here's a couple plots that might help with some of the underlying concepts these videos demonstrate.

I created a simplified model of a Z axis stacking system with a heavy camera & lens on a vertical stand like the ones shown in the video. This model is just to show the effects of velocity profiling and does not include any motor waveform details or timing, or other effects. The model is underdamped as these systems tend to be, and has a natural resonance of ~1Hz.

The plot shows a starting position of 0.0 at time 0.0, with a normalized desired end position of 1.000 at 3.0 seconds, thus the rail will ramp from 0 to 1.000 in 3 seconds.

The green waveform is the standard type focus stacking drive, the blue is a velocity profiled drive. Red is the response to the standard drive and pink is to the profiled drive. As you can see the red waveform takes about 4 seconds to settle (7-3 seconds), whereas the pink waveform is almost settled when reaching the desired end point.

Note that the profiled drive waveform actually has a higher peak velocity than the standard drive, this can be true with optimized motor current waveform parameters like the Trinamic posses, and without increasing the overall motor current consumption or heat.

Anyway, hope this helps show the concepts involved behind these videos.

Best,

Image
Image





Edit: Here's a system with higher damping. The settling time is improved for the Standard Motor Drive to ~2.5 seconds over the previous 4 seconds for low damping case. The Velocity Profile response is still significantly better as shown.

Note, with a Non-Optimized Profile the performance is better but not as good as the shown Velocity Profile which is optimized.

Image
Image
Last edited by mawyatt on Sat Apr 20, 2019 2:32 pm, edited 3 times in total.
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

aidanmoore
Posts: 104
Joined: Thu Sep 24, 2015 8:09 am
Location: Toronto

Post by aidanmoore »

Hi Mike,

Also very interested in helping out as needed. I have a similar requirement for tracking swimming bugs using a joystick controlled XY stage and this looks like it can be easily adapted.

Please let me know you thoughts on how to assist. Is it purely cost sharing ?
Custom Nikon/Thorlabs Microscope Nikon Z7ii ZCAM E4

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

Think this could be accomplished. The controller driver PCB and interface (USB for Tic-500 and SPI for Trinamic) should be the same. You would need to develop the code to interface the joystick the controller driver.

As far a getting involved I'm hoping for someone to help layout the PCBs, and certainly cost sharing is welcome.

Here's the thread for the project.

https://www.photomacrography.net/forum/ ... hp?t=39473

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

I couldn't resist trying the Mitutoyo 50X lens on the setup before I changed it :roll:

So this video is with the 50X and Nikon D850 at 16X digital zoom for a ridiculous 800X effective magnification :shock:

This is on the portable S&S System with Wemacro based Vertical Stand and Trinamic controller with Profiled Velocity, Acceleration/Deceleration and motor waveform and timing control driving a THK KR20 Z axis rail like the previous videos except with the 50X instead of 20X lens.

The setup is just sitting on cardboard boxes off the floor next to my desk, with no attempts to subdue vibrations from any source other than using the mentioned Profiled Control Parameters. The D850 output is from a small 7" HDMI monitor, which is video image.

Best & Happy Easter to Everyone,

https://drive.google.com/file/d/19wE-B- ... sp=sharing
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

rjlittlefield
Site Admin
Posts: 23561
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

Mike, that's another very impressive video!

Clearly your drive system is able to make both large and small movements quickly, precisely, and quietly, without inducing visible vibrations in the image. That's an awesome combination.

As usual, I'm wondering about causes and effects.

Your narration focuses on the absence of vibrations, which surely is critical for photography.

But for me, the highlights are the speed, precision, and silence, because I have not seen problems with image stability caused by other drivers such as the StackShot controller.

At one time I made a concerted attempt to observe image instability caused by annoying loud whine while holding microstepped positions --- and failed utterly. Even with a 50X objective staring at a blowfly wing, motor whine made no difference in the sharpness of the image. See the writeup at http://www.photomacrography.net/forum/v ... 710#179710 .

So I'm curious: have you run the same sort of tests that are shown in your video, but with less sophisticated drive systems such as the StackShot controller, and compared image stability between the two cases?

--Rik

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

Rik,

I agree that the lack of sound and "whine" is another extremely useful benefit, as is the total time to transition long ranges but retain precision positioning. I've suffered the long wait times as the rail wanders around at lower speeds for precision and to help reduce induced vibrations. This is especially annoying when you are setting up start and end positions with a subject that's has large depth, and you've set the rail speed low so you can "find" the right start and end spots. With this setup you can zoom to any long distance and still have the precision of the slow "creeping up on" type approach.

Some of the noise reduction is due to the motor current waveform manipulation and timing, which includes the spreading of the current pulses. This causes the energy of the usual highly periodic waveform pulses to get spread over a larger frequency span...thus much less peak and more uniform energy density (watts/hz) which tends to not excite the motor, rail and system resonances.

So yes, that's a good point, I should not only emphasize the lack of vibration effects but also include the lack of noise. When moving short distances, the motor is almost totally silent, you might have noticed that in the videos.

I've partially disassembled this setup, trying to setup another system and calibrate the Thor Labs HIWIN motor/rail now.

I do recall having to wait a long time (3~5 seconds) for settling before I got on this 1 second per image obsession.

BTW I do recall a discussion we had regarding the motor "whine", I was concerned as well since "if you can hear it somethings moving"!!

Best & Happy Easter,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

rjlittlefield
Site Admin
Posts: 23561
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

I certainly did notice near total silence on all but the longest moves. That's perhaps the first thing that caught my attention.

BTW, in the graphs that you show above, I'm not sure that any one of the lines reflects what the StackShot does. It looks to me like your line labeled "Standard Position Control" tries to do a constant speed thing, instantly accelerating from zero to maximum velocity and then stopping suddenly. But the StackShot uses linear ramps on both the start and end, so for it I'd expect to see a line that has quadratic curved ends on a position-versus-time graph. Have I interpreted your graphs correctly?

--Rik

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

Rik,

The "Standard" would be like what the typical motor driver/controllers do, constant velocity from start to stop. These are the popular motor driver chips like the A4988, DVR8825, MP6500 and so on when operate at a constant step rate. The Tic-500 has included a micro controller with the MP6500 and incorporates more sophisticated control like ramping, the Trinamic TMC-5130 has a micro-controller incorporated into the chip and even more control.

WeMacro, MJKZZ controllers don't have ramping features like Stackshot. I like the way the Stackshot works and it's features, especially with the GUI from Zerene, it's still one of my favorite controllers.

The Trinamic has some interesting concepts though, with the velocity parameters along with the motor parameters & timing, which work together to create the motor/rail profiles I'm using. They not only reduce noise and vibration but allow brisk speeds by switching micro-steps to full steps on the fly and back while keeping motor currents low and thus don't overheat the motors.

I've found that I can run the motor/rails at higher velocities than I can with other controllers and not miss steps nor have position errors, but still be relatively quiet.

While just working with the HIWIN 50 (KR26 eqv) I used the same parameters I did with the KR20 which has a pitch of 1mm. The HIWIN has a pitch of 2mm, which means the stage is moving twice as fast as the KR20 and did 50mm in ~ 5 seconds!! :shock:

Surprisingly nothing happed, the rail ran fine and didn't make much noise either, and it was loaded with a camera and lens assembly!! I don't know what parameters this will eventually require, maybe similar to the KR20.

Yes, I've changed the HIWIN rail pitch to the proper 2mm :roll:

BTW those graphs are for illustrative purposes, I don't have the parameters to create a proper model for the setup. I just picked some values that look like they should represent a typical setup.

Edit: Here's a graph from the TMC-5130 data sheet that shows the velocity profiles.

https://www.trinamic.com/fileadmin/asse ... asheet.pdf

Image

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

rjlittlefield
Site Admin
Posts: 23561
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

Thanks for the further information.

Ramping at least the velocity just seems like an obvious thing to do. After all, we don't expect a car or a bike or even a runner to suddenly go from zero to max. Personally I'd probably ramp acceleration also (to minimize jerk), but whatever you're using seems to be working great.

Anyway, all my hands-on experience is with the StackShot, so I had no idea that the other controllers try for constant velocity. Thanks for clearing that up!

--Rik

Lou Jost
Posts: 5944
Joined: Fri Sep 04, 2015 7:03 am
Location: Ecuador
Contact:

Post by Lou Jost »

An interesting aspect of the WeMacro controller, perhaps facilitated by its use of constant velocity, is that it accurately predicts the total running time for a given stack, once the endpoints and waiting times are set. The predicted total time includes not just the waiting times but the travel times. That makes it possible to run independent camera shutter controllers that synchronize perfectly with the WeMacro steps. I use this when running my monochrome camera, which requires a computer to control it. AutoHotkeys controls this computer. A second independent computer runs the stacking device using the WeMacro controiler. The interval between frame capture, which I write into the AutoHotkeys script, is a mathematical function of the total time stacking time reported by WeMacro. The two computers then stay in synch.

The total stacking time is easy to calculate if velocity is constant, but could be very challenging to calculate otherwise.

Chris S.
Site Admin
Posts: 4042
Joined: Sun Apr 05, 2009 9:55 pm
Location: Ohio, USA

Post by Chris S. »

Lou Jost wrote:An interesting aspect of the WeMacro controller, perhaps facilitated by its use of constant velocity, is that it accurately predicts the total running time for a given stack. . . .

The total stacking time is easy to calculate if velocity is constant, but could be very challenging to calculate otherwise.
Lou, FYI, the StackShot controller also predicts the total running time. It didn't originally, but the feature was added in a firmware update some years ago.

Some stepper motor code I wrote for Arduino includes user-adjustable ramping of motor speed up and down (in a much more rudimentary way than what Mike is doing), over a user-adjustable distance. In order to determine where to begin the ramp phases, I had to write a routine that pre-calculates the course of travel and writes elements of this to variables, before the motor begins to move. Since I'm already pre-calculating what the motor is going to do, predicting running time would require just a few more lines of code and a bit of empirical measurement. I suspect that the folks who make macro photography controllers face much the same need as I did here, and have likely attacked it in a similar way. So I don't think it would be difficult to incorporate both ramping and time prediction in a controller.

Also, if one wanted especially exact timing enough to pay a small cost in speed, a timer function could be called in the code, to make events happen at precise intervals, which could be chosen to be just a bit longer than what the hardware is capable of. Pretty easy stuff. :D

--Chris S.

Lou Jost
Posts: 5944
Joined: Fri Sep 04, 2015 7:03 am
Location: Ecuador
Contact:

Post by Lou Jost »

I hadn't updated the Stackshot controller; thanks for that news! And yes, I see, timed events would be a nice simple way to control the timing.

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

rjlittlefield wrote:Thanks for the further information.

Ramping at least the velocity just seems like an obvious thing to do. After all, we don't expect a car or a bike or even a runner to suddenly go from zero to max. Personally I'd probably ramp acceleration also (to minimize jerk), but whatever you're using seems to be working great.

Anyway, all my hands-on experience is with the StackShot, so I had no idea that the other controllers try for constant velocity. Thanks for clearing that up!

--Rik
Rik,

Starting and stopping in a jerky manner, like a constant velocity controller, can also cause missed or "slipped" steps. I have experienced this when I couldn't achieve an in focus image at the staring point when moving the rail around and returning to the start. I thought is was the focus rail or fixtures, after some time I traced it to a few missed steps by the motor upon beginning a new movement. Since this was a constant velocity controller I had to reduce the velocity setting and make things slower. Agree that velocity ramping is the obvious solution for constant velocity problems like this jerky behavior.

Another way to think of this is the entry angle to final position, if the position trajectory is shallow, then exciting resonates is lower as is the possibility of missed steps , same for exit from start.

With multiple ramp rates like shown above you can tailor the profile for nice motor behavior at start, stop and transition (BTW the KR20 with NEMA17 400 step motor profile doesn't quite look like this).

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

Post Reply Previous topicNext topic