Thread: Cheap Idea for a DRO
-
11-05-2010 #31Ah 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)I installed it and had to go and find/install the required inpout32.dll.
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.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?
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.One question I have is whether there is a practical maximum cable length between the reader and the PIC board.
[edit] found a 600mm scale on ebay:
http://cgi.ebay.co.uk/Mill-Lathe-Hor...item439ddc49a7
-
The Following User Says Thank You to BillTodd For This Useful Post:
-
11-05-2010 #32
-
13-05-2010 #33
It was not a problem, it was easy to find and install
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.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 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
That's quite a healthy length, much longer than I would need.I use 1.5-2m screened cables (soldered to the scale). It would be wise to route them away from strong noise sources.
Thanks Bill.
-
14-05-2010 #34
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
-
16-05-2010 #35
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
-
16-05-2010 #36
-
17-05-2010 #37
ISTR you can fit one or more PICs as required.
Congratulation John - that's more than I ever did :LOL:I'm getting to understand your assembly code
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.
-
17-05-2010 #38
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
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.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
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?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?
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.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.
Thanks for all your help. John
-
19-05-2010 #39
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.
-
19-05-2010 #40
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
A quick PIC to PC test:Code: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
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.Last edited by BillTodd; 19-05-2010 at 09:58 PM.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Website idea.
By qwertyjon in forum General ComputingReplies: 8Last Post: 05-04-2014, 03:29 PM -
Here's an idea hacking a Kress 1050 FME
By m.marino in forum Kress Milling MotorsReplies: 3Last Post: 16-01-2013, 01:05 AM -
Why they don't want to accept my idea?
By hoezap in forum Tool & Tooling TechnologyReplies: 5Last Post: 14-07-2012, 01:15 AM -
business idea?
By homer93 in forum Marketplace DiscussionReplies: 7Last Post: 01-06-2012, 12:56 PM -
BUILD LOG: Mel's Odd Idea
By mel_earp in forum DIY Router Build LogsReplies: 3Last Post: 19-03-2010, 11:54 AM

Reply With Quote


Bookmarks