Global Specialties ARX-MSP User Manual

Page 11

Advertising
background image

while (count72kHz<100) {

// Detect low level
if ((PIND & (1<<2)) == 0) oscillation = TRUE;

}
// If oscillator is running, no metal object is within

// range, so LED should be off
if (oscillation) FrontLED(OFF); else FrontLED(ON);

}
return 0;

}

This program will switch off the LED as soon as the oscillator is working.
Depending on the activated detection method (decay mode of the oscillations respectively variations
of the oscillator frequency), we will need different calibration methods. At first we will explain the
calibration for the decay mode of the oscillations. This simpler method should always be preferred
for testing the system (with the previously referenced program).
If the red LED at the extension board is not activated after switching on the system, please turn the
spindle trimmer clockwise until the LED is activated. The trimmer may be turned ten rotations
clockwise, respectively counter-clockwise and will not be damaged if you exceed the operating
area. If turning over ten rotations does not effect the system we will have to proceed with the
debugging phase...
After a successful calibration please place the robot on top of a definitely non-metallic location (on
top of a plastic or wooden box, respectively on a table without nails or screws...) and turn the
trimmer counter-clockwise until the LED extinguishes. You may have to repeat the calibration
procedure again, as temperature drifts and changing battery levels are influencing the operation-
point of the system. Careful calibrations will increase the sensitivity of the system but will also
reduce the intervals between re-calibrations.
As soon as you near the ping-pong ball with a metallic object (e.g. a screwdriver), the LED should
be activated – at least the moment you touch the system.
The sensor will now be sensitive enough to detect even small pieces of aluminium foil at the
backside of a paper board.
In order to monitor the frequency variations you should start by calibrating the sensor in the exact
application mode. In this mode the robot is to be placed in a position for the maximal level of the
expected sensor signal (e.g. very close to the metallic object). Then turn the trimmer counter-
clockwise as long as the LED is activated. Now you may use the following program for
demonstration purposes (MinesweeperTest2):

#include "asuro.h"
#include <stdio.h>

extern volatile unsigned char count72kHz;

int main(void)

{
unsigned char oldlevel=0, newlevel;

unsigned int freq;
int i;

char s[9];
Init();

DDRD &= ~(1<<2); // Change Port D Pin 2 to input

StatusLED(OFF);

Advertising