From: W. Trevor King Date: Thu, 18 Nov 2010 19:57:30 +0000 (-0500) Subject: Add MultiMode/stepper post. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cd94dc91338cf77ae72057a33ac91b1d7ae6284e;p=blog.git Add MultiMode/stepper post. --- diff --git a/posts/MultiMode.mdwn b/posts/MultiMode.mdwn index a52c540..7774bc9 100644 --- a/posts/MultiMode.mdwn +++ b/posts/MultiMode.mdwn @@ -7,7 +7,7 @@ I've done a good deal of troubleshooting to keep our ancient MultiMode II, stumbling along. If you're in a similar situation, check out my notes on: -* [[Stepper motor control]] +* [[Stepper motor control|stepper]] * [[Photo-diode signal access]] * [[MultiMode internals]] * [Closest thing][connection] to a description of the diff --git a/posts/MultiMode/stepper.mdwn b/posts/MultiMode/stepper.mdwn new file mode 100644 index 0000000..0d27250 --- /dev/null +++ b/posts/MultiMode/stepper.mdwn @@ -0,0 +1,139 @@ +[[!meta title="Stepper motor control"]] + +Why +=== + +When I joined Prof. Yang's group, the [LabVIEW][] software controlling +the experiment lacked control of the stepper motor which provides +coarse `z` axis control. This made it difficult to set up the fluid +cell and meant that leaving the system running unattended for over an +hour could place unnecessary strain on the `z` piezo (as it would need +to compensate for thermal drift on its own). + +[LabVIEW]: http://www.ni.com/labview/ + +How +=== + +After a staring into the bowels of the [[MultiMode]] AFM and watching +some of the more suspicious lines on an oscilloscope, I saw that lines +1, 2, 15, and 16 were the stepper motor drive lines and guessed that +they were TTL compatible. A short while later (wink), the LabVIEW +code was up and running. The LabVIEW computer (via a PCI-6052E card +and BNC-2090 box) writes TTL stepper motor currents to the relevent +lines on the Nanoscope↔Multimode cable using our break-in box. + + Computer <-> Breakout box <-> MultiMode + NanoScope <------^ + +Part list (outdated commercial parts linked to the current generation): + +* LabVIEW 7.1 (in-house software) +* [PCI-6052E](http://sine.ni.com/nips/cds/view/p/lang/en/nid/2601) +* [BNC-2090](http://sine.ni.com/nips/cds/view/p/lang/en/nid/1177) +* Nanoscope IIIa (altered) +* Homemade break in box +* [[Multimode II AFM]] + +Breakout box +------------ + +Build a DB-25 breakout box, such as the ugly hack job shown +below. This gives us access to the stepper motor drive-lines. + +[[!img break_in_box.jpg size="500x" + alt="Break in box for Nanoscope-Multimode cable" + title="Break in box for Nanoscope-Multimode cable"]] + +Control the motor +----------------- + +First, you need something to write to your new motor control lines. We +are using the digital I/O lines from this [National Instruments][NI] +PCI-6052E. + +Next, you need to send the proper signals down the lines. +[Prof. Douglas Jones][DJ] has an excellent [stepping motor +tutorial][tutorial], which explains [how to drive a unipolar stepping +motor][drive]. For basic operation, you just need something like this +pseudo-code: + + step( up? ) { + static int index=0; // saved between function calls, only initialized once + int output[] = {sink 1a, sink 2a, sink 1b, sink 2b}; // the output array + if (up? == TRUE) { + index = (index + 1) mod 4; + } else { // down + index = (index - 1) mod 4; + } + write( output[index] ); + } + +For my Multimode, the motor steps 'Up' when I equate: + + + + + + + +
DB-25Role
11a?
21b?
152a?
162b?
+ +Problems +======== + +The stepper motor, like any other mechanical linkage, can have +problems with [[backlash]]. + +Figuring it out +=============== + +[[!img multimode_interior_0.jpg size="500x" + alt="The interior of the Multimode chassis with the main PCB removed" + title="The interior of the Multimode chassis with the main PCB removed"]] + +[[!img multimode_main_board_chips.jpg size="500x" + alt="The main board of the Multimode" + title="The main board of the Multimode"]] + +General stepper motor wiring +---------------------------- + +If you look back at the MultiMode interior and main board (above), you +can see that there are wires coming from the stepper motor, going into +the connector board, and (presumably) ending up at the main MultiMode +board. Opening up your own MultiMode (until I get some better +pictures up), you will see that the motor has 6 leads: green, brown, +black, red, yellow, and orange. A few seconds with your ohm-meter, +and you'll find the resistances between the leads are either 20 or 40 +ohms. I've recorded the resistances in the following table: + + + + + + + + +
BrownGreenBlackYellowRed Orange
Brown 20 40 Inf. Inf.Inf.
Green 20 Inf. Inf.Inf.
Black Inf. Inf.Inf.
Yellow 20 40
Red 20
+ +Browsing through Prof. Jones' tutorial, we see that our motor is +probably [unipolar][] with a total winding resistance of 40 Ohms on +each winding. + +Looking closely at the stepper motor, you can see (upside down, near +the right hand screw) that it is labeled `5 V DC`, and `5 V` over a +`20 Ohm` half-winding gives a current of `I = V/R = 0.25 +Amps`. Following the motor leads back up the the main board (using the +ohm-meter guess-and-check method :p), we find that they come from the +DS3658N (chip 1). This chip takes care of all the details of sinking +the large motor currents given a TTL driving pattern. + +WARNING! I strongly suggest you don't do this on your own. The high +voltage lines for driving the piezo are potentially dangerous, + +[NI]: http://www.ni.com/ +[DJ]: http://www.cs.uiowa.edu/~jones/ +[tutorial]: http://www.cs.uiowa.edu/~jones/step/ +[drive]: http://www.cs.uiowa.edu/~jones/step/types.html#unipolar +[unipolar]: http://www.cs.uiowa.edu/~jones/step/types.html#unipolar diff --git a/posts/MultiMode/stepper/break_in_box.jpg b/posts/MultiMode/stepper/break_in_box.jpg new file mode 100644 index 0000000..a05428d Binary files /dev/null and b/posts/MultiMode/stepper/break_in_box.jpg differ diff --git a/posts/MultiMode/stepper/multimode_interior_0.jpg b/posts/MultiMode/stepper/multimode_interior_0.jpg new file mode 100644 index 0000000..23b06ec Binary files /dev/null and b/posts/MultiMode/stepper/multimode_interior_0.jpg differ diff --git a/posts/MultiMode/stepper/multimode_main_board_chips.jpg b/posts/MultiMode/stepper/multimode_main_board_chips.jpg new file mode 100644 index 0000000..ab465fc Binary files /dev/null and b/posts/MultiMode/stepper/multimode_main_board_chips.jpg differ