CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Distance measurement !! CTMU ??
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mglsoft



Joined: 18 Feb 2008
Posts: 48

View user's profile Send private message

Distance measurement !! CTMU ??
PostPosted: Mon Sep 10, 2012 10:28 am     Reply with quote

How accurately can read time CTMU module of a PIC??
I have to measure time of reflection of a signal with maximum precision of an inch.
You can get to do this module?
_________________
MGLSOFT
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Mon Sep 10, 2012 11:18 am     Reply with quote

Quote:
How accurately can read time CTMU module of a PIC?

Does not the data sheet supply enough information to work it out?

Quote:
I have to measure time of reflection of a signal with maximum precision of an inch.
You can get to do this module?

1) What is the nature of your signal?
2) What is the range over which you want to measure?
3) How are you converting from distance to something the PIC can detect?

Mike
mglsoft



Joined: 18 Feb 2008
Posts: 48

View user's profile Send private message

PostPosted: Mon Sep 10, 2012 11:47 am     Reply with quote

I have read the datasheet for the PIC and the CTMU module section, but can not find answer to this question, so I put my question here.

The distance to be measured is a few inches (2.5 cm or 1 "), and the timing should give me a measurement of the order of picoseconds, to get that accuracy.
The conversion is simple, the speed of sound and the flyback signal give me away.
That's why we need such precision ...
_________________
MGLSOFT
Ttelmah



Joined: 11 Mar 2010
Posts: 19369

View user's profile Send private message

PostPosted: Mon Sep 10, 2012 1:03 pm     Reply with quote

You talk about the speed of sound. So you are thinking about using an ultrasonic transducer?. The CTMU can be used for this, and potentially give very good accuracy, _but_ your pulse train will need to be very short, or it'll still be being sent when the reflection occurs at such a short range You are on the 'edge' of different technologies at this sort of distance. The CTMU is normally used to measre capacitance changes,to give a touch sensor ability. This though is not an accurate distance measure, since other factors (what is apporaching, humidity etc.), wiill cause larger changes. If the other object to be detected, is your choice, then inductive sensing would probably be a better choice at such a short range. Have you looked at AN1375?.

Best Wishes
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Mon Sep 10, 2012 4:20 pm     Reply with quote

Quote:
I have read the datasheet for the PIC and the CTMU module section, but can not find answer to this question, so I put my question here.
OK I'll rephrase my question

How does the CTMU actually measure time?

Quote:
The distance to be measured is a few inches (2.5 cm or 1 "), and the timing should give me a measurement of the order of picoseconds, to get that accuracy.
The conversion is simple, the speed of sound and the flyback signal give me away.
Now I'm confused.

The speed of LIGHT in air is ~ 1 ft / ns or just over 1" / 100ps.
Then you talk about SOUND which is ~1 million times slower!

How are you proposing to generate fast enough pulses of either?

You have still not answered my question about range. (Are you wanting to measure distances of inches, feet, or yards with 1" resolution?)

Mike
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Mon Sep 10, 2012 8:00 pm     Reply with quote

Quote:

timing should give me a measurement of the order of picoseconds, to get that accuracy.


You are never going to get this kind of resolution, or accuracy,
with ANY PIC or any kind of standard logic enhancement either for that matter. You are not going to get within 6 order of MAGNITUDE to that kind of timing ........
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Tue Sep 11, 2012 8:19 am     Reply with quote

The PIC counters all work from a clock source. Look at the PIC data sheet to see how fast this clock can be. The fastest PIC clocks I know of are 40MHz.

The counter can count to a resolution of one clock cycle. A 40 MHz clock has a cycle of 1/40M = 25ns. 25 nanoseconds is MUCH slower than the picoseconds you are asking for. A PIC will never measure to such resolution without a lot of special hardware help.

Now you are also asking for 1" at the speed of sound. The speed of sound varies with material, about 1100'/s in air, 6000m/s in steel, etc.. Assuming you are working in air 1" = 1/(1100' x 12) = 76us. 76 microseconds IS something a PIC can measure easily.

Decide what you want, one inch or picoseconds? What material is your sound going through? Let us know when you have some answers.
_________________
The search for better is endless. Instead simply find very good and get the job done.
Ttelmah



Joined: 11 Mar 2010
Posts: 19369

View user's profile Send private message

PostPosted: Tue Sep 11, 2012 8:52 am     Reply with quote

As a comment, the CTMU, can potentially measure times shorter than the PIC clock.
It measures change of voltage, against time.
You measure one element of the equation:
I ⋅ t = C ⋅ V
If (for instance), you pulse an input for time T, with a known capacitance, and I fixed, then you measure V with the ADC, the time 'estimates' can be an order of magnitude shorter than the PIC clock.
I have measured pulse widths of only a very few nSec using this module. However, there is a huge amount of variability, with you needing to calibrate from a known pulse to get any sort of accuracy.

The big problem here is that using a slow traveling signal, like sound, makes measurement relatively easy, but you are back to just how few cycles of the waveform can be generated. One cycle from a 40000Hz transducer, is about 1/3rd inch long in air. This is why it'll be much easier if there is something attachable to the other side that needs detection. Measuring the change in inductance, as a piece of metal approaches, for example, is relatively much simpler.

Best Wishes
mglsoft



Joined: 18 Feb 2008
Posts: 48

View user's profile Send private message

PostPosted: Tue Sep 11, 2012 11:54 am     Reply with quote

The measured distance will be a minimum of 50 meters and maximum 1.8 km.
The accuracy should keep in the entire range.

The CTMU module type has two trigger inputs that perform start and end of a very precise timing.
I understand that measuring time by the CTMU module, is not related to the clock of the PIC.

The intent is to measure the round-trip time of a signal in AM, using it to measure distances very accurately, this signal will be triangulated with two other similar measurements.

I think this answers several questions that respondents have raised here.
_________________
MGLSOFT
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Tue Sep 11, 2012 12:48 pm     Reply with quote

Quote:

measured distance will be a minimum of 50 meters and maximum 1.8 km.


fine - thats a handy datum.

so, now what is the MEDIUM involved ??

if it is AIR with SOUND - kilometer distances are kind of loooong

if its a coaxial cable with electronic pulses - then we are getting somewhere, but of course there is another issue to consider.

anyone who has ever used a TDR ( as i have) knows that w/o knowledge of VF for the medium - your "distance" will be wildly WRONG

of course you do know that if the medium is a cable , then a precise knowledge of velocity factor is going to be essential to your desire for
accuracy. the VF for vacuum is 1.000 and for sea level air is 0.99971.

but for typical cable insulations: TEFLON is 0.695
Polyethylene is 0.659 Foam poly ranges 0.85 - 0.77
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Tue Sep 11, 2012 1:06 pm     Reply with quote

Quote:
The measured distance will be a minimum of 50 meters and maximum 1.8 km.
The accuracy should keep in the entire range.

The CTMU module type has two trigger inputs that perform start and end of a very precise timing.
I understand that measuring time by the CTMU module, is not related to the clock of the PIC.

The intent is to measure the round-trip time of a signal in AM, using it to measure distances very accurately, this signal will be triangulated with two other similar measurements.

I think this answers several questions that respondents have raised here.
OK. This is rather like pulling teeth. You've now answered SOME of our questions, but left us with a whole new set.

Presumably you're working with radio in free space, rather than sound, since you are talking about triangulating.

How are you going to generate your pulses?
What makes you think you can get resolution of 25mm over a distance of 1.8km?
(25mm in 1.8km is roughly 10 parts per million)
How big is your transmitter?
How big is your reflector?
What is the wavelength of the radiation you intend to use?
What do you mean by AM?
(I know what I understand by the term, you may have a different interpretation)

Mike
mglsoft



Joined: 18 Feb 2008
Posts: 48

View user's profile Send private message

PostPosted: Tue Sep 11, 2012 2:05 pm     Reply with quote

Thanks for answering.

And to think that some people think that the CCS compiler is toy, if they saw the level of responses, probably would not think the same.
If you believe this myself, probably would not come here, not even to look at this forum ...

Well, I called my answers ...

The physical medium is air, since this distance measuring is positioning as an alternative to RTK GPS systems, which in places like where I live, are having problems with solar storms, and will further worsen.
Regarding changes with the weather, sea relative height, etc., I can see that data and make corrections when necessary calculation.
That does not bother me.

The idea is not new, is issued with radio signal AM (amplitude modulation) at a frequency, the signal received at a receiver at a predetermined distance, forward this PING on another frequency and then read it on the device from which it was originally issued signal.
That's where I need to accurately measure the time spent in air emitted PING, to know the relative distance between these two points.
Using the same process on two points arranged in a triangle, should get a substantial improvement in the measurement of distances that may enable me to work quite accurately when you have no proper RTK signal.

They seem possible to put into practice?

This answers all the questions before they left??
_________________
MGLSOFT
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Tue Sep 11, 2012 3:36 pm     Reply with quote

I've had enough and giving up.

Mike
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Tue Sep 11, 2012 5:04 pm     Reply with quote

Quote:

accurately measure the time spent in air emitted PING


Are you trying reinvent LORAN ???
Very Happy Very Happy Very Happy

I politely suggest that your problem is not actually with the PIC or CCS
but rather that of a fundamentally, incomplete or flawed concept of how you believe you can do RDF, or some such position location scheme.

Perhaps it is obvious to YOU, but inscrutable and ill-formed to the rest of us.

You need a PLAN - then a SCHEMATIC of your electronics and THEN perhaps you will be ready to code for control of your hardware, because you are sure as heck NOT gonna directly receive let alone discriminate multiple RF carriers and modulations with just a PIC and a few lines of code.

Frankly what you have posted makes no sense at all to me, at least as far as the often conflicting info you have slowly dribbled out to date.

Best of luck with whatever it might be that you confused about Very Happy
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Sep 11, 2012 11:56 pm     Reply with quote

I agree to the comments saying that the discussed problem isn't essentially a PIC timing measurement
problem. IMHO ps resolution delay measurement is the more simple part of the project.

Regarding CTMU features there's a Microchip AN 1375 discussing it in detail. Timing measurement is said to
achieve "below ns" resolution. You should also review the ECN article quoted therein.

There are two basic limitations of CTMU:
- you won't get better than some 100 ps resolution due to jitter and crosstalk of on-chip signals
- absolute range of the measurement is limited to about 1000 units by the 10-bit ADC

If we ignore the obvious other problems for a moment, a CTMU resolution of 0.5 ns coresponds to 5 cm
distance in a RF or optical round-trip measurement. But the maximum range would be only 50 m.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group