Skip to content

05. The Controller

JonasForssell edited this page Aug 3, 2017 · 17 revisions

The controller consists of minimum three parts that are stacked on top of each other. The stacking creates a connection between the boards though the analog and digital pins.

The Signal

To understand how the reciever functions we must first explain a little about the signal. The wire you place in the garden is connected to a transmitter in the base station. The transmitter sends a current through the wire.

The current will generate a magnetic field according the right hand rule you maybe recall from school

The coils in the mower will not sense this field, but they will sense changes to the field. If the field increases or decreases, it will generate a little voltage in the coil. The voltage will be positive or negative depending on the direction of the field as well as if it increases or decreases.

In the figure you can see the BWF wire placed in the garden and how the magnetic field is generated. If the mower is inside the BWF, the magnetic field will pass down through the coils if the current is running in clockwise direction (black) or up through the coils if it is running in the other direction.

The transmitter now controls the current by turning it on and off according to a pattern.

The figure above shows the current in the BWF. In the middle, the current is shut off. Above the middle, we are sending the current in positive direction and below, it is going the other way. We control the BWF current exactly in the same way we control a DC motor and making it run backwards or forwards.

The reciever is designed to sense the change in only one direction. If it is inside, it will sense if the current goes up and when it is outside it will sense if the current goes down. Remember that it only can sense CHANGES in the magnetic field.

We can use this now to create different signals. The arduino in the mower will measure the time passed between the signals. If the mower is inside, it will be the time you see on the top in the figure and is the mower outside, it will see the time shown in the lower part of the figure.

Inside, it will get a number sequense of 2, 101, 100 Outside it will get 101, 102

The signal is repeated so these numbers will come back over and over again.

The current program has simplified the number sequence to 2 for inside and 102 for outside. In the latest design, these numbers are different (If I recall right it is 86 and 4, but the principle still applies.

The numbers are actually time expressed in milliseconds. Most of the time the current in the wire is shut off and this is for a reason. The motor shield would be very hot otherwise and we significantly reduce the power needed to generate the signal.

Reciever

The reciever is custom made by the group. It is originally based on a design by P-O Johansson which we have adopted to work in an arduino enviroment. It has been slightly extended to handle up to four different BWF sensors.

Here is an outtake of the design, showing the reciever part of the circuit.

The sensor signal comes in from top left at BWF Sensor A, B The first step is an amplification of the signal. The capacitor in C8 provides a filter function at the same time to eliminate spikes.

The amplified signal now goes in the the second OpAmp where it is translated into an On - Off signal (squared).

The squared signal is now passed through a diode. This eliminates all negative pulses and allows only the positive to pass. It is important step because this is the key component that allows us to understand if we are inside or outside the wire.

Next, the pulse is referenced to a holding value to make it more stable (Hold)

This value finally fed into the arduino. The pulse will trigger an interrupt inside the arduino and run a timing routine which notes the time since the last pulse.

Controller & related pins

Motor shield

Arduino

Connections

# The Controller

Clone this wiki locally