Radio/magnetic field: detect direction of antenna

In summary: If one of the signal wires go low for a certain amount of time then the arduino can't tell which direction the wire is pointing in. It will just think it's pointing at the ground.In summary, the problem is trying to detect if a wire is to the left or right of a detecting circuit. There are three possible solutions, but all of them have some issues. The first solution is to move around, but this has a high error rate. The second solution is to use a compass and add a DC component, but this also has a high error rate. The third solution is to use a vertical magnetic field and detect when the current in the coil is negative for longer than it's positive position. However, this
  • #1
petterg
162
7
Hi guys,
It's been 15 years since I played with radios, and I've basically forgotten everything.
Do you think I'm on the right track with this problem? Do you have any suggestions for the circuit needed for the generator and/or receiving filter described in the last two paragraphs?
Or maybe you have a totally different idea of how to solve the problem?

(Hop I manage to express this in English in a way you'll understand.)

I'm trying to design a circuit (for use in a robot) that can detect if a wire carrying an AC-current is to the left or right of the detecting circuit. Luckily we operate in a limited 3D environment that can be considered as a 2D environment. (The cable is on the ground, the sensor in the robot will be placed a tiny bit above the ground. The robot is moving around on the ground, the XY-plane.)
However, as the robot has motors there will be some magnetic disturbance involved.

Assume that our 2D world is a XY-plane and the wire is placed along the Y-axis. And we know the current passing through the wire. Then we can detect the strength of the electromagnetic field with the known frequency from the wire and approximate the distance (x1) from the circuit to the wire. So we get that abs(Xr)=x1
(Xr is the position of the robot i X-direction. Xr=0 means the robot is on the cable.)

Now the problem: How can we know if Xr=x1 or Xr=-x1 ?


First thought for solution: Move in one direction, see if the signal get stronger or weaker. (Calculate new x1).
Why it doesn't work: The approximation of x1 has an error of up to 40% off, because of various disturbance. For the application x1 is good enough, if we just could figure if it's positive or negative. It will require to much moving in order to get a delta x1 with an acceptable level of certainty.

Second thought for solution: When the robot is above the wire, keep track of which direction it moves.
Why it doesn't work: It works 99% of the time. We need some method that works 100%, or combine this with another 99% method. The most obvious fail is when the robot is powered on at a random position.

Third though for solution: use a compass and add a DC component to the wire. The compass would align with the wire.
Why it doesn't work: Even though this would work even when the compass is 89 degrees off, the disturbance can be enough to make it go 180 degrees off. (And we want to adopt this navigation to also detect Y-position from a wire along the X-axis. It wouldn't work at all with two crossing wires.)

Forth though for solution: (This is probably the way to go, if just can figure how to do it.)
Make use of vertical magnetic field direction around the wire. When current flows through the wire, magnetic field will point up on one side, down on the other. With a vertical coil in the detector circuit the direction of current in the coil will tell which way the field around the wire goes, hence we know which side of the wire the detector is.
Issue to solve: The current in the wire has to be AC. Hence it (and the magnetic field, and the current in the detector coil) is changing direction all the time. We need some way for the detector to know which way the current in the wire flows. I'm thinking the easiest way to do this would be to "stretch" the sin-wave in the wire so that the current is negative for about twice the time of it's positive time. Then the detector can detect if the current in the coil is negative for longer than it's positive it's position has positive value of x - or the other way around.
(If a sin-wave use time t for a full wave it's positive for t/2 and negative for t/2. This modified wave I try to make/detect is positive for t/3 and negative for 2t/3.)

Now the challenge 1: How to design a generator for such a wave signal?
Adding a DC component will probably not work. I think the amplitude in both positive and negative direction should be equal. Hence there will be need for a change of frequency every 1/2 wave length.

challenge 2
The receiver circuit will connect to a arduino board. I'm thinking the circuit may provide two signalwires: a highpin (high level when positive current above a certain level in the coil) and a lowpin (high level when negative current above a certain level in the coil). If both are low the level of current is to low. Then the arduino can be programmed check which of the pins that are high for the longest period and conclude on positive or negative x1. But the receiver circuit still needs a filter, quite narrow bandpass to filter the frequency/frequencies from the sender to filter out most other electric/magnetic noise.
 
Engineering news on Phys.org
  • #2
We need some way for the detector to know which way the current in the wire flows. I'm thinking the easiest way to do this would be to "stretch" the sin-wave in the wire so that the current is negative for about twice the time of it's positive time.
That is DC+AC as well, as you get a net current flow.

You need some way to break the symmetry of the wire. A homogeneous magnetic field won't help, a modification of the current flow looks better.
How to design a generator for such a wave signal?
What is available? A function generator can do that, electronic circuits can do that.
I think the amplitude in both positive and negative direction should be equal. Hence there will be need for a change of frequency every 1/2 wave length.
That is not a frequency change - your signal will be the sum of multiple frequencies, all of them are integer multiples of the base frequency. I think you don't have to care about that.

But the receiver circuit still needs a filter, quite narrow bandpass to filter the frequency/frequencies from the sender to filter out most other electric/magnetic noise.
Program code?
 
  • #3
Thanks for your quick reply, mfb

mfb said:
That is DC+AC as well, as you get a net current flow.

You need some way to break the symmetry of the wire. A homogeneous magnetic field won't help, a modification of the current flow looks better.

With "stretching" the wave I'm thinking something similar to the attached picture. It shouldn't be homogenous, and it's not DC.
Are you thinking some kind of modulation? If so I think the modulated signal must be in sync with the carrying signal in some way so that it can signal the waves current phase. To me that sound far too complicated. (Although miracles can be performed with the help of magicians.)

mfb said:
What is available? A function generator can do that, electronic circuits can do that.
Components need to be ordered anyhow, so basically anything on ebay is available. However, the goal is to make this thing, so I'm aiming for components, not a preassembled generator. I was thinking maybe a couple of 555 timers could be enough for creating the signal?
Maybe it's better to go for a square signal and go for a pattern like: fast high, fast low, pause, fast high, fast low, pause ...

mfb said:
That is not a frequency change - your signal will be the sum of multiple frequencies, all of them are integer multiples of the base frequency. I think you don't have to care about that.

Sure it's a sum of lots of frequencies (everything is), but I don't really see how to make the sum generated in a not-homogenous way without making a full bunch of oscillators. It sounded easier to adjust the speed of how the voltage is changed depending on what the voltage is.

Would a filter tuned for the base frequency not filter away all the other frequencies added?

mfb said:
Program code?

If the receiving circuit makes the pinA high when current is above triggerlevel in one direction and pinB high when current is above triggerlevel in the other direction, the new signbit for x1 will be given as:
NOR(A, NOR(B, previousSignBit))
 

Attachments

  • carl-signalproposal.png
    carl-signalproposal.png
    1.1 KB · Views: 442
  • #4
With "stretching" the wave I'm thinking something similar to the attached picture. It shouldn't be homogenous, and it's not DC.
Well, depends on the definition of DC. It has a net current flow.
Sure, that waveform could (at least in theory) allow to determine the side.

Maybe it's better to go for a square signal and go for a pattern like: fast high, fast low, pause, fast high, fast low, pause ...
I think I would count to 3 and generate a pattern like low, low, high, repeat. Or use the lowest two bits without reset for the pattern low, low, low, high, repeat, this avoids the reset.
Why do you need an alternating current, by the way?

Would a filter tuned for the base frequency not filter away all the other frequencies added?
Why do you want to use filters?
 
  • #5
The idea with filter is to reduce disturbance. Brushed engines do create quite a bit of "random" magnetic fields.

How would you signal two low's after each other? Like the attached picture?

The reason for alternating current is only to create magnetic fields that can be detected. Distance can be estimated from the power at receiver, and hopefully positive/negative value of the distance decided in some way. I can't think of any other way of doing this. Any suggestions are welcome.
 

Attachments

  • carl-signalproposal2.jpg
    carl-signalproposal2.jpg
    4.1 KB · Views: 455
  • #6
If you have a magnetic field sensor (~measurement has to be faster than the period of the current), I don't see the point. If your receiver is antenna-like and reacts to alternating fields only, things get tricky. A superposition of two frequencies could be possible.
 
  • #7
I think magnetic field will be to disturbed by the motors so that is probably not possible. The only possible way I can think of is a wave from the wire that can be identified.
 
  • #8
What is your noise environment like? You probably don't want to use 60Hz for the signal, since there is so much 60Hz noise around (assuming you are in the US and not Europe). What is the room like where you are doing this? What other noise sources are around?

It would be nice if the room were shielded, since that would give you less noise and give you more flexibility in the waveform that you choose to drive on the cable.

And then there is the issue of the robot generating noise itself. You should try to minimize that noise, and you should characterize what that noise looks like, so you can avoid the frequencies of that noise when you pick the frequency of the cable signal.

You might also want to add some modulation to the signal on the wire, so that your detector circuit can use the appropriate demodulation to give you a better SNR overall for the system.
 
  • #9
BTW, you can also use tricks like cutting power to the motors at the instant that you are listneing for the cable's signal...
 
  • #10
mfb said:
If you have a magnetic field sensor (~measurement has to be faster than the period of the current), I don't see the point. If your receiver is antenna-like and reacts to alternating fields only, things get tricky. A superposition of two frequencies could be possible.
That's what I was thinking. Something similar to an Instrument Landing System (ILS) technique.

http://static.landing-system.com/thumbs/ground-equipment-position.jpg
 
  • #11
berkeman said:
What is your noise environment like? You probably don't want to use 60Hz for the signal, since there is so much 60Hz noise around (assuming you are in the US and not Europe). What is the room like where you are doing this? What other noise sources are around?

It would be nice if the room were shielded, since that would give you less noise and give you more flexibility in the waveform that you choose to drive on the cable.

And then there is the issue of the robot generating noise itself. You should try to minimize that noise, and you should characterize what that noise looks like, so you can avoid the frequencies of that noise when you pick the frequency of the cable signal.

I'm in Norway, so your 60Hz would be 50Hz here. This project is performed outdoors and most noise is the engines them self. They are quite random (circles, various directions, various center of the circles, various strength, and many of them. It all sums up to "random"), hence hard to compensate for. Shielding them turns out to be much harder than I expected.

Picking a frequency that is not disturbed is relatively easy. Picking a constant (DC generated field) is much harder. Hence I'm aiming for an AC that can be phase identified.

A workaround can, as you say, be switching of all motors for stabilizing the magnetic field, then read a DC component of the field. It's not ideal though, as it involves stopping everything regularly.

berkeman said:
You might also want to add some modulation to the signal on the wire, so that your detector circuit can use the appropriate demodulation to give you a better SNR overall for the system.

Yes, modulation is probably the solution. But even with modulation it's the direction of the carrying signal that needs to be detected. The modulated signal will just be signaling the carriers phase. But I don't really see how it can be done. As I remember modulation the carriers frequency has to be at least 4 times the modulated signal. That means there's simply not enough resolution to modulate the phase of the carrier.
I'm sure there must be a trick to this. It's just a matter of figuring it out.
 
  • #12
dlgoff said:
That's what I was thinking. Something similar to an Instrument Landing System (ILS) technique.

The ILS is a beam. I think the detection is based on detecting which beam the receiver is in. I'm kind of stuck with "a beam" that is the same in both fields (both sides of the wire), except that they are inverted, and for the moment symmetrical. It's a matter of making the signal not symmetrical.
 
  • #13
Maybe something like the attached signal could work?
I think this can be made from a timer setting a positive potential over a capacitor, then disconnects and let the capacitor discharge through the wire (wire must be connected in both ends).
When the potential gets below a certain level a negative pulse is triggered, and a slowly discharge through the wire.

That sounds like a signal that can be generated without too much hassle. And a detector for the pulses should also be possible. The hardest part might be to make the detector able to detect the pulse from far away (low amplitude) without being distracted by the discharge when it's close to the wire.
 

Attachments

  • carl-signalproposal3.jpg
    carl-signalproposal3.jpg
    5 KB · Views: 395
  • #14
Maybe something like the attached signal could work?
The only asymmetry I see is the small step at the end of the positive part. That will be hard to see.

What about a sawtooth profile?
 
  • #15
The asymmetry is that it's a pulse that is positive, then negative. The detector has to decide if it receives positive-negative-pause or negative-positive-pause.
 
  • #16
I don't see a significant pause in your sketch. It is possible to add one, of course.
More details about the expected noise levels and their frequencies would be interesting.
 
  • #17
Along the timeline there is actually twice as much delay from low to high as there is from high to low.

Noise frequencies depend on motor rotations. If there are no motion the frequency is 0. If a motor is running fast there is a higher frequency noise. Speed varies, hence frequency varies. Motors positions varies, hence the disturbance direction varies. Then there will be 7 of those motors, all running at different speeds and angled in different directions, having different distance from the detector circuit. On top of that we have the wiring, and each motor is controlled by PWM. All in all the disturbance is far to complicated to predict, so the disturbance must be considered as random.
 
  • #18
Sure, but random in which way. I would expect that all frequencies of the motor are less than 1 kHz. If you can send an AC signal with 10kHz for example, and measure it, motor noise is just an offset which varies a bit in time.
 
  • #19
That's true. Noise is probably less than 400Hz. So AC > 1,6kHz (=4x max disturbance) should be safe.
But an AC can't be used to identify direction, even at high frequencies and a DC will be disturbed. So there is a need for something more advanced.
 
  • #20
But an AC can't be used to identify direction
It can, if you give it some structure. Using the 10kHz-value (so we have 100µs per cycle), something like "30µs one direction, 70µs the other direction" can be identified. The noise won't change significantly within those 100µs.
 
  • #21
How do you generate a wave like that?
 
  • #24
Like that, right. Something "more rectangular" is probably easier to generate, at least with digital logic.
 
  • #25
I thought for a while you put me on the right track, but on second thought I think something is forgotten. What the detector will detect is periods with positive or negative current in the receiving coil. As the current is made from changes in the magnetic field we actually want the derivative of the sent wave to be negative for a longer period than it is positive. The derivative of the signal in post #3 is symmetric.
(Or I'm stuck with some mental hangup now?)
 
  • #26
Well, the time differences between the detected field changes is different then.

A Hall sensor would measure the actual magnetic field and not its change.
 
  • #27
Will a hall sensor respond fast enough for fields change in the range 2k...10kHz and be able to filter out the lower frequencies?
 
  • #29
If the theory in post #25 is correct, I guess a generated sawtooth signal would be good for the purpose of coil detection. Anyone agree?
 
  • #30
To follow a wire you need some phase reference to identify which side you are on. So consider two small pickup coils. One is mounted on the vertical axial plane of the vehicle, the other is horizontal. The vertical plane coil detects a phase reference signal from the wire. If these two signals are multiplied, then low pass filtered, the sign of the resultant detected DC signal will indicate if the vehicle is to the left or the right of the wire. The multiplication can be done by an RF mixer chip or the differential signals digitised into a square waves with comparators, the two digital signals are then “multiplied” by an ExOr gate, (Exclusive Or), and low-pass filtered to generate the left/right steering signal.

I would avoid using high frequency RF on the wire because it would not be a regular transmission line and so may develop standing wave current nulls on the line due to reflections, that could make the signal undetectable. So keep the line length well below one tenth of a wavelength. The current in the wire can be an audio sine wave, say 1kHz, the wire being driven by an audio amplifier. The system could work just as well with an audio soundtrack or broadband pseudo-random sequence signal in the wire. This will not tell you which way along the wire the vehicle is travelling. To do that at high frequency would get messy with a terminated wire transmission line and a directional coupler.

Alternatively a DC current could be used for direction information but it would be hard to detect direction in the Earth's field, or near DC powered electric motors.

A momentary current pulse, say once each second might be detected directly by the vertical coil, the polarity of the detected spike would identify direction along the wire.
 
  • #31
Baluncore said:
To follow a wire you need some phase reference to identify which side you are on. So consider two small pickup coils. One is mounted on the vertical axial plane of the vehicle, the other is horizontal. The vertical plane coil detects a phase reference signal from the wire.

Wow! Great!
Does this require the horizontal coil to face the same direction all the time? In this case it's not going to do that. Currently the abs(X1) is found by two horizontal coils, separated by 90 degrees. Then they are added together (digitally) as Pythagoras. This give a value that is independent of which way the coils are facing, but it's also loosing the sign component of the signal.

If I understand your description, the method makes use comparing phase in the horizontal and the vertical coils, and that will require the horizontal coil to face the same direction at all times. I hope I'm wrong.

All though, comparing phases from all three coils might be the way to go?

Baluncore said:
A momentary current pulse, say once each second might be detected directly by the vertical coil, the polarity of the detected spike would identify direction along the wire.

That would be the sawtooth generated signal, right?
Cause, a momentary current pulse in the wire will have just as much positive as negative change of magnetic field, hence require the detector to see what came first. While the sawtooth in the wire makes the magnetic field change fast in one direction and slow in the other. (I'm not sure about this at all.)
 
  • #32
The phase of the signal is determined by the direction the flux passes through the coil, use your “Right Hand Rule”. The horizontal plane coil, flat with the floor, will always be above the wire so it will have a phase and magnitude determined by the left/right horizontal position error. The vertical plane coil will have a phase determined by the direction faced along the wire. That phase reverses if you turn the vehicle 180°, but so does the left/right phase picked up by the horizontal plane coil, so the phase detection still steers correctly along the line.

No sawtooth wave is needed, just the DC pulse. The AC coupling of the mixer will fix the asymmetry and be ignored by the mixer. By following and holding peaks of both polarity from the vertical plane coil, their comparison will show which direction the vehicle is facing.

A perpendicular pair of coils at 45° to the horizontal could be used. They would need to be converted to sum and difference by a couple of op-amps. The low-pass filtered product of the sum and difference voltages would be the left/right steering signal. This is really just an electrical rotation of the coil orientation. Phase detection is identical.
 
  • #33
I don't see how the phase on the vertical coil will change when turning the vehicle 180 degrees in the horizontal plane. Using the right hand rule with my thumb up, my fingers point to the left no matter how much I rotate my body in the horizontal plane. As far as I can see the phase in horizontal coils change when the vehicle turn, while the phase in the vertical does not. And that makes this a little more complicated.

When turning the horizontal coil the signal will become weaker as the vehicle turns, until it's 0 when vehicle has turned 90 degrees, then it becomes stronger with the inverted phase when turning towards 180 degrees. To avoid this dead signal at 90 degrees I have an extra horizontal coil that is placed perpendicular to the other horizontal coil. As the signal weakens on one, it's getting stronger on the other, and using Pythagoras we know that I(h1)^2 + I(h2)^2 = constant at a position independent of the vehicles direction.

Maybe multiplying all three coils will be the solution?
 
  • #34
Here's why horizontal + vertical coil won't work, even 2 horizontal + 1 vertical won't work:
The variables affecting the detecting coils are:
- signal phase, 1D, positive or negative
- vehicle position in X-direction, 1D, positive or negative
- vehicle heading, 2D, positive or negative values in both X and Y direction

This sums up to 4 dimensions. To describe an unique position in this environment there is a need for a 4 bit value. Hence there is a need for detecting the signal i 4 different ways. 3 coils give 3 a 3 bit value. We need one more!

I think that 4th sensor has to be an unsymmetrical wire signal. Any opinions on the sawtooth idea?
 
  • #35
petterg said:
Using the right hand rule with my thumb up, my fingers point to the left no matter how much I rotate my body in the horizontal plane.
Your thumb represents the current, your fingers the magnetic field. The wire is along the ground surface so your thumb should point away or towards you. The magnetic field from the wire rises on one side and falls on the other.

Maybe there is a misunderstanding here of the orientation of coils.
petterg said:
As far as I can see the phase in horizontal coils change when the vehicle turn, while the phase in the vertical does not. And that makes this a little more complicated.
A horizontal plane coil lies flat on the ground surface with a vertical axis and is totally independent of heading direction. If the horizontal plane coil is on one side of the wire it will have the opposite phase to the other side of the wire. There will be no signal or phase when centred over the wire.
A vertical plane coil is mounted on the lengthways vertical plane of the vehicle with it's axis aligned left/right. It has a phase determined by the direction the vehicle is pointing. It becomes the phase reference on the vehicle.
 

Similar threads

  • Electrical Engineering
Replies
2
Views
260
  • Electrical Engineering
Replies
7
Views
191
  • Electrical Engineering
Replies
14
Views
4K
Replies
10
Views
613
  • Electrical Engineering
Replies
10
Views
862
Replies
17
Views
1K
Replies
1
Views
49
  • Electrical Engineering
2
Replies
39
Views
4K
  • Electrical Engineering
Replies
5
Views
2K
  • Electrical Engineering
Replies
20
Views
3K
Back
Top