PIC based DRO - Page 4

Page 4 of 6 FirstFirst 123456 LastLast
Results 61 to 80 of 113

Thread: PIC based DRO

  1. #61
    Registered
    Join Date
    Aug 2008
    Location
    UK
    Posts
    573
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by KiloOne View Post
    Yep, I wish I had a 3V signal level, then I would just have TTL input levels and use digital I/O ports on the Pic.

    Not to be, even though the battery is 3v, the output signal is only 1.5v.
    That's interesting. I have noticed how the scales are fairly sensitive to supply voltage, I wonder if running things at 3v has given the designer the opportunity to stabilise the supply?

    One of the main things I need to do is get rid of the battery and get the 10 microamps I need to power the caliper form the USB. I was just going to use a 3V zener to power it with a 100 uF cap on it.
    Or a simple resistive divider and a hundred nF would do @ 10uA

    Now this is a stupid question, why can't I just put the data lines to the comparator thru 10k resistors and forget the diodes?
    I added the LEDs to limit the voltage at the scale inputs (a red led has a Vfwd of about 1.2v, a couple of forward biased silicon diodes would have worked just as well).

    The scales I used have shared lines for the outputs and control buttons, so to change mode (e.g. switch to fast read mode for a DRO) you have to raise the level on the data and clock lines to the supply rail in an appropriate order by driving them from the o/p of the PIC. I found that If I raised them above 1v5 the scale latched up.


    [edit]

    BTW I checked the comparator setting; You are right I have set it for 0.625v not 0.75 - I can only think it was something I tweaked during development and forgot to correct the documentation

    Bill


  2. #62
    Registered
    Join Date
    Feb 2010
    Location
    USA
    Posts
    18
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by BillTodd View Post
    ...I wonder if running things at 3v has given the designer the opportunity to stabilise the supply?
    Probably, but if I just had 2.25V I would maybe risk trying TTL. Most likely a backward compatibility issue.

    Or a simple resistive divider and a hundred nF would do @ 10uA
    The only reason I said 100mF was because that is what the Shumatech people are doing. Any Idea what frequency noise glitches you are having to filter out?

    I added the LEDs to limit the voltage at the scale inputs (a red led has a Vfwd of about 1.2v, a couple of forward biased silicon diodes would have worked just as well).
    Ah yes, I remember you saying this earlier, sorry. Isn't the power to light up your LEDs coming from the caliper outputs? I guess whatever that current is, it is not pulling the signal down.

    I found that If I raised them above 1v5 the scale latched up.
    The + data out line is 1.5v and it does not lock up when I trigger Zero and Mode with 1k resistor, although I don't see any obvious thing that the Mode trigger does. Yeh!

    ...something I tweaked during development and forgot to correct the documentation
    No problem I do it all the time, more often I don't even rem my code. Shame Shame.


    Back to assembly code. VB6 is so way far ahead of this C18 stuff in terms of syntax checking, error documentation, user interface, debugging ... it is laughable. It turns out that the error I was getting was pointing me to the _asm line that I added and it was actually not a syntax error but some other error having to do with memory allocation I was trying in the NEXT line.

    I was trying to declare all the same variables that you did by using inline asm insertion. Eventually I had to just declare them in C.

    The question I have come up with in doing this is that I don't know how to declare rxbuff and vdata. You use 2 and 4 consecutive bytes for these but you only reserve the first byte in memory. What will stop the following 1 and 3 memory bytes from being used by some other code I didn't write without my knowledge?

    Would I have to declare them as a 2 byte INT and 4 byte LONG in C and if so, does that mean I could not use the asm code of say vdata+2 to access the 3rd data byte in vdata? If not I guess I would have to go with some weird byte addressing scheme.

    Sorry for being such a pain.
    Dale



  3. #63
    Registered
    Join Date
    Aug 2008
    Location
    UK
    Posts
    573
    Downloads
    0
    Uploads
    0

    Default

    Any Idea what frequency noise glitches you are having to filter out?
    The glitches look like spikes on the data of clock o/p. They could be caused by supply noise or possibly interrupts or some other software reason

    The question I have come up with in doing this is that I don't know how to declare rxbuff and vdata. You use 2 and 4 consecutive bytes for these but you only reserve the first byte in memory. What will stop the following 1 and 3 memory bytes from being used by some other code I didn't write without my knowledge?
    I cut my teeth on 6502 & z80 assemblers that had few of the bells and whistles of MPASM so I have not used the higher level declaration options.

    I guess you could declare the buffer spaces as int or long or pretty much anything that is easy to access (you'll need to do some bit manipulation), just check the byte order is the same in asm and C or it'll cause confusion when you try to decode it. As to stopping the variables being over written, there should be some way of making them static in C.

    vdata+2 should work as long as the byte order is correct (i.e. (vdata )<(vdata+1))


    Sorry for being such a pain.
    No problem - I'm just pleased someone else is using my code

    Bill


  4. #64
    Registered
    Join Date
    Aug 2010
    Location
    United States
    Posts
    12
    Downloads
    0
    Uploads
    0

    Default

    Hey guys, this stuff is very interesting. I've read and attempted to follow your hardware and coding.

    I like the idea of a simple of the shelf UBS enabled board to do all this with, like was shown in the original post and on this website http://www.msh-tools.com/DRO/index.html. I contacted the original developer and am talking to him about getting the datastream spec (format, data send) from him. Hope to be succesfull in that, if so, I plan on making a standard C application to read the data from the UBS device. Probably with both a display mode and a daemon mode where the data is written to a file (or device) to be used by other processes (CNC program?)

    My thinking is to add the chinese scales to a CNC enabled mill and be able to use the same computer with Linux for my CNC application or as a DRO as needs arise.

    I've got a lot of programming and automation background, but my hardware knowledge is dated at best, so I need to leverage other peoples hardware skills to augment my own.

    Rob



  5. #65
    Registered
    Join Date
    Feb 2010
    Location
    USA
    Posts
    18
    Downloads
    0
    Uploads
    0

    Default

    Rob, I was sooo close to making this work but I had to move on to other projects.

    I expect to get back to it at some point.

    I think the external board on the msh-tools site is too cumbersome.

    It is too hard to find connectors for the data port (never did find any). To solder all 4 lines on you have to completely disassemble the caliper. With the following concept, the scale has a mini usb connector thru a hole that is easy to make in the battery cover and only the 2 centered lines need be soldered onto the board which I have done without taking the caliper apart.

    Concept: I'm thinking of making a round PCB the size of a 2032 battery that is used in my calipers. One SOIP 18F13K50 and very few external components. It will have a vertical mini-USB connector that comes thru a hole in the battery lid. I can sneak the 2 signal wires inside the case to their pcb pads and solder them on thru the existing connector hole. Ground and V+ can be transferred to the caliper thru contacts on the pcb mating to the battery compartment contacts. Should be pretty neat, especially if I can use the USB PIC.

    I got stuck on the converting the coding to the PIC18F87J50 FS USB PIM demo board since I have no experience with C.

    I'll send you the demo board if you want to work on the code now.

    Dale



  6. #66
    Registered
    Join Date
    Aug 2010
    Location
    United States
    Posts
    12
    Downloads
    0
    Uploads
    0

    Default

    I did find the connectors for the data board! In several places as a matter of fact, both pre-assembled cables and loose connectors.

    I did see your idea to use the battery space for the USB logic, great idea, I like that a lot, but it doesn't make much of a difference in my opinion, both will need a central box to consolidate the cabling (USB Hub or signal converter) and I think the external USB box is easier to make assuming I can get the right connectors.



  7. #67
    Registered
    Join Date
    Feb 2010
    Location
    USA
    Posts
    18
    Downloads
    0
    Uploads
    0

    Default

    I believe the connectors you found are for the smaller 4 and 6 inch calipers with the +ve ground. I tried those on the 6 inch calipers and they fit poorly and were loose.

    The larger un-grounded calipers have a larger data port.

    The round pcb has the SOIP 18F13K50 on it that creates the USB data stream.

    No external board is needed, just a USB cable to the PC.

    Dale



  8. #68
    Registered
    Join Date
    Aug 2010
    Location
    United States
    Posts
    12
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by KiloOne View Post
    I believe the connectors you found are for the smaller 4 and 6 inch calipers with the +ve ground. I tried those on the 6 inch calipers and they fit poorly and were loose.

    The larger un-grounded calipers have a larger data port.

    The round pcb has the SOIP 18F13K50 on it that creates the USB data stream.

    No external board is needed, just a USB cable to the PC.

    Dale
    I'm attaching a picture of the scales and datacable, I'm pretty sure those are the larger ones. They use the larger battery and are NOT +ve ground.

    I understand that each scale with the SOIP 18F13K50 on it creates a USB datastream, but with 3 or 4 scales that's a lot of USB traffic, I would want to consolidate that down to 1 port on my pc, requiring a USB hub. I'm thinking of using an old USB hub enclosure I have to mount the 342 based toolstick resulting in the same overall look with plug-in scales (1 to 4) and a single USB connection to the PC.

    Looking into the code for the 342 and thinking about adding a rotary indicator (pot?) to be able to get a DRO in degrees for my 4th axis as well, but that will be version 2 at least.

    Attached Thumbnails Attached Thumbnails PIC based DRO-scales-grp3b-jpg  


  9. #69
    Registered
    Join Date
    Feb 2010
    Location
    USA
    Posts
    18
    Downloads
    0
    Uploads
    0

    Default

    I only have a 1 or 2 scale use in mind so a hub is not necessary.

    Good luck, keep us informed.

    Dale



  10. #70
    Registered
    Join Date
    Aug 2008
    Location
    UK
    Posts
    573
    Downloads
    0
    Uploads
    0

    Default

    thinking about adding a rotary indicator (pot?) to be able to get a DRO in degrees for my 4th axis as well,
    Might be worth investigating the protocol used by these digital angle finder/protractor heads

    See here: http://homepage.ntlworld.com/bill_todd/DAF/daf.html

    Bill

    Bill


  11. #71
    Registered
    Join Date
    Aug 2010
    Location
    United States
    Posts
    12
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by BillTodd View Post
    Might be worth investigating the protocol used by these digital angle finder/protractor heads

    See here: http://homepage.ntlworld.com/bill_todd/DAF/daf.html

    Bill
    I like that, may be a little beyond my current capability though to hack into the hardware of something like that. Maybe after I get the Basic DRO working I can get some support on that part.

    Received my ToolStick today and got the software for it loaded, it works under windows and is recognized on BSD and Linux. I wrote a very basic Linux C application to read data from the device, the documentation for the ToolStick342DC firmware from the original author is pretty hard to read.

    Over the weekend I'll try to get the other parts needed and get the board wired up. I don't have the scales yet, so I'm limited to what I can do with the hardware and testing. I may spend some time on implementing some DRO code. Also have to get the garage and driveway cleaned up, picking up the mill on Monday and need to be able to drive it as close as possible to final location.

    For now I'll keep the software very basic, just show DRO values with the ability to zero out any axis.



  12. #72
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2392
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by BillTodd
    ...
    Might be worth investigating the protocol used by these digital angle finder/protractor heads

    See here: http://homepage.ntlworld.com/bill_todd/DAF/daf.html

    ...
    I think they already have done most of it on that page... The 'scope waveforms clearly show SEA is taken low first, then the sensor outputs data using SDA output and SCK input which looks very straightforward.

    You can see SCK is taken high, the sensor sets the state of SDA at that point which is then read when SCK goes low.

    As for the code contained in the 24 bits themselves, it's a guess but it wouldn't be hard to set it to 90' and read the bits, then try 0' and read again etc.



  13. #73
    Registered
    Join Date
    Aug 2008
    Location
    UK
    Posts
    573
    Downloads
    0
    Uploads
    0

    Default

    I think they already have done most of it on that page.
    Erm... it is MY page

    I was suggesting he figure out the protocol - to save me the trouble

    Bill

    Bill


  14. #74
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2392
    Downloads
    0
    Uploads
    0

    Default

    Whoops! :embarassed:

    You did a good job so far. The SDA and SCK with an enable wire is possibly an SPI protocol?

    Anyway you can read SDA at every \ edge of the SCK pulse.

    If you set the device at 90.0' and 180.0' (or 0') and say 89.5' and post pictures of the SDA/SCK waveforms for each reading it will probably be easy enough to work out.

    I'll guess initially it might be similar to a 3byte reading from a 3-axis accelerometer, where only 2 axis are supported (so the last 8 bits is always 0).

    Or for more accuracy it could be 2 10bit values or 2 12 bit values etc with some padding bits to make it up to 3 bytes total.

    All just guesses of course.



  15. #75
    Registered
    Join Date
    Aug 2008
    Location
    UK
    Posts
    573
    Downloads
    0
    Uploads
    0

    Default

    I'll guess initially it might be similar to a 3byte reading from a 3-axis accelerometer, where only 2 axis are supported (so the last 8 bits is always 0).
    Possibly.

    Although, I suspect it is the same type of capacitive sensor used in digital verniers, so would expect either a nice simple decoded angle in BCD (not necessarily in degrees) or an 'absolute binary' count (with zero fixed at power on)

    Bill


  16. #76
    Registered
    Join Date
    Aug 2010
    Location
    United States
    Posts
    12
    Downloads
    0
    Uploads
    0

    Default

    Finally got my scales in today.

    The good:
    - The scales are easy to mount
    - The cables I have fit on the scales

    The bad:
    - There are 3 different models!!!
    - 1 small one (8 inches)
    - 2 medium ones (6 and 12 inches)
    - 1 large one (18 inches)
    Everything is different, not just the size.
    Biggest challenge is the power requirement, the large one has the larger 3volt battery that the electronics are setup for.
    The small and midsize ones are for 1.5volt, so the signal doesn't work well. May have to do some rebuilding here

    Any ideas how I can get both the input voltage and the reference voltage to work on the 1.5v scales? or am I just screwed here? remember I don't have the pic code so I may be limited to what I can change. I can just ignore the 3volt 18" scale because I don't really need it (it was for an optional idea I had).

    So any ideas how I change the hardware to give me 1.5volts for scale power and a good comparator voltage to go with it?



    Last edited by schilpr; 09-01-2010 at 09:17 PM.


  17. #77
    Registered jhovel's Avatar
    Join Date
    Oct 2010
    Location
    Australia
    Posts
    93
    Downloads
    0
    Uploads
    0

    Default

    Any progress on the PC DRO using chinese scales?
    I have 3 scales and cables for my horizontal mill and an old pen computer to mount on the mill.
    I've looked a the USB DRO pages on USB DRO and also YADRO: What kind of DRO kit is that, in brief? - prefer the Windows interface of USB DRO....
    I have no suitable programming skills but can solder bits together....
    Unfortunately, I have not been able to buy the USB required C8051F342 toolstick without MURDEROUSLY expensive freight charges here in Australia.... and Silicon Labs can't be bothered talking to me directly about sticking one in the mail in a padded bag....

    So I was following this thread - and then it stopped.....

    Cheers,
    Joe

    Joe in Aus


  18. #78
    Registered
    Join Date
    Aug 2008
    Location
    UK
    Posts
    573
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by jhovel View Post
    Any progress on the PC DRO using chinese scales?
    I have 3 scales and cables for my horizontal mill and an old pen computer to mount on the mill.
    I've looked a the USB DRO pages on USB DRO and also YADRO: What kind of DRO kit is that, in brief? - prefer the Windows interface of USB DRO....
    I have no suitable programming skills but can solder bits together....
    Unfortunately, I have not been able to buy the USB required C8051F342 toolstick without MURDEROUSLY expensive freight charges here in Australia.... and Silicon Labs can't be bothered talking to me directly about sticking one in the mail in a padded bag....

    So I was following this thread - and then it stopped.....

    Cheers,
    Joe
    If your pen computer has a serial input or can use usb-serial, I suggest you build my one using one cheap 8pin pic per channel. Can you, or anyone you know, program the 12F675 PICs? (I'd offer to send you them, but it'd be cheaper to get them on your side of the planet )

    The files are posted back in the beginning of the thread or you can download them from my website:

    Bill's Website VB app
    Bill's Website pic source

    There's another self build thread here: http://www.mycncuk.com/forums/showth...Idea-for-a-DRO

    Bill

    Last edited by BillTodd; 01-13-2011 at 01:58 PM.
    Bill


  19. #79
    Registered jhovel's Avatar
    Join Date
    Oct 2010
    Location
    Australia
    Posts
    93
    Downloads
    0
    Uploads
    0

    Default

    Many thanks Bill,
    had a look at your pages and links and your code.
    Looks like just the ticket for what I have in mind.
    Yes, my pen PCs have serial ports! and yes, I have someone to program PIC chips for me - might even get a cheap programmer myself and learn how to do it.
    Have you designed a PCB for your circuit that you can let me have the overlay off? I can etch them OK.... (through mounted components preferred
    Cheers
    Joe

    Joe in Aus


  20. #80
    Registered
    Join Date
    Aug 2008
    Location
    UK
    Posts
    573
    Downloads
    0
    Uploads
    0

    Default

    Have you designed a PCB for your circuit
    I did, but it has no psu components so may not be worth copying (see attached .pdf). The layout works fairly well on Veroboard or similar.

    Attached Thumbnails Attached Thumbnails PIC based DRO-dro-pdf  
    Bill


Page 4 of 6 FirstFirst 123456 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

PIC based DRO

PIC based DRO