If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Here is what my unit looks like. Also, I managed 40cm with my gold ring.
The case is a waterproof clam-shell with an over-center clamp, and an o-ring seal.
The handle is a cutdown walking stick ... just perfect ..
So I did the calculations, why the such precise timing? I don't see the need?
You can make very precise calculations but at the end of the day if you toggle the pin by software (bit-banging with digitalWrite()), especially inside an interrupt, you have to add the latencies which are not constant. The actual pulses will vary in timing from one period to the other, depending on which instruction is being interrupted. These vatiations are called jitter, and result in higher noise and loss of sensitivity.
You want to control the pulses by hardware with the precision of the crystal clock, which is not a problem because Atmega328P has the right peripheral to do the job.
Why not take andvantage of it? It also results in cleaner code and you don't have to mess wth offsets.
But I'm not forcing you, just giving you a choice for FREE. No thanks!
You can make very precise calculations but at the end of the day if you toggle the pin by software (bit-banging with digitalWrite()), especially inside an interrupt, you have to add the latencies which are not constant. The actual pulses will vary in timing from one period to the other, depending on which instruction is being interrupted. These vatiations are called jitter, and result in higher noise and loss of sensitivity.
You want to control the pulses by hardware with the precision of the crystal clock, which is not a problem because Atmega328P has the right peripheral to do the job.
Why not take andvantage of it? It also results in cleaner code and you don't have to mess wth offsets.
But I'm not forcing you, just giving you a choice for FREE. No thanks!
I was asking a question of Gunghouk, different discussion, try not to be so sensitive ..
I was asking a question of Gunghouk, different discussion, try not to be so sensitive ..
To answer your question the aim was to standardise the software loop time and ISR times to allow the ISR to complete without interrupting itself thus causing jitter. Most of the ISR time was spent bit banging the outputs, hence fast digital write instead. While attempting that it became obvious that other sections of code were adding to loop time, such as floating point maths in the pulse timing routine. So in for a penny.... I eliminated conditional statements as stated in the comments and used integer variables wherever possible. As stated by Teleno it is not about absolute accuracy but more about consistancy in pulse timing by hardware (preferred) and/or software.
To answer your question the aim was to standardise the software loop time and ISR times to allow the ISR to complete without interrupting itself thus causing jitter. Most of the ISR time was spent bit banging the outputs, hence fast digital write instead. While attempting that it became obvious that other sections of code were adding to loop time, such as floating point maths in the pulse timing routine. So in for a penny.... I eliminated conditional statements as stated in the comments and used integer variables wherever possible. As stated by Teleno it is not about absolute accuracy but more about consistancy in pulse timing by hardware (preferred) and/or software.
Set the delay to where it is most sensitive for gold. REDUCE the delay to where gold does not respond, but other metals still respond. By just these two delay settings, you can tell if you have gold or not, even "just" discriminates against pull tabs I had my wife do a blind test with various samples of target, and I was able to pick the gold out every time.
I could not achieve that with your existing code, so feel it is a worthwhile improvement to the project.
Set the delay to where it is most sensitive for gold. REDUCE the delay to where gold does not respond, but other metals still respond. By just these two delay settings, you can tell if you have gold or not, even "just" discriminates against pull tabs I had my wife do a blind test with various samples of target, and I was able to pick the gold out every time.
I could not achieve that with your existing code, so feel it is a worthwhile improvement to the project.
So you tried the frequency/amplitude modulation. How did it go?
I asked cause you linked to the sketch that also does the f modulation. Anyway the timing is just the same.
Yep, sorry, should have linked earlier on. I will try the freq modulation post wedding and update your thread then, no time now. I have also ordered an OLED for the delay display.
Set the delay to where it is most sensitive for gold. REDUCE the delay to where gold does not respond, but other metals still respond. By just these two delay settings, you can tell if you have gold or not, even "just" discriminates against pull tabs I had my wife do a blind test with various samples of target, and I was able to pick the gold out every time.
I could not achieve that with your existing code, so feel it is a worthwhile improvement to the project.
Comment