{"id":3762,"date":"2016-01-29T21:31:12","date_gmt":"2016-01-30T02:31:12","guid":{"rendered":"http:\/\/www.summet.com\/blog\/?p=3762"},"modified":"2016-04-11T20:52:23","modified_gmt":"2016-04-12T01:52:23","slug":"how-to-convert-a-denford-scantek-2000-micromill-to-linuxcnc-mach3-control-part-4-spindle-speed-control","status":"publish","type":"post","link":"https:\/\/www.summet.com\/blog\/2016\/01\/29\/how-to-convert-a-denford-scantek-2000-micromill-to-linuxcnc-mach3-control-part-4-spindle-speed-control\/","title":{"rendered":"How to convert a Denford \/ ScanTek 2000 Micromill to LinuxCNC \/ Mach3 control: Part 4 \u2014 Spindle Speed Control"},"content":{"rendered":"<p>In <a href=\"http:\/\/www.summet.com\/blog\/2016\/01\/16\/how-to-convert-a-denford-scantek-2000-micromill-to-linuxcnc-mach3-control-part-1-3-axis-control\/\">part 1<\/a> of this series I showed how to get the X\/Y\/Z steppers moving. In<a href=\"http:\/\/www.summet.com\/blog\/2016\/01\/17\/how-to-convert-a-denford-scantek-2000-micromill-to-linuxcnc-mach3-control-part-2-home-switches-e-stop\/\"> part 2<\/a> I hooked up the home and estop switches. In <a href=\"http:\/\/www.summet.com\/blog\/2016\/01\/17\/how-to-convert-a-denford-scantek-2000-micromill-to-linuxcnc-mach3-control-part-2-home-switches-e-stop\/\">part 3 <\/a>I got the spindle go relay working so that I could turn the spindle on (at full speed) or off. In this post, I will show how to get PWM speed control of the spindle working.<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube-nocookie.com\/embed\/CFH58YUjX5U?rel=0\" width=\"480\" height=\"360\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>The Balfor NextMove ST card has an output (SOUT &amp; SGND) line that provides an isolated 0-10 volt signal (at low current) suitable for controlling a spindle motor driver board. (0 volts is stopped, 10 volts is full power) In the bottom left of the picture below you can see the small blue and red wire leading away from SOUT &amp; SGND.<\/p>\n<p>It does this by using a DC\/DC converter (NME0512D) to provide an isolated (floating) 12 volts, referenced to the SGND connector. A TLC272C OpAmp chip integrates a PWM signal (taking into account an offset adjustment from R35, the boxy blue variable resistor near the SGND\/SOUT pins) into a 0-10 volt signal.<br \/>\n<a href=\"http:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/HV_analog_0-10_output_circuit.jpg\" rel=\"attachment wp-att-3763\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-3763\" src=\"http:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/HV_analog_0-10_output_circuit-768x1024.jpg\" alt=\"HV_analog_0-10_output_circuit\" width=\"584\" height=\"779\" srcset=\"https:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/HV_analog_0-10_output_circuit-768x1024.jpg 768w, https:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/HV_analog_0-10_output_circuit-225x300.jpg 225w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><br \/>\n<!--more--><\/p>\n<p>The PWM signal is fed via an Avago HCNW4503 optocoupler. Pins 5-8 are on the isolated output side while pin 2 is the anode (+5 volts) and pin 3 is the cathode (GND) of the LED inside the optocoupler that works at logic level with the rest of the Balfor board.<\/p>\n<p>If you have to buy this circuitry on an adapter board it typically costs around $45-50, so I wanted to re-use it if possible. I was hopeful that the input to the optocoupler would be exposed on the 96 way connector (or the 50 way connector on the left side of the board) so that I could just plug into them. Unfortunately, this is not the case.<\/p>\n<p>Pin 2 is tied directly to +5V, and the optocoupler is made active by grounding pin 3. Pin 3 does not lead to any external pin. I took the board off its mounting plate to try and trace where it did go, only to find that it was a 4 layer circuit board, and all the &#8220;interesting&#8221; traces were hidden on the inside.<\/p>\n<p><a href=\"http:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/board_removed_completely.jpg\" rel=\"attachment wp-att-3764\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3764\" src=\"http:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/board_removed_completely-300x225.jpg\" alt=\"board_removed_completely\" width=\"300\" height=\"225\" srcset=\"https:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/board_removed_completely-300x225.jpg 300w, https:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/board_removed_completely-768x576.jpg 768w, https:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/board_removed_completely-1024x768.jpg 1024w, https:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/board_removed_completely-400x300.jpg 400w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n<a href=\"http:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/5V_plane_on_back.jpg\" rel=\"attachment wp-att-3765\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3765\" src=\"http:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/5V_plane_on_back-300x225.jpg\" alt=\"5V_plane_on_back\" width=\"300\" height=\"225\" srcset=\"https:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/5V_plane_on_back-300x225.jpg 300w, https:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/5V_plane_on_back-768x576.jpg 768w, https:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/5V_plane_on_back-1024x768.jpg 1024w, https:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/5V_plane_on_back-400x300.jpg 400w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Using my multi-meter in continuity testing mode, and 180 odd pins later, I finally got around to testing both sides of all of the surface mount resistors on the board and found that R29 (a 220 Ohm resistor) linked Pin 3 of the optocoupler to pin 12 of a big square IC surrounded by a white silk-screen box on the circuit board. It is a NEC 071054L-10 0417YKW37 a programmable timer\/counter. Pin 12 is one of it&#8217;s output pins.<br \/>\n<a href=\"http:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/programmable_counter_timer.jpg\" rel=\"attachment wp-att-3766\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-3766\" src=\"http:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/programmable_counter_timer-768x1024.jpg\" alt=\"programmable_counter_timer\" width=\"584\" height=\"779\" srcset=\"https:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/programmable_counter_timer-768x1024.jpg 768w, https:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/programmable_counter_timer-225x300.jpg 225w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p>Basically, the top board would program this chip to output a specific PWM signal every time it wanted to change the spindle speed. (Requring 8 data lines plus several control lines&#8230;.)<\/p>\n<p>Since I was not going to be able to route a PWM signal via an exposed pin, I decided it was time to do some circuit bending. I removed the surface mount resistor R29 (disconnecting Pin 3 of the optocoupler from the programmable timer\/counter chip) and soldered a 200 ohm resistor and a wire directly to Pin 3. (Covered in hot glue for strain relief&#8230;.)<\/p>\n<p><a href=\"http:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/deadbug_200Ohm_resistor_pin3.jpg\" rel=\"attachment wp-att-3767\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-3767\" src=\"http:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/deadbug_200Ohm_resistor_pin3-1024x768.jpg\" alt=\"deadbug_200Ohm_resistor_pin3\" width=\"584\" height=\"438\" srcset=\"https:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/deadbug_200Ohm_resistor_pin3-1024x768.jpg 1024w, https:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/deadbug_200Ohm_resistor_pin3-300x225.jpg 300w, https:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/deadbug_200Ohm_resistor_pin3-768x576.jpg 768w, https:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/deadbug_200Ohm_resistor_pin3-400x300.jpg 400w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/hotglue_covering_resistor.jpg\" rel=\"attachment wp-att-3768\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-3768\" src=\"http:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/hotglue_covering_resistor-768x1024.jpg\" alt=\"hotglue_covering_resistor\" width=\"584\" height=\"779\" srcset=\"https:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/hotglue_covering_resistor-768x1024.jpg 768w, https:\/\/www.summet.com\/blog\/wp-content\/uploads\/2016\/01\/hotglue_covering_resistor-225x300.jpg 225w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p>When this pin is brought low (inverted output) the voltage on the output climbs towards 11 volts (maximum power). I was able to plug this wire into my parallel port break out board pin 14 and using a PWM frequency of 100 Hz my LinuxCNC software is now able to control the spindle speed.<\/p>\n<p>I now have software control over all aspects of the Sherline CNC mill in my Denford \/ ScanTek Micromill 2000. (Replacing the proprietary top board with software control via the parallel port.)<\/p>\n<p>I&#8217;m mostly done, and plan on beginning work on the ScanTek Lathe that I purchased at the same time. Hopefully, now that I know what I&#8217;m doing, things will go much faster! Future improvements to the mill may include the addition of a &#8220;touch-off&#8221; plate\/sensor and a spindle speed sensor for closed loop spindle speed control. I am also working on fixing a bent spindle motor bracket.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In part 1 of this series I showed how to get the X\/Y\/Z steppers moving. In part 2 I hooked up the home and estop switches. In part 3 I got the spindle go relay working so that I could &hellip; <a href=\"https:\/\/www.summet.com\/blog\/2016\/01\/29\/how-to-convert-a-denford-scantek-2000-micromill-to-linuxcnc-mach3-control-part-4-spindle-speed-control\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[121],"class_list":["post-3762","post","type-post","status-publish","format-standard","hentry","category-projects","tag-micromill"],"_links":{"self":[{"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/posts\/3762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/comments?post=3762"}],"version-history":[{"count":6,"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/posts\/3762\/revisions"}],"predecessor-version":[{"id":3889,"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/posts\/3762\/revisions\/3889"}],"wp:attachment":[{"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/media?parent=3762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/categories?post=3762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/tags?post=3762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}