Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 24, 2024, 01:09:33 13:09


Login with username, password and session length


Pages: [1]
Print
Author Topic: Mitutoyo Digimatic Interface for Gages/Calipers.  (Read 37630 times)
0 Members and 1 Guest are viewing this topic.
Matrixx
Junior Member
**
Offline Offline

Posts: 37

Thank You
-Given: 68
-Receive: 37


« on: April 19, 2010, 05:08:22 17:08 »



This is a simple Mitutoyo Digimatic interface to use an IDU25E digital gauge to capture readings and send it to Pc. As comercial converters are someway expensive ($200 to $500), I decided to dig and make my own. I'm using BascomAvr as compiler.

The interface works with many other digital gages from Mitutoyo that uses the Digimatic SPC protocol.

The calipers or gages have a 5 pin receptacle. You can get the original connector or weld some wires, but I recommend try to make the connector or buy the cable. The cable ends to a simply IDC10 female so you can use a IDC10 pin header or cut the IDC10 and use one of your predilection. The gage uses only 4 wires.

There are some pics on how to make cable here:
http://easyread-tools.com/

Looking the cooper tabs at the caliper, from left to right the pins are numerated as:

1: Ground
2: Data
3: Clock
4: not used
5: /request    <--- Warning! Do not pull to more than 1.5V

Because I had it in my drawer, I'm using a ATMega2560 module purchased from Bipom. As it has screw terminals for the ADC inputs, I have configured it as regular Inputs to make my interface. M2560 is a 'huge' resource to do this, so I think a 90S2313 could do the job easily.



Clock and Data can be pulled high to 5V using the internal pullups from the M2560. /Request pin should not be pulled high to 5V, instead I used a NPN transistor to isolate it from the 5V TTL level from the Atmel. If you pull to 5V you could damage your gage, I warn you  Wink

From Don Lancaster's Tech Musings #145:
"Your gauge then answers by outputting a 52 bit data sequence. Each clock pulse stays a minimum of 100 microseconds high and then has to remain 100 microseconds low. For a 5 kHz max clock rate. While the data is valid during the entire clock low time, it should get entered into an interface on the rising edge of the clock. Clocking continues until all 52 data bits are output."

You can read the article here (NOTE: I do not agree with the Fig.1 2x5 header pinout from Don as my cable does not have the pins this way, it simple is wired 1 to 1, 2 to 2, 3 to 3, etc):
http://www.tinaja.com/glib/muse145.pdf

The gage send a 52 bit paket when you pull the /request pin to low. If you keep that pin low, the gage sends the paket repeatdly. So in the firmware I decided to set the /rqst pin low and then wait for the 1st clock pulse to appear, then I release the /Rqst. That way I let the /rqst pin the required time to sent the paket, but just the need time. I read the data whaen clock is low, and that works fine. It needs optimization but it works for now Tongue

NOTE: This is not a I2C format because there are no ACK, just a stream of bits.[/i]

The 52 bit paket is divided in to a 13 4-bit BCD. Aditionally, the bytes orde-inverted, LSB is sent first so I had to swap the bits before convert it to BCD-Byte.

I'm using a FootSwitch to trigger the readings. Please add a ceramic capacitor at the switch, in parallel, value 0.1uF to eliminate bounce. My output is at 19,200 using the COM0 RS232 built in on the Bipom module. If you use another stand alone chip, remember to translate the TTL level to RS232 before connecting with the PC!

My output is simply the reading values. If you want to translate it to the  format from Mitutoyo Multiplexers, drop a mail  Wink









« Last Edit: April 28, 2010, 02:38:23 14:38 by Matrixx » Logged
fernandodiaz
Junior Member
**
Offline Offline

Posts: 73

Thank You
-Given: 1
-Receive: 18


« Reply #1 on: April 19, 2010, 07:57:40 19:57 »

HERE ONE MORE WITH PIC  TO RS232 NO NEED RESISTENCE AND COMPONENTS

http://www.sonsivri.com/forum/index.php?topic=5798.0
« Last Edit: July 03, 2011, 04:09:17 16:09 by fernandodiaz » Logged
kalpakchiev
Active Member
***
Offline Offline

Posts: 137

Thank You
-Given: 34
-Receive: 68



« Reply #2 on: April 20, 2010, 04:53:34 04:53 »

Hi Matrixx,
I have a digital caliper with output port, but I always wondered for what can be used this data data if I build the cable?
« Last Edit: April 20, 2010, 04:58:06 04:58 by kalpakchiev » Logged

A known mistake is better than an unknown truth.
Matrixx
Junior Member
**
Offline Offline

Posts: 37

Thank You
-Given: 68
-Receive: 37


« Reply #3 on: April 20, 2010, 01:14:47 13:14 »

Hello kalpakchiev,

The data port is to get the readings from the caliper, just to save the work of write down each one, I guess..   or maybe to use a bigger display.

In a process where you use the gaguge or caliper to get say 100 reads is nice to capture the readings and save it to file.

I will post the Software, a little app to collect the above interface data   : )
Logged
kalpakchiev
Active Member
***
Offline Offline

Posts: 137

Thank You
-Given: 34
-Receive: 68



« Reply #4 on: April 20, 2010, 04:38:55 16:38 »

Hi Matrixx, I should have asked you what are you going to do with collected data.
Best Regards.
Logged

A known mistake is better than an unknown truth.
Matrixx
Junior Member
**
Offline Offline

Posts: 37

Thank You
-Given: 68
-Receive: 37


« Reply #5 on: April 30, 2010, 02:27:59 14:27 »

Oh sorry  Tongue

I used the collected data as part of a manufacturing process where we measured deep changes on a slotted material, we measure thousands of datapoints daily. is a monitoring process.



Posted on: April 20, 2010, 06:59:05 18:59 - Automerged

kalpakchiev,

your spot welder is awesome!  when I have a chance I will start to build it  Smiley

( gee, I just sell a 1 Farad capacitor to flea market 1 week ago... )

Posted on: April 20, 2010, 10:29:22 22:29 - Automerged

I Tryed to make the AT90S2313 version but looks my JtagIce MkII doesn't like the 2313... need to use my old programmer but as my pc doesn't have parallel port, it will take a few days.
Logged
rajarduino
Inactive

Offline Offline

Posts: 3

Thank You
-Given: 2
-Receive: 4


« Reply #6 on: April 20, 2011, 04:37:13 04:37 »

I followed this tutorial (very clear, thank you, Matrixx), and used Arduino and the same Mitutoyo caliper.
Good results, although the data sampling rate turned out a little slow (hmm, wonder what I'm doing wrong... Although 10 samples per second isn't too bad!)

(Matrixx, if you still have the code from this project, do post your own code too.)

Here is my code in case anyone wants help with your own project; it's pretty straightforward and does the job but feel free to ask me any doubts about this!
Code:
int req = 5; //caliper REQ line goes to pin 5
int dat = 2; //caliper Data line goes to pin 2
int clk = 3; //caliper Clock line goes to pin 3
int iclk = 1; //pin 3 corresponds to interrupt number 1
int i = 0; int j = 0; int k = 0; int n = 0;

int mydata[52];

void setup()
{
  Serial.begin(19200);
  pinMode(req, OUTPUT);
  pinMode(clk, INPUT);
  pinMode(dat, INPUT);
}

void loop()
{
  if (n == 0) attachInterrupt(iclk, myisr, RISING);
    PORTD |= (1<<5); // digitalWrite(req, HIGH);
    delay(10);
    PORTD &= ~(1<<5); // digitalWrite(req, LOW);
    if (i > 51)
    {
      for (j = 0; j < 13; j++)
      {
        Serial.print("--");
        for (k = 0; k < 4; k++)
        {
          Serial.print(mydata[(j*4)+k]);
        }
      }
    i = 0;
    }
}

void myisr()
{
  if (i == 0) PORTD |= (1<<5); //digitalWrite(req, HIGH);
  if(i < 52)
  {
    mydata[j] = digitalRead(dat);
    i++;
  }
}
« Last Edit: April 20, 2011, 04:41:09 04:41 by rajarduino » Logged
solutions
Hero Member
*****
Offline Offline

Posts: 1826

Thank You
-Given: 656
-Receive: 905



« Reply #7 on: April 20, 2011, 06:45:29 06:45 »

I think these have an interface on them as well http://www.harborfreight.com/hand-tools/calipers-dial-indicators-micrometers/12-inch-digital-caliper-47261.html  ...at least the one I bought from them a while ago does.

Might make for a nice and cheap DRO for a CNC - does anyone know if the interface is the same as the Mitutoyo?  Where to buy the cable plug?

***EDIT*** PER GLITCH_INC'S links below, the Chinese calipers and DROs use a different connector and protocol than the Mitutoyo Digimatic: http://www.shumatech.com/support/chinese_scales.htm and the cables are available here: http://www.littlemachineshop.com/products/product_category.php?category=-561213210
« Last Edit: April 20, 2011, 04:41:15 16:41 by solutions » Logged
PaulC
Active Member
***
Offline Offline

Posts: 170

Thank You
-Given: 3935
-Receive: 133


information is free and should be shared for free


« Reply #8 on: April 20, 2011, 09:55:45 09:55 »

Hi Matrixx.
I think this project is excellent thank you.
I would be very interested in where you located your M2560 module from.
if it is possible could you post or send me the link to where it is.
Logged

find it , read it , share it .
Matrixx
Junior Member
**
Offline Offline

Posts: 37

Thank You
-Given: 68
-Receive: 37


« Reply #9 on: April 20, 2011, 03:46:27 15:46 »

Hello Paul,

I got the M2560 module from
http://www.bipom.com/products/us/851677.html

altough this is a big chip to do the job..  M32, M64, 90S2313 will work too.
« Last Edit: April 20, 2011, 03:49:05 15:49 by Matrixx » Logged
glitch_inc
Newbie
*
Offline Offline

Posts: 28

Thank You
-Given: 14
-Receive: 8


« Reply #10 on: April 20, 2011, 04:05:27 16:05 »

Not sure if this is of any help to anyone but I ran across this article some time ago and it resembles my Digital Caliper in that it only has 4 pins. Anyways knowledge is power and figured I'd share.

http://www.nerdkits.com/videos/digital_calipers_dro/
Logged
rajarduino
Inactive

Offline Offline

Posts: 3

Thank You
-Given: 2
-Receive: 4


« Reply #11 on: April 21, 2011, 12:03:50 00:03 »

@glitch_inc & @solutions,
some more detailed info regarding Chinese caliper output protocol:
http://pcbheaven.com/exppages/Digital_Caliper_Protocol/?topic=chinesebcd

@PaulC, you can also get the Arduino Mega platform (which uses the Atmega 1280/2560 chip), costs about $50, or Arduino Uno (uses Atmega 328p chip), costs about $30. Excellent investments for electronics projects like this, and have very good support community online.
See here for more info: http://www.arduino.cc

@all:
also, just a quick comment regarding my supplied code above if you use it:
Within each of the thirteen 4-bit packets, I got the 4 bits in reverse order, which is why I used a conversion function... so you need to do that as follows, maybe something like this if you store the 4-bit packets as strings:

Code:
int strtoint(String strtoconv)
{
  if (strtoconv == "0000") return 0;
  if (strtoconv == "1000") return 1;
  if (strtoconv == "0100") return 2;
  if (strtoconv == "1100") return 3;
  if (strtoconv == "0010") return 4;
  if (strtoconv == "1010") return 5;
  if (strtoconv == "0110") return 6;
  if (strtoconv == "1110") return 7;
  if (strtoconv == "0001") return 8;
  if (strtoconv == "1001") return 9;
  if (strtoconv == "1111") return 0; //technically speaking, this is 0x0F
}
« Last Edit: April 21, 2011, 12:13:04 00:13 by rajarduino » Logged
IZ2NZR
Active Member
***
Offline Offline

Posts: 141

Thank You
-Given: 125
-Receive: 654


« Reply #12 on: September 29, 2013, 12:48:40 12:48 »

Hi,
this is my first topic,
so advise me if I make something incorrect.

this is the project of a very simple USB interface, that I use with all digimatic series of digital calipers, comparators ecc. ecc.

It use only a pic18f2550, the internal comparators and the internal voltage reference.

it respond to a request on the com port.

each time it receive the sequence " !% " it respond with Digimatic read folloewed by !%.
this for a better resistance to errors.

if you need more informations, ask me.

sorry for my poor english.
« Last Edit: September 29, 2013, 07:18:21 19:18 by IZ2NZR » Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC