NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Project Help and Ideas » Three axis digital read out with serial communication to a PC on mill

December 31, 2011
by sask55
sask55's Avatar

Recently I have designed and installed three axis digital read out with serial communication to a PC on my Busy Bee B1977 mill. The NerdKits Tutorial www.nerdkits.com/videos/digital_calipers_dro/ covers a lot of the general ideas and concepts that I incorporated into my design. I encountered a number of significant points that where not directly addressed in the tutorial. In the event that someone else may be thinking about doing something along these lines some of this info may be helpful.

Calliper selection.

The B1977 mill has a Z-axis (vertical spindle travel) travel of just over 5 inches. The Y-axis table travel is just over 7 inches and X-axis is about 17 inches. Two of the dimensions are greater than 6 inches and therefore required callipers longer then 6 inches so as not to restrict the movements of the table. I found that callipers longer that 12 inches are very expensive. I decided to use two shorter clippers connected together to report the position of the X –Axis. As a result of that decision I have a total of 4 independent callipers incorporated into the design. I used a six inch calliper on the Z-axis, an 8 inch calliper on the Y-axis and both a 6 inch calliper and a 12 inch calliper on the X-axis.

Calliper connections.

I have made use of telephone cord extender cables with there crimped on connectors. These 6P4C plugs are simple easy to use and lock in place to help reduce unintended disconnects. The extender cable are inexpensive widely available and seem to work fine for the job. They give a flexible, reliable and reasonably rugged plug in connection system between the Nerdkit board and the callipers. There are no actual pins to connect to on the calliper; rather there is a set of 4 small copper pads under the small plastic cover adjacent to the battery cover on the calliper. I soldered the wires from a cut off telephone extender cable directly to the calliper board. I then secured the cable to the callipers using a bit of hot glue. This gives a secure yet somewhat flexible connection to allow for movement of the callipers.

calliper conections

Calliper communication

Over a period of several years I have purchased eight callipers from four separate suppliers, two located oversees, one in the US and one in Canada. The first calliper that I purchased years ago has the type of protocol described in the Nerdkits tutorial. All of the others are as described at www.nerdkits.com/forum/thread/683/ . Since all of the callipers that I have purchased look virtually identical, I don’t think that it would be possible to predetermine what communication protocol an individual calliper may be using by looking at it.
All the callipers used in my project are sending serial data/clock signals using the 24 bit protocol. Using a scope I have measured a number of details about timing of the data from the callipers. Individual calliper clock timing does vary somewhat but typically each 24 bit data cycle takes about 8.5ms. With the quite period between data sets of about 108ms, resulting in each calliper “transmitting” its current position at about 116ms intervals. That is less then 9 possible reads per second from each calliper. To make the situation worse the clock timing on my 8 inch callipers (the only unit that looks slightly different from the others) is slower yet, about half as fast. The 8 inch calliper transmits each 24 bit data set over about 16.1 ms with a 215 ms total cycle interval when including the quite period between data sets. I have not discovered any way to alter the timing from these callipers by pull any of the calliper “pins” ether high or low, so no Hi-speed readout mode is available. These callipers do not have any provision, from the pins, to reset to zero. In order to reset I interrupt the power supplied to the calliper for a short interval effectively restarting the calliper after which the current position is zero. Do to the relativity slow and sparse rate of data availability from the individual callipers response time is noticeably delayed on both the PC screen and the LCD.

Reading from four callipers with the Nerdkit.

I found that with the four callipers sending data according to their own independent clock timing cycles, data clashes and read error where inevitable, periodical and difficult to handle at the micro. Also; I did to wish to dedicate 8 pins on the micro solely to calliper reading if I could avoid it. In order to help alleviate this issue I decided to read the callipers in two sets of two. That is to say the micro reads two callipers simultaneously using separate sets of clock and data input pins for each calliper at the micro. Then after a valid position is recorded for each of those two callipers, the micro selects, by hardware, the other two callipers and read their positions using the same four input pins on the micro. This compromise seams to adequately split the difference between four sequential calliper reads, that would be less than half as fast, and four simultaneous reads that tends to be congested and error prone. I have considered using a pin level interrupt algorithm to read the callipers but because of the nature of the data /clock signals and the four independent clock rates periodically overlapping the signals, I believe it may be very difficult to achieve better results than I am getting now.

Callipers timing out.

After a few minutes if the position of a calliper is not changed they will time out. The display on the calliper itself goes blank. It looks as if it has been turned off. Fortunately, the data and clock signals for the current position are still available on the calliper output “pins” and so readings remain valid. This is true of all but the problematic 8 inch Y axis calliper. When the Y axis calliper times out both the clock and the date pins go high and stay there for several minutes, after that they both drop to zero volts. If the position of this calliper is moved the calliper does come to life and resumes transmitting correct data/clock pulses for its current position. I have found it difficult to design an algorism, on the micro, that can successfully distinguish the difference between the Y axis calliper timing out and a possible loss of signal from that calliper do to some mechanical connection problem.

mill X Axis Y axis Z Axis

Mounting the callipers

I did not take any pictures of the calliper as I installed them on the mill. The Y axis calliper is located adjacent to the Y axis feed screw under the table. It is difficult to get a glimpse of it let along take any kind of interesting photo showing how it is installed. The Z axis is mounted in a similar location to the Nerkits tutorial. Do to space limitations and other mechanical issues I ended up mounting the X axis callipers in front of the table. That location is not ideal as they are out in the open and subject to damage.

Schematic

As it is now I am using temporary prototype circuit board. I intend to make a permanent LCD display panel with three momentary close type reset buttons adjacent to the screen. This control box will be mounted on the mill near the motor control switch. Before deciding on the size and shape of that control box I would like to have very good idea of the size of the final printed circuit board.

Curcuit computor

The Excel GUI.

I am using and excel sheet to communicate with the Nerdkit. http://www.nerdkits.com/forum/thread/1880/ for more information. The processing and display potential of the PC was very much underused, with data reported from the callipers coming at relatively long intervals. I decided to add more functionality and provided more detailed information on the PC screen. I built a GUI using the excel sheet that is continually being updated as the calliper reading information is delivered to the PC on the serial connection. The physical positioning of some of the callipers makes it very difficult to access the buttons of the callipers themselves. I have incorporated a reset button for each axis on the LCD panel and also on the PC screen. I have also provided a check box for each axis on the PC screen that enables the user to disable reading from a selected callipers pair. By disabling reading from callipers that are in a fixed position the user can increase the rate of data reads on the remaining pair, thereby reducing the delay times noticeably. I have posted a screen capture of a typical example of the excel sheet. The comment boxes do not actually appear on the working excel sheet, I have added them in an effort to clarify what the functions of the user selectable features are. The screen shows the current position, measured as the distance from the reset point in mm and decimal inches. It also shows the nearest fractional inch both greater then and less then the current position. All the displayed information is updates approximately 2 to 5 time per second when reading all four callipers. The rate of calliper reads displayed depends to great extent on chance, depending on where in their data cycles each callipers is when the micro beginners to pole each pair of callipers for their current positions. The rate is adequate for manual movements but may cause some issues if I ever get around to adding CNC to this Mill and want to use this system to verify movements.

screen shot

Using the X-axis on the screen shot as and example.

The user has selected Left as positive. For the screen shot, the cursor was on the fractional limit cell for the X axis therefore the drop down list is visible. 1/16 inch has been selected from the available fractional limits as the smallest fraction to be displayed. The current position is 35.330mm or 1.3909 inches to the left of the zero position. When expressed in fractional terms, to the nearest 1/16 that is 1 + 3/8 + .016 inches, or 16 thousands past 1 and 3/8. That is also 47 thousands to the right of 1 and 7/16. The movement size has been set by the user to 3/16 or 0.188 inches. Since this desired number is being entered into a spreadsheet cell it can be entered as a formula, in this case { =3/16}. We can see that the movement of the X coordinate from the zero position has passed 7 points that are evenly divisible by 3/16 and that the nearest 3/16 increments to the left (+) is 0.109 inches and the nearest to the right ( –) is 0.078 inches away from the current position.

In concussion.

This has been an interesting project for me. Faster calliper communication would be nice, as a whole it is working very well. I have found the on screen info useful. I am contemplating whether to take a shot at printing, etching and drilling my own printed circuit board for this mill, or send out a file and get it done for me. I am also looking into what size stepper motor would be adequate if I decided to set up CNC control on this mill. There seams to be a considerable degree of disagreement, on line, about how to size the steppers. Measuring the torque requirements is not that strait forward. I would appreciate it if anyone has any experience, comments or wisdom that they would like to share.

Darryl

December 31, 2011
by Ralphxyz
Ralphxyz's Avatar

Darryl, fascinating thank you so much.

Would having multiple mcus (one for each caliper) help?

I think this is exactly where having parallel processing would help.

Of course we have another thread where I had suggested the same.

As far as stepper motor sizing please keep us posted with what you find as all I have found is confusion.

I would hope you would post your final project to the Nerdkit Community Library.

The library just makes a more centralized location for this type of project, you could just repost this posting or at least a link.

Thanks again, I had looked at doing something like this and had seen some of the shortcomings you saw so this saves me a lot of work.

I was even thinking of springing for a 24" caliper, I'd like more detail on how you combined the calipers.

Ralph

January 01, 2012
by sask55
sask55's Avatar

Ralph,

I think that it would likely work well to use two or possibly three mcus. I don’t seem to have much problem now having the existing micro monitor two callipers simultaneously. Although the read time for any set of simultaneously read callipers is dictated by the slowest calliper so by putting the slow Y axis on a separate mcus would increase the number of possible reads from the others. I ended up using the old 7402 TTL chips I happened to had on hand, eliminating that MUX would be a sensible idea. It would be a lot more modern not so 1980 in design.

Originally I did have a slave miro mounted on the prototype board for this project, My intention was to use a second mcus to control three stepper motors for CNC. In the past I have gained precise control of the 12 sets of windings on three small steppers. I am able to step or half step in either direction using command code sent for an excel sheet. Using vba code it is relatively straight forward to control the speed and distance for each motor movement with a few buttons on the excel sheet.

At this point I am not certain that I am going to control any CNC motors thru the micros I may just purchase a power supply / controller unit complete with provisions for PC connection and software when I order the stepper motors.

So; as you can see this is still a work in progress. If I ever get it completed I will likely post to the community calendar.

As far as using two combined callipers is concerned, I simply bolted the ends of the two callipers together between the two calliper read out units. Fix one unit to the mill frame the other to the table. As the table is moved one or the other calliper slides it does not matter which. In the software I just add the two reading. The sum of the two reading is an accurate representation of the movement of the table.

A larger image of the X axis callipers mounted on the mill. two callipers on x- axis

Darryl

January 01, 2012
by Ralphxyz
Ralphxyz's Avatar

Gosh just bolting the two calipers together was what I had envisioned but I thought surely it had to be harder to do than that.

Of course I'd also like details about how you made up your XY table. Is this made from scratch or is it store bought?

Harbor Freight has 5" Milling Vice for $69.99.

It moves 7-1/8" x 6-1/8".

Your table is bigger than that but even that would work for me at this time.

I can picture hooking some stepper motors and a 3hp router and making up my own mill.

It would be nice to do CNC.

Hey Rick what do you think? I know CNC is your line of work.

Ralph

January 01, 2012
by Rick_S
Rick_S's Avatar

I think if I were going about it, I'd either build a basic machine from scratch and use a stepper/driver kit, or I'd just buy a small cnc mill. Hobby grade cnc mills can be had for under $5000. Obviously if you just want basic routing abilities, a home-made mill could be built for much less.

The machine he has up there is a small vertical mill. You can buy cnc retro kits for most small vertical mills but building your own might be fun. Keep in mind, you will need decent guide ways, screws, and strong stepper/servo motors to position accurately.

What are you wanting to make? I was thinking of building up something small scale to engrave circuit boards and drill them as an alternative to etching. It would be a big project though to do it an have it be accurate and repeatable.

Rick

January 01, 2012
by sask55
sask55's Avatar

Rick

I understand that you and some of the others that follow this forum have a lot of experience working with CNC machines of various sizes. So I would greatly appreciate it if you would elaborate just a little on some of your comments. I realize that it is not possible for anyone to state positively what might be the needed but if you could just make general comments I would be great.

A quick overview of what I am thinking about. If possible, I would like to design the mounting hardware and mount the drive motors on my mill in such a way that I can still use the manual dials. I would like to modify the mill to use for engraving and drill circuit boards if possible.

I am thinking a small router or large dremel type electric tool could be solidly and temporarily attached to the vertical spindle. This addition should give me the much higher spindle speeds used on very small and delicate work. It would be great if I could end up with a system the would allow such fine work. Idealy the CNC motors would have the torque required to carry out auto feed for surface and end mill work when I am milling. As I said earlier I am looking at purchasing a controller/power supplier and motors combination set. They are available in a wide range of motor sizes.
Here are a few questions that I have.

Is it reasonable to expect the accuracy and repeatability from a small inexpensive vertical mill like mine to do circuit board type of work?

What would be considered a decent screw, are acme thread ok or is ball screw likely to be essential?

Would a direct drive motor shaft connection be required, or could I use a cogged belt drive to simplify retaining the manual dials?

If I use a cogged belt drive would a one to one ratio be used or should I consider a design with a mechanical advantage to increase possible torque to the screws?

There are stepper motor kits available with holding torque ratings that range from less than 50 to 1600 once inches. I have no idea how to estimate what size would be adequate without spending much more than is likely to be required.

I realize that none of this has much to do with electronics and I should probably find some machining forum, but there are a number of regular contributors to this forum that I feel may have some valuable insight to my questions.

Thanks

Darryl

January 02, 2012
by Rick_S
Rick_S's Avatar

Is it reasonable to expect the accuracy and repeatability from a small inexpensive vertical mill like mine to do circuit board type of work?

A small inexpensive mill can do decent work as long as it's ways, gibs, and screws are all in good shape. In other words, the table can't crab much at all, the table has to move smoothly, and there can be little to no endplay in the screw.


What would be considered a decent screw, are acme thread ok or is ball screw likely to be essential?

Ball screw would by far be the best, but not required. Acme screws can come in two arrangements. The common setup on an inexpensive mill would be a single nut fixed to the table with a screw (connected to your handle) that move the table. While this setup works and can be accurate, it tends to build up endplay as the nut wears. This is noticed when you can move the table one way but when you go to move it back the other way the handle will rotate quite a distance before the table moves. This is not good for CNC. You need little to no endplay (less than .001). Often a CNC machine will have preload on the screw so there is zero endplay.

A better Acme screw setup is when the table has two nuts one of which can be rotated independantly to remove the endplay.

Another problem older mills have is they develop wear in the screw itself in the areas of common usage. So if the nut is replaced, you may still have endplay at parts of the screw (where the wear is) and none at the other parts. If this happens, the screw itself needs either replaced or reconditioned.


Would a direct drive motor shaft connection be required, or could I use a cogged belt drive to simplify retaining the manual dials?

You can go either way just make sure that your dials have a disengage so that when the machine is being driven by the motors the dials aren't - this is for safety. You don't want to be hit by a rotating handle.


If I use a cogged belt drive would a one to one ratio be used or should I consider a design with a mechanical advantage to increase possible torque to the screws?

It depends on what you need. You can go either way. Even some large CNC machines use cogged belts to drive the screws. If you use the Mach III software I'm pretty sure it has perameters for motor to screw ratio to account for this.


There are stepper motor kits available with holding torque ratings that range from less than 50 to 1600 once inches. I have no idea how to estimate what size would be adequate without spending much more than is likely to be required.

The easiest way I could think of to determine this would be to purchase a spring bar type torque wrench and feed the machine with it to see how much torque is required. You will most likely see your most torque in the initial move, and when under load cutting.

Don't forget about table locks too. With the CNC, they most likely will not be used so your motors have to have enough holding power to prevent the table from pushing when under load as well.

Other than that, I'm not too sure what would be needed or how to go about it.

Of course, I may be WAY over thinking this all based on my profession, I know how it is done in industry but what would really work??? I've seen some pretty funny setups on youtube that seem to do the job fine. (Probably not very long though)

Rick

January 02, 2012
by sask55
sask55's Avatar

Rick

Thanks: That is exactly the kind of information I have been looking for. I am going to ask around see if I can borrow a very small torque wrench if that fails I will look into buying one. Most of the torque wrenches now seem to be the set and snap indicator type a spring bar would be best if I can find one. Even my smallest torque wrench is not suitable for this application. In fact I have never even seen a torque wrench that is so small and sensitive. We typically do torque measurements at a completely different scale in dozens or often hundreds of foot pounds not a few once inches.

Thank again. This is a very interesting and helpful forum.

Darryl

January 02, 2012
by JKITSON
JKITSON's Avatar

Rick Thanks for the detailed info. I have a 1930's milling machine that I have been considering adding power feed to. It has XYZ axis on the table and also XYZ axis on the head. Also the head will rotate + or - 90' left or right. It is an old FRAY made in California.

Thanks for your help & ideas.

Jim

January 02, 2012
by Rick_S
Rick_S's Avatar

Was that old machine originally belt driven or did it have a motor? How big is it? It almost sounds like it should be in a museum. A lot of machines from that era have long since made it into scrap iron.

Rick

Post a Reply

Please log in to post a reply.

Did you know that NerdKits has been featured in the MIT Undergraduate Research Journal? Learn more...