PDA

View Full Version : Reading and fixing Chinese scales



irving2008
17-02-2010, 12:13 PM
Picked up a pair of 8" and 12" scales for 30 the pair on ebay. I have read all the info on 'reading' the data stream and thats a no brainer, but whats taxing my brain at the moment are two things...

1/ how to connect to them. I know that several places do the remote display for these but no one wants to sell me the connector/cable on its own. I don't really want to solder wires to them (but if I have to I will...). The spacing seems to be 0.05" but where to find a suitable connector?

2/ How to fix to the mill? The 8" one will be used for the Y, the 12" for the X. Since my X travel is more than 12" (although I rarely use more) I will need some sort of release mechanism to allow motion of the table past the endstops of the scale. I was thinking about something magnetic, small button magnet type of idea. But would it be rigid enough to give accurate readiings?

Thoughts/ideas?

Peter Griffin
17-02-2010, 07:02 PM
You can get unbelievably powerful button magnets, however you need to be careful they don't affect the readouts.

irving2008
17-02-2010, 07:36 PM
yes i was looking at 12mm x 3mm with a 3kg pull! 10 for 4

I wouldn't have throught they would affect the readouts as these are capacitive glass on stainless steel and the readings don't seem to be affected by the small magnet I have here.

tumutbound
17-02-2010, 08:26 PM
Can't help with the mounting but the cables are available from Little Machine Shop (http://lmscnc.com/products/product_view.php?ProductID=1990&category=) or Wildhorse Innovations (http://www.wildhorse-innovations.com/index.php?_a=viewProd&productId=48).
there have been some complaints on the Shumatech Yahoo group about the reliability of these connectors.
I'm in the process of adding scales to my X2 mill and will be soldering the wires directly to the scale.
Some pictures of the scale mods can be found here (http://cnc.turkeys.net.au/workshop/scales/).

irving2008
17-02-2010, 09:01 PM
Geoff,

Thanks for that, the pics are useful, although the scales are not identical... i have yet to disassemble, but for a first pass I was going to leave the screens attached.

Cables... $27.50 for a cable :eek:, they are having a laugh!

Robin Hewitt
17-02-2010, 09:03 PM
I played with some Chinese scales. Didn't trust the 1.2v flea squeak signal to carry so I put pcb's on the back and buffered then to 5v.

I built hardware interface that did 3 scales and interrupted the processor whenever a full report was in and read it as 3 bytes from the shift registers.

They had 3 counts of jitter which was inconvenient if you didn't want to dump the bottom 2 bits altogether. The battery positive connected to the rule which was not exactly convenient, dragging a ground wire across the metal they were connected to sent them haywire so I had to try and insulate them from the machine with Tufnol. Was getting on pretty good then one of them switched to 5 counts of jitter and I rather gave up.

BillTodd
17-02-2010, 10:11 PM
I have made connectors for them, I've soldered 2mm(?) JRC box headed on them, in the end soldering a flying lead worked out best (I also junked the lcd and wrapped the whole case in adhesive backed foil to improve screening). Apparently the Chinese made lead is a poor fit in some scales (falling out at the slightest touch).

I hadn't thought of using magnets to mount the scale to the mill - It would certainly work but might attract too much swarf if not shielded well.


I have read all the info on 'reading' the data stream and thats a no brainer,
The problem is controlling the scale, to switch modes etc. (you really can't use the standard 300mS updates for a DRO) almost every type of scale I tried had a different sequence.

My PC & PIC based DRO project is here (if you haven't already seen it)

http://www.cnczone.com/forums/showthread.php?t=62704



I had to try and insulate them from the machine with Tufnol.Insulating doesn't work (BTDT) I run mine on a separate supply biased to -1v5 so the scale +ve can be grounded. It works well - I've been using it today :)

irving2008
17-02-2010, 10:36 PM
Bill, yes I'd seen your work... it was that that got me thinking...

Well I just dismantled the 6" one (its the same type as the 8 and 12) and its the same inside as Geoff's. I also discovered that you can get an extra 20mm past the marked scale. The reading heads are identical. Has anyone dismantled the actual scale bit to look inside? Similarly, has anyone found a source of the scale elements on their own? I found a firm selling the reading heads on their own.

Bill: I like your idea of grounding the scale and generating a -1.5v supply by offsetting the PIC supply. I think a simple -ve charge pump would do the job as well.

BillTodd
17-02-2010, 11:06 PM
I also discovered that you can get an extra 20mm past the marked scale. .... Has anyone dismantled the actual scale bit to look inside? Similarly, has anyone found a source of the scale elements on their own?

The scale is (I think) just a PCB in (another guess) a sinusoidal shape. A source of the scale 'tape' would be VERY useful; It could be just stuck to the side of a mill table, for instance, and be read by a close fitting head (no bulky scale of PITA fixings).

Robin Hewitt
18-02-2010, 05:16 PM
The scale is (I think) just a PCB in (another guess) a sinusoidal shape. A source of the scale 'tape' would be VERY useful; It could be just stuck to the side of a mill table, for instance, and be read by a close fitting head (no bulky scale of PITA fixings).

Is it possible they fit them to stainless because it is non-magnetic?

I remember, back in my days as digitizer tech support, the manufacturer accidentally printed a menu overlay for a capacitive tablet using conductive ink. Oops-Splatt :heehee:

I got the impression that the technology wasn't friendly if messed with.

Did you try insulating the scale then sticking a cap to ground to de-jitter it? They don't seem to bother much with decoupling.

Robin

irving2008
18-02-2010, 05:44 PM
The scale is (I think) just a PCB in (another guess) a sinusoidal shape. A source of the scale 'tape' would be VERY useful; It could be just stuck to the side of a mill table, for instance, and be read by a close fitting head (no bulky scale of PITA fixings).
The scale isnt a tape but a thin PCB with a lattice comb finger arrangement where the spacing follows a sinusoid...or at least thats one type, there's a nyumber of variations on the theme. Its clear that the PCB is manufactured in long lengths, I'm guessing ~32" then chopped up to suit. The trick I suppose is creating a long accurate dimensionally stable PCB.

irving2008
18-02-2010, 05:55 PM
Is it possible they fit them to stainless because it is non-magnetic?

I remember, back in my days as digitizer tech support, the manufacturer accidentally printed a menu overlay for a capacitive tablet using conductive ink. Oops-Splatt :heehee:

I got the impression that the technology wasn't friendly if messed with.

Did you try insulating the scale then sticking a cap to ground to de-jitter it? They don't seem to bother much with decoupling.

Robin


There's about 1uF of inbuilt capacitor. The scale is powered all the time its just the display thats turned on and off, at least on these ones, so they read the same when you turn them on as when turned off... as long as you dont move them. I've seen a number of articles that suggest putting 100nF + 10uF when powered remotely and no battery in the compartment. I like Bill's idea of a local reader pcb and localising the power arrangement, that will get rid of many glitches. I've sketched a design using a small number of SMT parts that can be fitted to the existing reader PCB instead of the display case. I think a small bit of ali milled to suit will act as a suitable casing.

The existing case is definitely built down to a price. It took several attempts to get the display to work again after I dismantled it because the positioning of, and pressure on, the zebra connector seems to be critical. and the screw holes are marginal at best... in fact the 4 retaining screws for the PCB have all but one pulled through the pcb so i flowed a little solder in the holes to tighten them up.

I am debating whether to grind the calipery bits off or try to use them as a mount...

oh the other thought I had was making the PIC do calibration to improve accuracy over the long runs... some form of look up table of offsets per cm

and another thought: what about compensation for temperature? does the PCB expand enough to warrant it?

BillTodd
18-02-2010, 08:35 PM
the other thought I had was making the PIC do calibration to improve accuracy over the long runs... some form of look up table of offsets per cmCertainly do-able. Of course, it does require a calibration standard of must higher accuracy than the scales (thinks: I have a magnescale strapped to the side of my lathe that's good to a few microns over its entire length).

Though frankly, for the RF30 type mill I'm using them on, they're probably good enough as they are.



what about compensation for temperature? does the PCB expand enough to warrant itIf, as you suggest the pcb is a set of disconnected copper fingers then I guess it is compliant enough to flex with the SS carrier.


I am debating whether to grind the calipery bits off or try to use them as a mount..They cut easily with a friction saw but watch the temperature,as you don't want the glue to come undone. I drilled mounting holes with a carbide pcb drill.

Were you thinking of making a stand-alone display device or using a PC?

irving2008
18-02-2010, 10:49 PM
Certainly do-able. Of course, it does require a calibration standard of must higher accuracy than the scales (thinks: I have a magnescale strapped to the side of my lathe that's good to a few microns over its entire length).

Though frankly, for the RF30 type mill I'm using them on, they're probably good enough as they are.Ditto for my MD30, the 12" claims 0.04mm across the full length, 0.01mm 0 - 100mm. Since nothing I make (to date) is bigger than 100mm....


Were you thinking of making a stand-alone display device or using a PC? I was going to use 15 0.8" led 7-Segment displays and a couple of driver chips and a PIC, the displays are only 50p each and the PCB for it is simple enough. Doesn't warrant the hassle of a PC. Depending on the PIC I might add a USB port so a PC can read them too.

BillTodd
18-02-2010, 11:30 PM
You might be able to save yourself some effort (I hate PCB layout) by using a EPOS display like this (http://cgi.ebay.co.uk/DigiPos-Florescent-Customer-Display-WD202A_W0QQitemZ220558656312QQcmdZViewItemQQptZUK_ BOI_Retail_Shop_Fitting_POS_Equipment_ET?hash=item 335a520338)with serial input and large VFD

Or if you fancy tinkering...

http://cgi.ebay.co.uk/new-2-line-by-20-customer-display-unit_W0QQitemZ190369107394QQcmdZViewItemQQptZUK_BO I_Retail_Shop_Fitting_POS_Equipment_ET?hash=item2c 52e20dc2

irving2008
18-02-2010, 11:37 PM
Hmmmm.... theres an idea...4.99 isnt going to break the bank...

No doubt if I made it work somebody'd want to copy it :smile:


<edit>
Oh Google is a wonderful tool ... These are manufactured for Fujitsu (ICL as was) and are probably a RS232 serial interface (EPSON emulation) with a 12v 10W supply requirement. Shouldnt be too hard to figure it out. Only 9mm character height tho if these were the customer facing ones, 11mm otherwise..

bogstandard
18-02-2010, 11:59 PM
Having played about with these for a few years on manual machinery, and spent grossly too much on them, attempting to get them to be stable, accurate and reliable, all I can say is ...

If they are going to be mounted anywhere they are liable to be close to swarf, dust or liquids, forget it.
They will be continually breaking down. I was lucky for a week to go by without having to strip one down and get it working again.

I have gone completely over to glass scales, both on lathe and mill, and the only place I use one of these is for upper z axis reading on the quill of my mill, well away from the things mentioned above.

http://i202.photobucket.com/albums/aa102/bogstandard_photos/readout.jpg

http://i202.photobucket.com/albums/aa102/bogstandard_photos/QuillDRO-1.jpg

I found that when running from an external supply, I played about with different values, and found I had to use a 22uf cap across the battery connections to prevent the display from jumping about to whatever reading it wanted to give, that was caused by interferance from the machine motor.

http://i202.photobucket.com/albums/aa102/bogstandard_photos/DROs3.jpg

I bought a few of the spare cables (just the little rubber connector and 1mtr of cable to bare ends) about 5 years ago, and were about 1 each. From here, but they don't sell the cables any more, but they do sell the display boxes at a very reasonable price.

http://www.arceurotrade.co.uk/Catalogue/Measurement/Digital-Readouts

My display was rigged by a friend to run from a wall wart, which got rid of battery power out of the display and read head.
To make the plugs more stable, a short length of toothpick or plastic rod under the four contact fingers keeps them much more rigid in the read head.

Been there, got the tee shirt AND baseball cap.
I wish you all the best in your efforts to cure the problems that have baffled a great many of us manual machinists for way too long.:cry:

Bogs

irving2008
19-02-2010, 12:36 AM
Thanks for your input. I was planning to mount them underneath the table where they would be somewhat protected. It may be that its all a waste of time... but i like to experiment for myself :smile:

I have read several examples of people having success with these(or so it is claimed), sufficient for me to 'have a go' If it doesnt work its not cost me a lot...

bogstandard
19-02-2010, 04:36 AM
I wasn't trying to put you off doing it (except to save your sanity), just giving you some hard earned pointers to be wary of.
If I think on tomorrow, I will see if I have some of those cables knocking about still, but don't hold your breath, I had a massive throw out about 18months ago when I rebuilt my shop. If I find any, I will PM you.

This might help you in the quest to protect your scales.

http://start-model-engineering.co.uk/workshop-news/

Enjoy your journey


Blogs

irving2008
19-02-2010, 10:38 AM
Thanks for that. The idea is very similar to what I had in mind but as I dont plan to use the actual readouts I had already identified some upvc U- and L-channel which I was planning to use as the protective covering.

irving2008
21-02-2010, 02:08 PM
Well after Bill's suggestion of this ex POS terminal readout I went and bought one...

A couple of hours after it arrive I had it up and working (wasn't so hard, but you have to hunt Google and have an idea what you're looking for..)

A quick C# test program later and we have...

1738

Not bad for <8 inc postage and a few hours experimentation lol

Its bright and easily readable and the characters are 14mm high. Going to buy a couple more as they are great for PIC projects and the PCB inside is easily transferable to another housing...

1739

BillTodd
23-02-2010, 08:37 PM
I have a Futaba display module here from another POS device, but I haven't been able to find out talk to it. I have the hardware figured, but not the serial commands.

Did you find anything odd about the serial protocol?

Bill

irving2008
23-02-2010, 09:58 PM
Bill,
90+% of all POS displays use the Epson ESC/POS command set... 9600baud,no parity, 1 stop bit and the following command set:

ctrlH: back one position (non-destructive)
ctrlI: forward one position (non-destructive)
ctrlJ: line down
ctrlK: home
ctrlL: clear screen
ctrlM: beginning of line
ctrlX: clear line, return to beginning
ctrl?ctrlJ: line up

This PDF (http://www.goodson.com.au/download/manual/systems/user/fps2002_um.pdf)shows coding for other common command protocols.

Hope that helps...

BillTodd
23-02-2010, 11:21 PM
Cheers Irving, that looks promising :)

irving2008
24-02-2010, 09:31 PM
Had a bit of time spare today so knocked up this bread board...

1758

and a few tens of lines of C code later...

1759

Many thanks to 'bogstandard' who rummaged in his box'o bits and found me a couple of cables for the scales which saved me some hassle in connecting.

This is running off a remote 1.5V supply generated using a 555 and a -ve charge pump (nit in pic), generating -6v for the RS232 into the VFD display and -1.45v for the scales and the -ve side of the comparators (uing 311 but will replace with a single quad unit) using two diodes as the reference. The PIC is a 16F877 but again will find something smaller for the final box as really dont need a 40pin device - 14 input pins (6 for the scales and 8 for a keypad), 1 UART so probably a 20pin device will do the job.

Bill/Robin, I know you guys have both done something along these lines already, how did you force the scales into fast read mode (currently I do this by hand) and, more importantly, how did you know when they got there and weren't in some 'hold' mode?

BillTodd
24-02-2010, 10:04 PM
This is running off a remote 1.5V supply generated using a 555 and a -ve charge pump Can't you use a spare o/p pin on the PIC instead of the 555?


and a few tens of lines of C code later...I s C fast enough to read the clock pulses or are you using in-line assembler ? (ISTR the guy on cnczone couldn't get it to work in C)


Bill/Robin, I know you guys have both done something along these lines already, how did you force the scales into fast read mode (currently I do this by hand) and, more importantly, how did you know when they got there and weren't in some 'hold' mode? If you look at the PIC code I posted on the CNCzone site, you'll see the sequence I used (I don't have it to hand ATM).

Essentially, I measure the data repeat rate from the scale to determine the current mode then apply pulses to change to the desired mode. The clk/data pulse sequence varies from scale to scale so I also test the data type to determine the type of scale.

Hold mode is a PITA because i can see no way to test the scale in in that Mode. In the end, I just used a reliable 'get back to normal' sequence then output the fast mode sequence blindly.

I have a one scale here that requires one extra pulse to get it to fast mode from hold, yet no way to determine the that this is a different type of scale from within the PIC. I will either have to program a special chip just for this scale or change the PIC code so it stores the sequence in EEPROM , that way I can change it from the PC program.

[edit]
Here you go:



;Zero vernier display
Zero movf rxbuff+1,w
andlw 0xDF
xorwf IDbyte,w ;test correct axis
btfss status,z
return

call zeronorm
btfss Mode,Fast ;if it was in fast mode then setfast
return
goto setFast

;set zero normal mode
ZeroNorm call measure ;measure checks the clock to determine fast/slow mode
btfss Mode,Fflg
goto tstslow
pdlp call PlsData ;pulse data until slow
call measure
btfsc Mode,Fflg ;test slow
goto pdlp
call PlsClk ;pulse clk (zero switch)
return

;measure the vernier reading speed (300mS slow,20mS fast)
measure bcf CMCON,CIS ;switch comp to clk input
call synlp ;wait for clock low >1mS
bcf Mode,Fflg
;if clock occurs within ~25mS then Fast flag will be set
movlw 25
movwf vdata ;borrow vdata as counter
m2lp btfsc CMCON,COUT
bsf Mode,Fflg ;
decfsz vdata+3,f
goto m2lp
decfsz vdata,f
goto m2lp
return
Tstslow call PlsClk ;pulse clk
call measure
btfsc Mode,Fflg ;test slow
goto pdlp ;if fast, pulse data until slow
return ;normal zero

irving2008
24-02-2010, 10:35 PM
Its easily fast enough in C whan you're running a 20Mhz clock - this scale is running at 74KHz clock rate or 13.5uS.. the actual C routine to sample the clock, determine the falling edge, read the data line and shift it into a 32bit register is 49 assembler instructions (7 lines of C) which takes 9.8uS. It may be that on another scale it will need optimising... although this compiler is pretty good but being C it tends to use temporary variables in RAM (mainly becuase I haven't yet worked out how to force it to use registers as variables)



//now in lead up to second data burst
unsigned char count=24;
long data = 0;
while(count>0)
{
data >>= 1; //prepare for next bit
while(CK==1); //wait for clock to go low
if(DT==1) //sample data
data |= 0x00800000;
while(CK==0); //wait for clock to go hi
count--;
}
//do stuff with data...



doubt I could read three scales on one PIC tho in C and I want to do that so the real one will use a 20pin device 18F1220 at 40Mhz...