PDA

View Full Version : Cheap Idea for a DRO



1113562
07-05-2010, 12:18 AM
I've been looking ito the idea of a cheap DRO for X Y and Z axis, not essential I know for a CNC mill but a nice to have for reassurance and for manual operation. The cheap Lidl and Aldi Digital calipers all seem to use the same basic design of of display and linear position circuit board that works on some clever capacitive non contact arrangement with the bar it slides on. The small 150 mm calipers are not just limited to that length either as I have removed the display head and you can carry on sliding it along and the display keeps on going for at least 700 mm or more. The best thing though is they all have a gold plated edge connector which can be used to transmit the digital read-out signal to a remote display. The output is a 24 bit digital signal with a timing clock and the value is transmitted every 320 ms (about 3 per second). Negative values are supported as well. The value is transmitted in both imperial inches as well as metric to 0.01 mm resolution. The 4 pin connector connects to power (1.5 V and 0V on my workzone) and the other two pins are clock (timing) and data. The whole data word (all 24 bits) is transmitted in 100 uS in 7 bursts of 4 bits so actually there are 28 bits. I have yet to fully decode the bits but I assume they are a binary word according to the chinese converted to english manual :eek:

When the unit switches off after a timeout (on my workzone) it is actaully still transmitting so just the local display switches off. So, no need to worry about this, but I think the powerfix version with the 3V CR2032 cell may fully switch off after a timeout of idle, I need to check.

I need to work on figuring out the code of the transmitted value but once understood a small PIC processor could be developed to drive a large segment digital display in the correct units.

More work is needed but at £8.99 a shot these calipers are worth modifying and fitting to your machine as a pretty darn accurate DRO.

If anyone has figured the serial code or has already solved this I would love to know, there is no point in reinventing the wheel.

PS: I have tried to get hold of a connector and cable plus remote software for a PC but although this is hinted at being available I can't find a source. These are imported devices from China and the UK importers are completely useless.

Some of you may be interested in the developments of this project for your own machines.:smile:

john

irving2008
07-05-2010, 12:26 AM
All the figuring out has been done...

See here (http://www.yadro.de/digital-scale/protocol.html) and here (http://rick.sparber.org/Articles/DROnoise/dn.pdf) and here (http://www.shumatech.com/support/chinese_scales.htm)

and here is my own breadboard with a ex-POS terminal VFD for the display...

21242125

oh and BTW, you can't get the leads on their own any more.... or at least no one seems to be able to. I was working on making a connector - here is one I managed to get..
.2126

1113562
07-05-2010, 01:34 AM
Thanks Lad,

I say that as it appears your about 4 years younger than me.

I knew someone would have sussed this all out as these things have been around for ages.

It appears I have a BCD version which transmits the seven packets of 4 bits.

I had already sussed out the odd bias that earths the +1.5V butten cell to the metal parts and that the clock and data lines go negative from this reference.

The links you provide will save me loads of time particularly the different protocols.

I'm surprised no one is knocking out cheap displays and cables for these caliper scales? What has happened to your prototype? Has it stayed in that breadboard form or have you advanced its build state? I would be interested to know what processor/controller you used for the decode/display driver.

I'm not too fussed about a connector to the gold contacts if they are not readily available as I would have just soldered wires onto the board. its not worth messing around for a £9 scale is it.

Have you managed to successfully transfer the scale head of these things onto a longer bar for machine mounting? I'm not clear how accurate one needs to emulate the original caliper slide bar as far as materials and texture need to be. Your comments on this mechanical aspect would be appreciated.

I will look at my other caliper recently purchased to see what remote display protocol it uses.

Thanks for you help so its been so refreshing to get expert advice for once.

Cheers,

John

tumutbound
07-05-2010, 05:44 AM
You can pick up a simple 3 axis display for these cheap calipers/scales for about $US190. Try CDCO (http://cdcotools.com) or Shars. (http://www.shars.com/products/view/2416/Three_Axis_Electronic_Digital_Display)
I've a couple of the Shumatech units as mentioned in a previous post. The older model of these is still available as a kit from Model Engineers Digital Workshop (http://medw.co.uk/wiki/index.php?page=Shumatech+DRO350+Prices) in the UK

irving2008
07-05-2010, 03:05 PM
I'm still waiting to find time to make a proper PCB. Software is pretty much done. Its a PIC16F477 if my memory serves. The PCB is a generic board I am making that has a RS232 port (for the VFD display) a keyboard (4x4 matrix) port and a LCD display port (for HD4470 style 4bit LCD displays) and a general IO port.

The way I am implementing my scales is a small PCB containing the level-shift comparators, a small PIC and a -1.5v charge pump that is attached to the reading head. It will communicate the reading over a 2-wire i2c link back to the display processor - the link will also be the +5v power to the PCB. Eventually I will build the read-head into a purpose-milled plastic case and remove the display.

1113562
08-05-2010, 12:46 AM
Hi Irving,

That sounds like a good approach and one I would take re the balanced tranceiver at the read head. Is your small pic down there doing the timing and stripping the word off for transmission. I take it your I2c is bi directional for reset and imperial/metric mode selection as down-link commands?

If all you will end up needing is the reader PCB assembly have you found an import source just to buy these boards on their own?

Have you mounted these readers on your own machined bar that replaces the caliper bar they come with? If so, was there any particular features that you had to accurately emulate to make the capacitive sensor work reliably and accurately. I'm still mystified as to how these things work as a sensor. When I first opened one up I was surprised when I did not find an optical encoder rolling on the bar or other optical solution. Its certainly a neat non contact sensor.

Cheers,

John

1113562
08-05-2010, 12:56 AM
$190 is not what I would call cheap in comparison to the read head scales especially for a home project. Thanks for the links though.

John S
08-05-2010, 02:13 AM
There's also this one.

http://www.compucutters.co.uk/accessories/compuguide/compuguideDRO01.html

irving2008
08-05-2010, 11:07 AM
That sounds like a good approach and one I would take re the balanced tranceiver at the read head. Is your small pic down there doing the timing and stripping the word off for transmission. I take it your I2c is bi directional for reset and imperial/metric mode selection as down-link commands?

The PIC will do all the decoding and sampling and filtering and will upload a value on request from the display processor. It is fronted by a dual comparator to do the level shift and generates a PWM output to drive the -1.5v charge pump. The output will be in native format (note that the reader always outputs in imperial, metric conversion is done by the display processor)



If all you will end up needing is the reader PCB assembly have you found an import source just to buy these boards on their own?

No, not looked but doubt you will find one...



Have you mounted these readers on your own machined bar that replaces the caliper bar they come with? If so, was there any particular features that you had to
accurately emulate to make the capacitive sensor work reliably and accurately. I'm still mystified as to how these things work as a sensor. When I first opened one up I was surprised when I did not find an optical encoder rolling on the bar or other optical solution. Its certainly a neat non contact sensor.

The 'machined bar' is a PCB, under the graduated label... see here (http://www.yadro.de/digital-scale/working.html)for more info. This makes it hard to extend, but easy to cut down...

irving2008
08-05-2010, 12:20 PM
update - it seems LittleMachineShop (http://www.littlemachineshop.com/products/product_view.php?ProductID=1990&category=)in the US have a source for the cables again... pricey tho... MEDW (http://medw.co.uk/wiki/index.php?page=Scales)advertise them in the UK for £11 +P&P

1113562
08-05-2010, 02:00 PM
The PIC will do all the decoding and sampling and filtering and will upload a value on request from the display processor. It is fronted by a dual comparator to do the level shift and generates a PWM output to drive the -1.5v charge pump. The output will be in native format (note that the reader always outputs in imperial, metric conversion is done by the display processor)


No, not looked but doubt you will find one...


The 'machined bar' is a PCB, under the graduated label... see here (http://www.yadro.de/digital-scale/working.html)for more info. This makes it hard to extend, but easy to cut down...

Thanks for that Irvine,

Thats interesting. Re the reader units. Am I correct in thinking that the 4 bit BCD type readers do change the transmitted values when switching between metric and imperial? If that is the case it would be a lot easier to get the reader to do the conversion rather than the top end.

Thank's for the insight into the capacitive sensor operation. I was not aware the bar has a strip pc under the label. That's a bit of a nuisance as my plan was to buy cheap 6" calipers and fit longer bars. making long strip pcb's is not out of the question but I guess that the whole reader accuracy relies on the pitch accuracy if the T and comb? Do you know if the comb fingers are isolated from each other or linked together, its hard to see on the photo. It looks like the Ts are isolated from each other.

irving2008
08-05-2010, 03:39 PM
Am I correct in thinking that the 4 bit BCD type readers do change the transmitted values when switching between metric and imperial? If that is the case it would be a lot easier to get the reader to do the conversion rather than the top end.Cant say, I have never seen a BCD one, all 5 of mine are the 24bit type. My DRO processor/display will always display in mm as I dont use imperial for metalworking - but if i did it wouldn't be hard to add a in/mm button. Anyway how difficult is adding:



double reading_in_mm[3];
for(int I=0;i<2;i++)
reading_in_mm[i]=reading_in_inch[i]*25.4;
display(readin_in_mm[]);



Do you know if the comb fingers are isolated from each other or linked together, its hard to see on the photo. It looks like the Ts are isolated from each other.Not looked closely, but I'd say they were...

tumutbound
08-05-2010, 04:06 PM
If all you will end up needing is the reader PCB assembly have you found an import source just to buy these boards on their own?


If you're referring to replacement read heads for the calipers/scales, then they are available.
I have some scales I'm removing the LCD from prior to mounting on a mill and bought a couple of spare read head 'just in case'. They were only $8 or so each. These are 24 bit, not BCD type.

irving2008
08-05-2010, 05:14 PM
Yes I looked at this...here in the UK (when I looked about 6mo ago) it was actually cheaper to buy a cheap 4" or 6" caliper as a replacement head (about £7) than the replacement head itself. It seems the expensive bit tho is the stainless steel channel and the PCB. I'm wondering if these PCBs are machined rather than etched? It might be possible to make a new PCB/channel on a CNC machine and get the accuracy needed - it would be interesting to try. I've not found anyone selling the channel seperately, maybe because they are pretty indestructable.

BillTodd
08-05-2010, 09:00 PM
If anyone has figured the serial code or has already solved this I would love to know, there is no point in reinventing the wheel.

Here's my version: http://www.cnczone.com/forums/showthread.php?t=62704

There's commented PIC code and circuits code buried in the thread.

1113562
08-05-2010, 09:35 PM
Not looked closely, but I'd say they were...

I have had another look at the photo and it does look like the fingers are all linked together with a thin continuous strip of copper along the bottom edge. I will have to pull the graduated label of mine to check. This would make butting two strips together to make a longer length tricky as you would need to retain this electrical connection across the joint. Better obviously not to try and butt together and to make as one length. Etching a long PCB would be difficult due to need for long light box, long artworks and etching tank etc.

1113562
08-05-2010, 10:04 PM
Cant say, I have never seen a BCD one, all 5 of mine are the 24bit type. My DRO processor/display will always display in mm as I dont use imperial for metalworking - but if i did it wouldn't be hard to add a in/mm button. Anyway how difficult is adding:



double reading_in_mm[3];
for(int I=0;i<2;i++)
reading_in_mm[i]=reading_in_inch[i]*25.4;
display(readin_in_mm[]);


Not looked closely, but I'd say they were...


Here's my version: http://www.cnczone.com/forums/showthread.php?t=62704

There's commented PIC code and circuits code buried in the thread.

I have had a quick look at your circuit (not your code yet). I use that size PIC a lot so I have lots in DIP and surface mount. With the way you drive the reader board do you not get problems with the grounds as the reader +1.5V is grounded to the SS metal parts of the caliper. I guess the PC 0V on the com port should not come into contact with your mill/lathe machine ground?

John S
08-05-2010, 10:15 PM
update - it seems LittleMachineShop (http://www.littlemachineshop.com/products/product_view.php?ProductID=1990&category=)in the US have a source for the cables again... pricey tho... MEDW (http://medw.co.uk/wiki/index.php?page=Scales)advertise them in the UK for £11 +P&P

Just got back from the Harrogate show and the Machine DRO guys have some cables for £7.50 each.

BillTodd
09-05-2010, 01:28 PM
I have had a quick look at your circuit (not your code yet). I use that size PIC a lot so I have lots in DIP and surface mount. With the way you drive the reader board do you not get problems with the grounds as the reader +1.5V is grounded to the SS metal parts of the caliper. I guess the PC 0V on the com port should not come into contact with your mill/lathe machine ground?
If you look at the multi-scale reader, I use an external PSU (wall-wart) to power the reader and off-set the supply to +3v5 and -1v5, so that the PC and scale grounds can be connected together.


My code handles both BCD and Binary scales automatically by measuring the clock pulses at switch on. It passes the scale data to the PC in string form, the PC/VB app determines which format and unit the data is in, then converts it to Inches (which is the inherit unit of the binary scales). Objects within the app convert the unit as required. I find that displaying MM and Inch (decimal and fractions) simultaneously is VERY useful.

If you're planning a display device make sure it's got an X2 (for lathe use) and a reverse button (easy swithing from absolute and relative is also very handy).

irving2008
10-05-2010, 12:52 PM
Just got back from the Harrogate show and the Machine DRO guys have some cables for £7.50 each.

The cables are available now for £8.75 inc P&P and will be on their website in the next week or so according to Tony Ward at Allendale.

z3t4
10-05-2010, 03:40 PM
**************************
*** NEWB ALERT*** 1st post***
**************************

I'm in the process of putting a DRO on my X3. Given that a Yorkshireman has been defined as a Scot deprived of his generosity it prob'ly comes as no surprise that the reading heads for the scales will be these, at £2.99 a pop:
http://www.virtualvillage.co.uk/150mm-replacement-digital-display-module-for-caliper-001481-065.html
I've gutted 3 of these to get just the reading heads (ie no case, no readout, no battery) and replaced the batteries with pairs of capacitors to reduce jitter. They talk nicely to the capacitive scale strips I'm using (ex Wixey tablesaw DRO) so it looks all good to go. Readout is a Shumatech DRO550.

Please understand that all this is written with the unshakeable confidence of the totally ignorant. I know nothing about machining but I'm having enormous fun learning.

Regards, John

irving2008
10-05-2010, 03:50 PM
**************************
*** NEWB ALERT*** 1st post***
**************************

I'm in the process of putting a DRO on my X3. Given that a Yorkshireman has been defined as a Scot deprived of his generosity it prob'ly comes as no surprise that the reading heads for the scales will be these, at £2.99 a pop:
http://www.virtualvillage.co.uk/150mm-replacement-digital-display-module-for-caliper-001481-065.html
I've gutted 3 of these to get just the reading heads (ie no case, no readout, no battery) and replaced the batteries with pairs of capacitors to reduce jitter. They talk nicely to the capacitive scale strips I'm using (ex Wixey tablesaw DRO) so it looks all good to go. Readout is a Shumatech DRO550.

Please understand that all this is written with the unshakeable confidence of the totally ignorant. I know nothing about machining but I'm having enormous fun learning.

Regards, John

Good find...!

and welcome BTW !

tumutbound
10-05-2010, 04:47 PM
http://www.virtualvillage.co.uk/150mm-replacement-digital-display-module-for-caliper-001481-065.html


There are the same ones I bought ($US8) and seem to work OK with the scales I bought from Shars (http://www.shars.com/product_categories/view/4060205/Horizontal_Electronic_Scales)
They're spares for when I gut the original head (http://cnc.turkeys.net.au/workshop/scales/)s on the scales prior to mounting on my X2 mill.

1113562
11-05-2010, 02:00 AM
If you look at the multi-scale reader, I use an external PSU (wall-wart) to power the reader and off-set the supply to +3v5 and -1v5, so that the PC and scale grounds can be connected together.


My code handles both BCD and Binary scales automatically by measuring the clock pulses at switch on. It passes the scale data to the PC in string form, the PC/VB app determines which format and unit the data is in, then converts it to Inches (which is the inherit unit of the binary scales). Objects within the app convert the unit as required. I find that displaying MM and Inch (decimal and fractions) simultaneously is VERY useful.

If you're planning a display device make sure it's got an X2 (for lathe use) and a reverse button (easy swithing from absolute and relative is also very handy).

Hi Bill,

Thanks for this. I obviously did not look too hard at your diagrams did I?

The web site has been up and down over the past few days and I kind of gave up last night. I'll try to get a bit more time on it looking at your stuff.

I like the idea of using a PC or laptop for the readout's and controls. I've never really got into VB programming but I'm quite happy with PIC assembler (not C though...that scares me). I was told that VB interface to RS232 Com Port is not that well documented and is a bit tricky? Have you thought of a USB version seeing that RS232 com ports seem to be disspearing off the modern PC's (especially laptops)?

Did you have any thoughts on producing longer bar's/PCB for the read head to slide on? All the cheap Chinese calipers seem to come with a short 150 mm bar.

irving2008
11-05-2010, 08:06 AM
i reckon the combs should be easy to mill out on a CNC PCB mill. They are 0.6mm thick PCB double sided but the reverse is plain. On the top side is the T-comb structure and a ground strip. Since the mechnaism is a capacitive vernier it would seem perectly reasonable to manufacture this in say 150 or 200mm approx lengths where the end is exacly halfway through a 'T' and then end butt them together ensuring electrical conductivity across the join with a solder infil. getting positional accuracy on the second or subsequent 'comb' is the critical factor (as well as the basic accuracy of the comb). Some sort of jig might do the job.

Alternately, buy 3 cheap ones and look to join the PCB together as per above. Milling a new channel from stainless might be tricky, but aluminium might do just as well.

It worth an experiment don't you think?

1113562
11-05-2010, 10:57 AM
i reckon the combs should be easy to mill out on a CNC PCB mill. They are 0.6mm thick PCB double sided but the reverse is plain. On the top side is the T-comb structure and a ground strip. Since the mechnaism is a capacitive vernier it would seem perectly reasonable to manufacture this in say 150 or 200mm approx lengths where the end is exacly halfway through a 'T' and then end butt them together ensuring electrical conductivity across the join with a solder infil. getting positional accuracy on the second or subsequent 'comb' is the critical factor (as well as the basic accuracy of the comb). Some sort of jig might do the job.

Alternately, buy 3 cheap ones and look to join the PCB together as per above. Milling a new channel from stainless might be tricky, but aluminium might do just as well.

It worth an experiment don't you think?

Yes I fully agree an experiment is worthwhile.

For proof of principle it seems least effort to try butting two PCB's from two existing gauges together to see if this gives good results across the transition. The infill with solder may be tricky and may cause delamination and a nasty lump. Would it not be better to join down the gaps between T and comb in an L shape machining in the end of each strip.

Re the channel, is it essential to have a channel at all? Providing the reader is in close proximity with the PCB I can't see why it can't work. 0.8 mm (1/32") Shims on the reader half can be used to raise it off the bar.

Another question I have is "is it essential to use double sided pcb"? If the reverse is just plain copper the same capacitance would be achieved by bonding a single sided PCB to a SS bar or Aluminium or a brass bar if you prefer. I'm not sure if the design relies on the reverse plane of the PCB floating electrically from the bar in which case this may explain the need for a double sided PCB.

irving2008
11-05-2010, 11:08 AM
Yes I fully agree an experiment is worthwhile.

For proof of principle it seems least effort to try butting two PCB's from two existing gauges together to see if this gives good results across the transition. The infill with solder may be tricky and may cause delamination and a nasty lump. Would it not be better to join down the gaps between T and comb in an L shape machining in the end of each strip.

Re the channel, is it essential to have a channel at all? Providing the reader is in close proximity with the PCB I can't see why it can't work. 0.8 mm (1/32") Shims on the reader half can be used to raise it off the bar.

Another question I have is "is it essential to use double sided pcb"? If the reverse is just plain copper the same capacitance would be achieved by bonding a single sided PCB to a SS bar or Aluminium or a brass bar if you prefer. I'm not sure if the design relies on the reverse plane of the PCB floating electrically from the bar in which case this may explain the need for a double sided PCB.
Good point about the reverse of the PCB. It definitely is some form of ground plane.... might go look in Aldi/Lidl whatever for some cheap ones...

1113562
11-05-2010, 11:14 AM
I have just buzzed my PCB and the comb fingers are all linked together by the thin strip of copper that runs along the bottom so this would need to be joined across the strips

BillTodd
11-05-2010, 12:44 PM
I like the idea of using a PC or laptop for the readout's and controls. I've never really got into VB programming but I'm quite happy with PIC assembler (not C though...that scares me).You should be able to understand the code easily enough :)



I was told that VB interface to RS232 Com Port is not that well documented and is a bit tricky? Doesn't seem tricky to me - maybe I've already done all the head-on-wall banging necessary ;)


Have you thought of a USB version seeing that RS232 com ports seem to be disspearing off the modern PC's (especially laptops)?Yes I had thought about it, but VB has it's own problems with the USB driver interface so if I were to do it I just use a cheap USB-serial adapter.



Did you have any thoughts on producing longer bar's/PCB for the read head to slide on? All the cheap Chinese calipers seem to come with a short 150 mm bar. It would be nice to be able to make accurate scales of any length, but then would require some way of accurately calibrating them, which is probably the hardest part. Given that long scales (upto 1000mm) are available for not too much money (600mm are about £70), unless you need very long scales, is it worth making one???


Since there seems to be some interest here, I've attached the PC app and PIC files to this post. The VB app has a sort of demo mode that'll allow you to add scales and adjust the value by dragging the mouse over a button. The current version is a fixed 640x480 window to suit my panel-pc, but I have a part finished MDI (multiple document - so I could add hole layout and utility functions) version that I would like to finish ... sometime.

1113562
11-05-2010, 10:51 PM
You should be able to understand the code easily enough :)


Doesn't seem tricky to me - maybe I've already done all the head-on-wall banging necessary ;)

Yes I had thought about it, but VB has it's own problems with the USB driver interface so if I were to do it I just use a cheap USB-serial adapter.


It would be nice to be able to make accurate scales of any length, but then would require some way of accurately calibrating them, which is probably the hardest part. Given that long scales (upto 1000mm) are available for not too much money (600mm are about £70), unless you need very long scales, is it worth making one???


Since there seems to be some interest here, I've attached the PC app and PIC files to this post. The VB app has a sort of demo mode that'll allow you to add scales and adjust the value by dragging the mouse over a button. The current version is a fixed 640x480 window to suit my panel-pc, but I have a part finished MDI (multiple document - so I could add hole layout and utility functions) version that I would like to finish ... sometime.

Thanks Bill,

I think I may have managed to grab the demo VB DRO last night. I installed it and had to go and find/install the required inpout32.dll. After that its seemed to open just fine, but of course I have no multiplexed input to test it yet. The version I installed as far as I could work out could only open two scales (X and Y). Is that a limitation or me being stupid?

I will certainly make up the PIC board just to see that it all functions correctly with my Lidl/Aldi 150 mm callipers seeing I have most of the parts.

One question I have is whether there is a practical maximum cable length between the reader and the PIC board. There is some posts that suggest that EMC/noise issues exist at this interface and running single ended clock and data over long wires is not ideal for low pick-up. With all 4 channels on one board there will have to be a compromise about the best location of the board relative to the machine scale positions.

You may have a point about the long T/Comb PCB and bar if you say you can pick up 600 mm callipers for £70. My mill X axis is 18" travel so one of these would be just fine. It just seems wrong to buy the whole thing just for the PCB and maybe the bar when the readers can be purchased complete for <£4 as recent posts suggest.

BillTodd
11-05-2010, 11:29 PM
I installed it and had to go and find/install the required inpout32.dll.Ah Sorry, I must have missed theat out of the installer script. (the inpout.dll is only required to handle the touch switch input on my panel-pc)


The version I installed as far as I could work out could only open two scales (X and Y). Is that a limitation or me being stupid?No not your fault :) I added the 'demo' option while testing the ADJ function, so I've only added X&Y to the menu. It will happily display four (or more) scales.

Each PIC has the same code, on power up each one detects the status of its pin5, then assigns itself as X,Y,Z or W. When the PIC detects a scale it informs the VB app, which then adds a display panel)


One question I have is whether there is a practical maximum cable length between the reader and the PIC board.I use 1.5-2m screened cables (soldered to the scale). It would be wise to route them away from strong noise sources.


[edit] found a 600mm scale on ebay:
http://cgi.ebay.co.uk/Mill-Lathe-Horizontal-DRO-Digital-readout-600mm-24-NEW-/290411268519?cmd=ViewItem&pt=UK_Measuring_Tools_Levels&hash=item439ddc49a7

irving2008
11-05-2010, 11:47 PM
[edit] found a 600mm scale on ebay:
http://cgi.ebay.co.uk/Mill-Lathe-Horizontal-DRO-Digital-readout-600mm-24-NEW-/290411268519?cmd=ViewItem&pt=UK_Measuring_Tools_Levels&hash=item439ddc49a7Thats the same as the one I got on ebay for £17 a week or so back :)

1113562
13-05-2010, 01:51 AM
Ah Sorry, I must have missed theat out of the installer script. (the inpout.dll is only required to handle the touch switch input on my panel-pc)


It was not a problem, it was easy to find and install


No not your fault :) I added the 'demo' option while testing the ADJ function, so I've only added X&Y to the menu. It will happily display four (or more) scales.

Each PIC has the same code, on power up each one detects the status of its pin5, then assigns itself as X,Y,Z or W. When the PIC detects a scale it informs the VB app, which then adds a display panel)


That's quite neat, you have thought of everything. I recognised that the ASM code was the same for all PICs on the board which is also a smart move.

I managed to load the project and ASMs and do a successful 'Make' with all of the Include files as well. I just needed to change the location for the files as I don't have a D:\ drive. - it all looks good so far



I use 1.5-2m screened cables (soldered to the scale). It would be wise to route them away from strong noise sources.


That's quite a healthy length, much longer than I would need.


Thanks Bill.

1113562
15-05-2010, 12:15 AM
Ah Sorry, I must have missed theat out of the installer script. (the inpout.dll is only required to handle the touch switch input on my panel-pc)

No not your fault :) I added the 'demo' option while testing the ADJ function, so I've only added X&Y to the menu. It will happily display four (or more) scales.

Each PIC has the same code, on power up each one detects the status of its pin5, then assigns itself as X,Y,Z or W. When the PIC detects a scale it informs the VB app, which then adds a display panel)

I use 1.5-2m screened cables (soldered to the scale). It would be wise to route them away from strong noise sources.


[edit] found a 600mm scale on ebay:
http://cgi.ebay.co.uk/Mill-Lathe-Horizontal-DRO-Digital-readout-600mm-24-NEW-/290411268519?cmd=ViewItem&pt=UK_Measuring_Tools_Levels&hash=item439ddc49a7

Hi Bill,
I have managed to program 4 off 12F675 PICS but for a quick demo breadboard can I just install 1 or 2 Vernier PICs into the RS232 interface driver rather than all 4. If so do I need to install X then Y then Z etc in that order. I'm getting to understand your assembly code but i've not quite figured out the TxSyn operation yet on GP4 in relation to channel time slots.

Cheers, John

1113562
16-05-2010, 11:51 PM
Hi Bill,
I have managed to program 4 off 12F675 PICS but for a quick demo breadboard can I just install 1 or 2 Vernier PICs into the RS232 interface driver rather than all 4. If so do I need to install X then Y then Z etc in that order. I'm getting to understand your assembly code but i've not quite figured out the TxSyn operation yet on GP4 in relation to channel time slots.

Cheers, John


I have build a prototype board to test a single channel although the board is built to a level to take 3 of the PICs with expansion for the 4th.

On test with one PIC installed and connected up to a caliper I am getting something and it recognises the correct channel but the displayed valued is very eratic and not representative of the vernier positional movements. I'll need to get the scope out to see why it is so all over the place. Perhaps I have a noise issue with my set-up. The power supplies look quite stable with a DMM but without scoping it there could be some nasty spikes around... I'm getting there slowly.lol

I tried to add a few pics but I'm not sure if it worked

1113562
16-05-2010, 11:57 PM
I realised pics were too big so here is a re-sized version of the prototype (lash-up) with one programmed PIC installed in channel Y

2151

BillTodd
17-05-2010, 01:27 PM
ISTR you can fit one or more PICs as required.


I'm getting to understand your assembly codeCongratulation John - that's more than I ever did :LOL:

From memory, the Txsyn timing is a simple grab a slot when ready affair with a different delay based on chip position to help prevent collisions.
(i.e. if Txsyn = hi, delay X.Y,Z or W recheck Txsyn if hi, pull txsyn low and transmit)

Is the vernier being switched into fast mode correctly? Different makes/types of scale have different clk/data line switching sequences so some don't work with out mod'ing the code


Are you powering the scales from the interface or the on-board cell? (I replaced the cells with a ~1uF SM cap) What voltage are you ghetting across the PSU red-led?

The serial port is running at 115,200 baud, so screening and good earthing is advisable. And, it derives its -Ve from the PC so, just check that's working OK.

1113562
17-05-2010, 02:17 PM
ISTR you can fit one or more PICs as required.

I tried this as you can see in the photo as it sort of worked so I assumed the design does not require all PICs in place


Is the vernier being switched into fast mode correctly? Different makes/types of scale have different clk/data line switching sequences so some don't work with out mod'ing the code

I think it is I being switched - I get a small hi symbol appearing on the LCD display. The zero switch on the vernier doesn't zero when connected to your interface it just seems to make it switch between fast and slow mode. I will try another vernier I have which is a later BCD output model with a 2032 3V button cell battery.


Are you powering the scales from the interface or the on-board cell? (I replaced the cells with a ~1uF SM cap) What voltage are you ghetting across the PSU red-led?

Yes I'm powering from the interface board. I don't have a cell in place or a cap. I'll try and put a 1uF in the place of the battery cell, that may stabilise things. Whats your suggestion for the 3V verniers as I note the signals are still only 1.5 v p-p despite the 3V cell? I measured my LED Vernier power output as 1.63V, its bit hi but thats due to the LED i'm using. Do you think I should try and get this back to 1.5V?


The serial port is running at 115,200 baud, so screening and good earthing is advisable. And, it derives its -Ve from the PC so, just check that's working OK.

As you can see i've used a crap bit of ribbon for this cable but ist only about 20" long. I must try to improve this with a screened cable. I am getting a good 0V reference from the PC. I'll look at all this later with a scope to see whats going on, in the end its bound to be an analogue thing.

Thanks for all your help. John

1113562
19-05-2010, 01:16 AM
Here is an update to things but to make it easy I have attached a word doc with embedded pics. It describes some scope measurements of the signals on the interface board. I hope it is readable.

BillTodd
19-05-2010, 10:39 PM
It sounds to me like the vernier is not being set to fast mode correctly my the PIC. and it is mis-reading the vernier as a binary version rather than a BCD type.

Fire up a serial comms package or hyperterminal, if ALL else fails :)

Set baud to 115,200, 8, n,1

Send 'i0' and the PIC (in position X) should respond with something.

;command line interpretor
;Commands: (case insensitive)
;rx - Read - reads and transmits abs position (x=x,y,z,w)
;sn - Sets sample rate (n=0,1,2) 0 =poll mode, 1 = 300mS (normal), 2 = 20mS (fast mode)
;zx - zero vernier display (x=x,y,z,w)
;vn - set vernier type (n=0,1) 0 = old, 1=decimal


send V1 to set decimal vernier, then S0 to set poll mode, then RX and the pic should respond with X00.000: (inches) or X000.00:
(mm). If it returns XH000000: then it is not reading the vernier as a decimal type.

I have one vernier here that has a similar problem , so if I can fine the time I'll look into it. In the mean time, you could try inserting an extra pulse clk in the setfast routine


setFaut bsf Mode,Auto
setFast bsf Mode,Fast
clrwdt
call zeronorm
clrwdt ;pulse clk again if decimal type
call Dly200
call Plsdata
btfss Mode,Vtype
return
clrwdt ;pulse clk again if decimal type
call Dly200
call Plsclk
call Dly200 ;exta pulse clk *******
call Plsclk
call txZero ;send zero message
return
A quick PIC to PC test:

disconnect serial lead from PC , disconnect vernier from PIC

Run VB application, select correct comm port

Connect serial lead, connect vernier to PIC - you should see a new frame appear for X, Y, Z or W - if this happens the serial port is working OK.

you should see the vernier be reset to zero then depending on type H (for hold) and F (for fast)

Press ZERO (and hold) on the vernier, this will stop the clock signal, after a second or less the PIC will signal the PC to remove the frame .

Releasing the zero will start the clock, the PIC will signal the PC and the PC will issue a reset to the Vernier.


If all of the above works the serial comm must be working fine.

1113562
20-05-2010, 12:11 AM
It sounds to me like the vernier is not being set to fast mode correctly my the PIC. and it is mis-reading the vernier as a binary version rather than a BCD type.

Fire up a serial comms package or hyperterminal, if ALL else fails :)

Set baud to 115,200, 8, n,1

Send 'i0' and the PIC (in position X) should respond with something.

;command line interpretor
;Commands: (case insensitive)
;rx - Read - reads and transmits abs position (x=x,y,z,w)
;sn - Sets sample rate (n=0,1,2) 0 =poll mode, 1 = 300mS (normal), 2 = 20mS (fast mode)
;zx - zero vernier display (x=x,y,z,w)
;vn - set vernier type (n=0,1) 0 = old, 1=decimal


send V1 to set decimal vernier, then S0 to set poll mode, then RX and the pic should respond with X00.000: (inches) or X000.00:
(mm). If it returns XH000000: then it is not reading the vernier as a decimal type.

I have one vernier here that has a similar problem , so if I can fine the time I'll look into it. In the mean time, you could try inserting an extra pulse clk in the setfast routine


setFaut bsf Mode,Auto
setFast bsf Mode,Fast
clrwdt
call zeronorm
clrwdt ;pulse clk again if decimal type
call Dly200
call Plsdata
btfss Mode,Vtype
return
clrwdt ;pulse clk again if decimal type
call Dly200
call Plsclk
call Dly200 ;exta pulse clk *******
call Plsclk
call txZero ;send zero message
return
A quick PIC to PC test:

disconnect serial lead from PC , disconnect vernier from PIC

Run VB application, select correct comm port

Connect serial lead, connect vernier to PIC - you should see a new frame appear for X, Y, Z or W - if this happens the serial port is working OK.

you should see the vernier be reset to zero then depending on type H (for hold) and F (for fast)

Press ZERO (and hold) on the vernier, this will stop the clock signal, after a second or less the PIC will signal the PC to remove the frame .

Releasing the zero will start the clock, the PIC will signal the PC and the PC will issue a reset to the Vernier.


If all of the above works the serial comm must be working fine.

Thanks Bill,

I'll try all that, its all very usefull info.

As I say in the word attachment I also have another vernier I can try and that one has the abs and rel 24bit packet output format. I'll wire that in first to try, then I'll try to adjust the asm code as you suggest for the BCD version.

What confuses me slightly is the need to run the vernier in fast mode. I thought this is just the update rate and should not cause corruption of the data. I know it is good to get the 40 updates per second for real use on the Mill or Lathe but for test purposes does it matter?

Cheers,

BillTodd
20-05-2010, 12:16 PM
What confuses me slightly is the need to run the vernier in fast mode. I thought this is just the update rate and should not cause corruption of the data.No it shouldn't, but if the PIC is not able to change mode correctly, it probably wont detect the vernier type (binary/bcd) either. If you use a comms program you should be able to force the PIC to use poll mode (read and report when asked) and binary/bcd type which should confirm the data splicing and clock detection is working properly.

Does your vernier's data and clock signals look like (timing wise) those on the yadro site?
http://www.yadro.de/digital-scale/protocol.html [edit- just had a look at your word doc, all looks ok there]

I'm right in the middle of a job ATM, but I'll try to have a look at my errant vernier (looks and behaves very much like your one) at the weekend.

1113562
20-05-2010, 02:15 PM
No it shouldn't, but if the PIC is not able to change mode correctly, it probably wont detect the vernier type (binary/bcd) either. If you use a comms program you should be able to force the PIC to use poll mode (read and report when asked) and binary/bcd type which should confirm the data splicing and clock detection is working properly.

Does your vernier's data and clock signals look like (timing wise) those on the yadro site?
http://www.yadro.de/digital-scale/protocol.html [edit- just had a look at your word doc, all looks ok there]

I'm right in the middle of a job ATM, but I'll try to have a look at my errant vernier (looks and behaves very much like your one) at the weekend.

OK Bill you have been more than helpfull on this problem there is no rush at all.

As you have seen in the word doc the vernier I am trying looks very much like it is the same as the 7 BCD protocol as per the YA DRO site. According to that site to get to fast read needs a single data then a clock pulse from the PIC so this is where the difference may be as this vernier is not going straight to Fast Read mode.

I'll try the othet Vernier I have at home this evening which is definitely the 2 packet 24 bit binary protocol and I'll see how that performs before fiddling with the PIC code.

I was thinking it may be worth developing a simple emulator coded PIC just to put in the socket for testing the COMS from Interface to PC, i.e one that just generates known values and responds to abs zero controls etc. Putting two or more of these test PICs on the interface board could also be used to test the data splicing - just a thought and you may well have thought of this and rejected it for good reasons.

1113562
22-05-2010, 12:45 AM
It sounds to me like the vernier is not being set to fast mode correctly my the PIC. and it is mis-reading the vernier as a binary version rather than a BCD type.

Fire up a serial comms package or hyperterminal, if ALL else fails :)

Set baud to 115,200, 8, n,1

Send 'i0' and the PIC (in position X) should respond with something.

;command line interpretor
;Commands: (case insensitive)
;rx - Read - reads and transmits abs position (x=x,y,z,w)
;sn - Sets sample rate (n=0,1,2) 0 =poll mode, 1 = 300mS (normal), 2 = 20mS (fast mode)
;zx - zero vernier display (x=x,y,z,w)
;vn - set vernier type (n=0,1) 0 = old, 1=decimal


send V1 to set decimal vernier, then S0 to set poll mode, then RX and the pic should respond with X00.000: (inches) or X000.00:
(mm). If it returns XH000000: then it is not reading the vernier as a decimal type.

I have one vernier here that has a similar problem , so if I can fine the time I'll look into it. In the mean time, you could try inserting an extra pulse clk in the setfast routine


setFaut bsf Mode,Auto
setFast bsf Mode,Fast
clrwdt
call zeronorm
clrwdt ;pulse clk again if decimal type
call Dly200
call Plsdata
btfss Mode,Vtype
return
clrwdt ;pulse clk again if decimal type
call Dly200
call Plsclk
call Dly200 ;exta pulse clk *******
call Plsclk
call txZero ;send zero message
return
A quick PIC to PC test:

disconnect serial lead from PC , disconnect vernier from PIC

Run VB application, select correct comm port

Connect serial lead, connect vernier to PIC - you should see a new frame appear for X, Y, Z or W - if this happens the serial port is working OK.

you should see the vernier be reset to zero then depending on type H (for hold) and F (for fast)

Press ZERO (and hold) on the vernier, this will stop the clock signal, after a second or less the PIC will signal the PC to remove the frame .

Releasing the zero will start the clock, the PIC will signal the PC and the PC will issue a reset to the Vernier.


If all of the above works the serial comm must be working fine.


Bill, I have not tried the Hyperterminal test yet or tried adding another pulse to the code. I have not had time yet to try another vernier type either but i did try the simple comms port diagnostic test you describe. When you hold the zero button it stops the clock and the VB app clears the vernier off the display window, Y in my case. On releasing the zero button the Y display returns. The clock and data line LEDs to the vernier flash in a sequence, the vernier display zeroes but in general it leaves it in th H (hold) mode, never in the F.T Fast Read mode. Sometimes the clock and data pulsing sequence repeats a few times till it settles down to the Hold mode. Sometimes it leaves the vernier in the slow mode but this is rare.

I must try and test the other Vernier I have and give an update before trying the other tests.

Cheers.

1113562
23-05-2010, 01:38 AM
Bill, I have not tried the Hyperterminal test yet or tried adding another pulse to the code. I have not had time yet to try another vernier type either but i did try the simple comms port diagnostic test you describe. When you hold the zero button it stops the clock and the VB app clears the vernier off the display window, Y in my case. On releasing the zero button the Y display returns. The clock and data line LEDs to the vernier flash in a sequence, the vernier display zeroes but in general it leaves it in th H (hold) mode, never in the F.T Fast Read mode. Sometimes the clock and data pulsing sequence repeats a few times till it settles down to the Hold mode. Sometimes it leaves the vernier in the slow mode but this is rare.

I must try and test the other Vernier I have and give an update before trying the other tests.

Cheers.

Update: I Tried the other vernier which was very recently bought from Aldi but this just caused the PC VB6 App to go nuts with overflows and crash. This vernier is quite different from the older one I fist tried in that the interface pulsing on the clock and data lines at connection detect do not appear to change the setting modes at all on the vernier. Also when you push and hold the zero button on the vernier it just pulses the clock line for about 1/2 second it doesn't hold it off continuously while the button is depressed.

I then tried using hyperterminal with the older BCD type vernier as per the diagnostics tests recommended but this was not good. When the vernier I/F is plugged into the PC COM1 port hyperternial complains it cant open the com port. I think I am correct in setting HT to 'no flow control'? I did try 'hardware control' mode but that suffered the same fate. I thought then that I did have a wiring problem either in my serial link cable or the I/F driver circuit but I checked both and they seem to be correct to drawing - strange.

I'm not sure what to try next!!!

Cheers - John

BillTodd
24-05-2010, 05:52 PM
Hi John,

Ok I found some time this morning to look at my other verniers...

There seems to have been an explosion of vernier types since I wrote the PIC code; I have half a dozen different verniers here with five different output formats! (including Mitotoyo, which is completely different) With your two that makes at least six 'chinese' formats. I have a one I bought in the USA with fractional inch display (very handy) that outputs fast 25mS pulses and, like your Aldi one, does not respond to clk or data switching.

I think the best way forward, is to drop the automatic device detection from the PIC code and add some manual set up commands and a configuration page to the VB prog. (I want to add a DRO to my Haighton at sometime so it is something I will have to sort out).

It would help, to know the switching sequences for your BCD one, so if you get the chance to work them out.... :)

Bill

1113562
24-05-2010, 07:51 PM
Hi John,

Ok I found some time this morning to look at my other verniers...

There seems to have been an explosion of vernier types since I wrote the PIC code; I have half a dozen different verniers here with five different output formats! (including Mitotoyo, which is completely different) With your two that makes at least six 'chinese' formats. I have a one I bought in the USA with fractional inch display (very handy) that outputs fast 25mS pulses and, like your Aldi one, does not respond to clk or data switching.

I think the best way forward, is to drop the automatic device detection from the PIC code and add some manual set up commands and a configuration page to the VB prog. (I want to add a DRO to my Haighton at sometime so it is something I will have to sort out).

It would help, to know the switching sequences for your BCD one, so if you get the chance to work them out.... :)

Bill

OK Bill, I will do a controlled test of my BCD vernier to get the sequence and report back. I'll just code up a simple pulse generator in one of the PICs.

I'm glad you mentioned that the mitutoyo verniers have a completely different protocol as I nearly bought a 24" one a few days ago on eBay. It was mainly for the bar/PCB but using the reader would also be good.

btw. Good idea about having a manually selectable Vernier type in the VB app.

Cheers, John

irving2008
24-05-2010, 11:16 PM
You wouldn't want to cannibalise a Mitutoyo, they are generally thought to be top end of the market and also unlikely to work with someone elses reading head...

1113562
25-05-2010, 12:55 AM
You wouldn't want to cannibalise a Mitutoyo, they are generally thought to be top end of the market and also unlikely to work with someone elses reading head...

Yes thanks for that. There is an 18" one going for £20 +£10 post but the machining company has ground off the points on the jaws, otherwise all is good so they say.

z3t4
25-05-2010, 01:09 AM
Hi Chaps
This problem of the multiplicity of digital verynear[§] protocols has been discussed at some length on Scott Shumate's group on Yahoo:http://groups.yahoo.com/group/ShumaTech/

The Spherosyn and Mitutoyo protocols are especially, er, non-trivial, but some of the newer ordinary calipers are not easy to decode, either. The C-code for the decoding and autoselect algorithms for his 'OpenDRO' are open source on Sourceforge here:
https://opendro.svn.sourceforge.net/svnroot/opendro/trunk/src/
so it might be worth a look. Can't help directly, 'cos I know SFA about programming:redface:.

-- 'course, you prob'ly know all this anyway, in which case apols -- suck eggs--- etc.

Cheers,

John


§ ©JS

1113562
25-05-2010, 01:10 AM
OK Bill, I will do a controlled test of my BCD vernier to get the sequence and report back. I'll just code up a simple pulse generator in one of the PICs.

Cheers, John

OK I have done a test on the BCD vernier which is a Workzone 6" bought from Lidl or Aldi, can't remember which. I have attached an image of the state diagram2203.

It starts always at power up in Slow Read mode. To get from switch on to Fast Read (F.T) needs a Data then a Clock Pulse. To Zero at power up on route to F.T then its Clock then Data then Clock. When in F.T. to Zero needs a Data then CLock then Data then Clock. There are other states as shown in the diagram that are of no interest to our use I suggest.

John.

1113562
25-05-2010, 01:56 AM
Hi Chaps
This problem of the multiplicity of digital verynear[§] protocols has been discussed at some length on Scott Shumate's group on Yahoo:http://groups.yahoo.com/group/ShumaTech/

The Spherosyn and Mitutoyo protocols are especially, er, non-trivial, but some of the newer ordinary calipers are not easy to decode, either. The C-code for the decoding and autoselect algorithms for his 'OpenDRO' are open source on Sourceforge here:
https://opendro.svn.sourceforge.net/svnroot/opendro/trunk/src/
so it might be worth a look. Can't help directly, 'cos I know SFA about programming:redface:.

-- 'course, you prob'ly know all this anyway, in which case apols -- suck eggs--- etc.

Cheers,

John


§ ©JS

Hi John. Whats the message number of the thread that discusses different protocols on that Shumatech forum? I had a quick look but couldn't find it. Loads of stuff on positive earth grounding etc.

z3t4
25-05-2010, 12:10 PM
Hi John. Whats the message number of the thread that discusses different protocols on that Shumatech forum? I had a quick look but couldn't find it. Loads of stuff on positive earth grounding etc.

Try 17121. It's worth doing a search on 'protocol' and seeing what comes up. I think a look through Scott's code on Sourceforge might yield more than the forum, though.

HTH

John

1113562
26-05-2010, 11:23 PM
OK I have done a test on the BCD vernier which is a Workzone 6" bought from Lidl or Aldi, can't remember which. I have attached an image of the state diagram2203.

It starts always at power up in Slow Read mode. To get from switch on to Fast Read (F.T) needs a Data then a Clock Pulse. To Zero at power up on route to F.T then its Clock then Data then Clock. When in F.T. to Zero needs a Data then CLock then Data then Clock. There are other states as shown in the diagram that are of no interest to our use I suggest.

John.

This version of Vernier seems to be virtually the same state diagram as that on the YADRO site but they do not show some of the hold states.

1113562
26-05-2010, 11:43 PM
Hi John,

Ok I found some time this morning to look at my other verniers...

There seems to have been an explosion of vernier types since I wrote the PIC code; I have half a dozen different verniers here with five different output formats! (including Mitotoyo, which is completely different) With your two that makes at least six 'chinese' formats. I have a one I bought in the USA with fractional inch display (very handy) that outputs fast 25mS pulses and, like your Aldi one, does not respond to clk or data switching.

I think the best way forward, is to drop the automatic device detection from the PIC code and add some manual set up commands and a configuration page to the VB prog. (I want to add a DRO to my Haighton at sometime so it is something I will have to sort out).

It would help, to know the switching sequences for your BCD one, so if you get the chance to work them out.... :)

Bill

Just to get the record straight, I found by inspection that I had reversed clock and data from the vernier to the PIC processor inputs. A BASIC SCHOOLBOY error. On correction of the error Bill's HARDWARE & SOFTWARE works perfectly with dead stable values on the PC display and also fast update rate. Its a neat and dead cheap solution if you have a PC to hand with a serial COM port.

I'm now going to sort out 2 more verniers that respond to clock and data mode pulsing so I can get X Y & Z working simultaneously. I'll then make a proper PCB for the interface rather than a veroboard prototype to make it a bit more robust. The next step will be to get it all installed on the mill with the full length PCB beams for each axis.

A big thank you to Bill Todd, he is a genius and a gentleman in equal proportions.

ecat
06-12-2010, 07:47 PM
Bill, many thanks for your design, I have it built and almost working...

Set up just now with a single PIC in the X position, no callipers connected. The PIC appears to respond to commands, i0 returns data, zx flashes the LED and returns data and then a little more data if I stroke the board. Problem is the returned data is garbled though strangely repeatable.

I've tried two different PNP's 2n5401 and bc556.

I've tweaked the base resistor, 12k and 6k.

As my LED was producing about 1.9v (1) it left only 3v to drive the TX which is a little too close for comfort. I've swapped out the psu LED for a diode string giving about 1.5v/3.5v but data corruption remains identical.

I am using a Prolific USB to serial adaptor, think this could be the problem?

(1) 1.9v worries me as this will power the callipers, should be ok? I can always substitute little diode chains to bring the volgate closer to battery spec.

BillTodd
06-12-2010, 09:03 PM
Hi ecat,

Make sure your terminal is set to receive 115,200 baud, 8 bit, no parity, 1 stop bit. You may have to force DTR (pin4 to -ve) in order for the interface to work, since it supplies the negative for the Txd line.

The USB serial port is the same as I use here.

As long as there's about 5v across the PIC, the comparitor thresholds should be OK (I think John found that his 3v powered vernier put out 1.5v data)

Bill

ecat
06-12-2010, 10:15 PM
Thanks for the reply,

Comms settings are good, the PIC appears to receive the correct data.
DTR is negative volts

An example of the reply to i0, in hex :)

0918 0820 0802 494E 4162 7908 094E 4340 ..INAby.NC@
3A

And zx command

0018 3A
0318 3A02 103A ::

looks like I have a bit missing, literally.

1.9V power to the callipers is ok?

Anyway, back to playing :)

BillTodd
07-12-2010, 01:23 PM
Can you check the PIC is running at 4MHz? And that the trim byte is correctly set (my code may be using the wrong value).

Try pulling GP4 high with a 10k resister (it should use the internal weak pull-up but...)

>1.9V power to the callipers is ok?
As long as the scale works at that voltage and the output signal is about 1.5v peak, it should be OK.

If there is a scale connected, Zx should respond withRx: ( the colon : is used as the line terminator) and Ix should respond with Ix,[mode number e.g. 0],[vernier type string Decimal or Binary], [measuement type Inch or MM]:

Without a scale it should send Nack (15h) each time the watchdog times out.

Have you tried it with a scale connected?

Bill

ecat
07-12-2010, 02:45 PM
Thanks again Bill, I'll check the speed and try the pullup.

The Zx reply was quite easy to work out :) As you can see in from the two sample replies in my previous post, Rx: appears as 0018 3A and Ix, appears as 0918 08. 'x' appears consistent, returning 18h, ':' is 3A which is correct, ',' appears as 08h.

Consistent, by this I mean that consecutive replies to a given request are often the same, or they fall into a pattern. Over time the values and patterns do change, with the possible exception of the ':'. Looks like a baud rate or level issue, or my Prolific is marginal.

No scale connected until I stop messing around and verify 1.9v operation, too costly to risk. What the PIC thinks it can see is another matter, stroking the component side of the board is enough to fool it into thinking something is there.

Can you confirm the value of the LED series resistor in the 1.5v supply part of the circuit ?

BillTodd
07-12-2010, 04:51 PM
R? is selected to give about 1v5 across the red LED (probably in the region of 330R) this only necessary because the 1v5 scales have the cell +ve connected to the metal body, so to avoid grounding problems I've shifted the PICs Vss supply (and the scales own Vss) 1v5 below the system (PC and Machine) ground.

If your scale has a 3v lithium cell you may have to rethink the power supply, because I'm not sure if the 3v scales have their metal body connected to the +ve end of the cell or not (none of mine are 3v) .

The other LEDs in the outputs are just to limit the voltage to the scale when the PIC output commands.

BillTodd
07-12-2010, 04:54 PM
Double post caused by this bloody snow!

ecat
07-12-2010, 05:07 PM
k,

All callipers are 1.5v.
Maybe I have some wack LEDs, don't think I've measured less than 1.7v across the one in the power section and that was with >1k resistor, not good for maintaining voltage stability at those values. I thing the vf of my reds is around 2v

BillTodd
07-12-2010, 07:05 PM
Try a couple of forward biased silicon diodes (e.g. 1n4148, or even 1n4000 series would do), they should give you about 0.7v each .

ecat
07-12-2010, 09:04 PM
YaY

Progress of sorts.... Or maybe just chance!

43 48 3A 49 58 0C 30 0C 44 41 43 49 4D 41 4C 0C CH:IX.0.DACIMAL.
49 4E 43 48 3A 49 58 2C 30 2C 44 65 63 69 6D 61 INCH:IX,0,Decima
6C 2C 49 6E 63 68 3A 00 18 3A 03 18 3A 02 18 3A l,Inch:

May not look like much bit it makes me happy...

Had a dodgy scope and a very old Thurlby storage adaptor on it, it looked very much like the transistor was slow in turning off. The above is the first time I've seen anything approaching English, trick was to half the value of the 3k3 collector resistor.

Unfortunately the above was looking like a 1 off :(

Undeterred I added a 2nd and 3rd parallel 3k3 ending up with 825r collector resistance. heh. It's alive :)

49 58 0C 30 0C 44 45 43 49 4D 41 4C 0C 49 4E 43 IX.0.DECIMAL.INC
48 3A H:

My Prolific dongle is only giving about -4v on DTR, problem?

BillTodd
07-12-2010, 10:13 PM
Hmm. -4v seems low, but if it works... I know I'm abusing the serial port, but I've used this circuit many times may be the prolific device is different to mine???

BTW are you driving it from a PC or laptop? (laptop USB ports seem to lack the ooomph required for most USB devices)


You could try sticking a 10u cap between the DTR line and Vss just to stiffen the -ve rail a bit.

Bill

ecat
07-12-2010, 10:34 PM
More progress \o/

The sharp eyed would spot the problem in my previous post, I had no commas! That's right, every comma, 2Ch, was coming through as 0Ch which is form feed :( I tried reducing the collector resistance a little more and the comma appeared but so did the occasional funny in the rest of the message :( :(

A little reading showed me another trick, adding a resister between base and emitter is a common way to speed things up. 3k3 between b and e and things appear to be working beautifully :) :)


Hmm. -4v seems low, but if it works... I know I'm abusing the serial port, but I've used this circuit many times may be the prolific device is different to mine???

BTW are you driving it from a PC or laptop? (laptop USB ports seem to lack the ooomph required for most USB devices)


You could try sticking a 10u cap between the DTR line and Vss just to stiffen the -ve rail a bit.

Bill

Indeed Bill, -4v does look poor, not much margin for error. I'm connecting to a PC but via a powered hub. Another experiment perhaps.

The DTR line looks quite solid, at least it did before my latest changes, heh. A cap certainly wouldn't hurt, thanks for the tip.

As of now your PC app is mostly happy with the board. A couple of range errors when I simulate the calliper with a finger swipe but no data errors so far. Thanks again for your help :)

ecat
08-12-2010, 06:23 PM
Not wanting to damage my actual scales I decided to risk my cheap but incredibly useful callipers at 1.88v. On the up side I know the meter I was using reads about 0.03v over actual, on the down side 1.85v is still around 20% above the voltage of typical fresh SR44 type battery :eek:. I'd normally consider 10% over to be a maximum safe(-ish) voltage but so far so good :tongue:, I have the PC app working and I've set the scale to -6.66mm for luck. I'll leave it running for a couple of days and see how it goes.

Thanks again Bill, elegant circuit and nicely crafted software :tongue:

irving2008
28-12-2010, 11:30 PM
Gosh you are a busy bee Sean!...

ecat
29-12-2010, 12:26 AM
I love the idea of absolute position feedback, should all but eliminate concerns about backlash. I also love the sound of pneumatic drive, well if it sounds like the doors from StarTreck :)

How are you planning to address the problem of overshoot? The nice thing about steppers (and servos?) is that you can never overshoot by more than 1 step (or the error response time of the closed loop in the servo?). I know nothing about pneumatics but I imagine it to be a 'springy' sort of drive which, when coupled with the 20ms response time of the callipers could lead to problems?

One note on your circuit: If I understand your description correctly, the metal work of the callipers will be +1.5 Volts above USB ground. USB ground is of course at PC/PSU ground. I've just tested a spare PC PSU I have lying around and it appears the PSU ground is connected directly to mains earth, could be a problem if the bed is earthed and the callipers also make an electrical connection to the bed? You look to be using a laptop and I think the power brick used by most laptops usually float with respect to mains earth, I'm never sure if this is a good or a bad thing, so I guess you'll be ok for now.


Quick update on my 1.8v test:
All looks good though I'm still cautious of trying out the real scales. I do like the LED's so I'll investigate swapping in some high brightness red devices which appear to have a lower forward voltage drop. The only problem I did notice was the occasional jumping of the measured value, a 100uf capacitor fitted close to the calliper end of the cable fixed that nicely :)

BillTodd
27-02-2011, 04:20 PM
Irving,
If you're still interested, the sensor PCB is available as a spare part for the Wixey saw bench

two 31" lengths for $35 :)

http://www.wixey.com/fence/spareparts/index.html



i reckon the combs should be easy to mill out on a CNC PCB mill. They are 0.6mm thick PCB double sided but the reverse is plain. On the top side is the T-comb structure and a ground strip. Since the mechnaism is a capacitive vernier it would seem perectly reasonable to manufacture this in say 150 or 200mm approx lengths where the end is exacly halfway through a 'T' and then end butt them together ensuring electrical conductivity across the join with a solder infil. getting positional accuracy on the second or subsequent 'comb' is the critical factor (as well as the basic accuracy of the comb). Some sort of jig might do the job.

Alternately, buy 3 cheap ones and look to join the PCB together as per above. Milling a new channel from stainless might be tricky, but aluminium might do just as well.

It worth an experiment don't you think?