> For the complete documentation index, see [llms.txt](https://help.qtech.co.nz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.qtech.co.nz/qtech/wireless-remote-control/multi-point-controller/radio-design-and-comms-failures.md).

# Radio design and comms failures

How polling works, what happens when links fail, and how to design for it.

Radio communications are never perfect. Given there is a statistical probability that a communication fault could arise either temporarily or over an extended period, System Designers should design explicitly for the eventuality. QTech recommends that the HOLD function be invoked where possible to avoid the effect of short or bursty communication failures.

{% hint style="info" %}
**Applies to:** Multi Point Controller (PD8620), firmware V2.03, from QTech's application note *Q48 Multi-Point Controller – Radio Communications* (Rev 01). It contains relevant information for system designers and advanced users.
{% endhint %}

The MPC is denoted as the **Master** because it polls each of the WP2P (**Remotes**) periodically in sequential order. Each radio connection from the Master to a Remote is called a **Link**.

![Multi Point Controller system overview](https://3621580088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa5hMAUl7E1cWeN5Rghg0%2Fuploads%2FOwc0qfpAycoDzGEFfFJJ%2Fmpc-system-overview.png?alt=media)

## How polling works

1. MPC sends a message with the values to set the outputs of Remote1.
2. Remote1 responds with the values of its inputs for the MPC, this serves as an acknowledgment that the message from the MPC was received.
3. If Remote1 does not respond within the *attempt timeout* time then the MPC resends the message again until the Remote responds or *N retry attempts* have been made, whichever occurs first.
4. Then Remote2 is polled in the same manner and subsequently all the Remotes.
5. Then when the polling period timer expires, the cycle is repeated. If the period is set to 10 minutes for example, the MPC will poll all remotes and when finished will wait until the 10-minute timer has expired before polling again.

At the **end** of the polling interval all the inputs and outputs on the MPC are updated. They are not updated immediately after each individual Remote is polled, so if it is critical that the I/O is updated as soon as possible then a shorter polling period must be defined. However, the polling period must be set to longer than the time it takes to poll all Remotes otherwise a new poll will start and the remaining unpolled Remotes will not be polled. In the case of Remotes controlling outputs on other Remotes (via messages to the MPC), it can take up to two poll cycles to complete the update.

As a rule of thumb: set the poll period to a number greater than

**the number of remotes (R) x number of retry attempts (N) x Attempt Timeout (A)**

For example, a unit with 8 Remotes with 3 retries, and an attempt timeout of 500 ms, the polling period must be at least 12000 ms (12s) but in practice a bit more would be added by the System Designer for good measure (say 16s).

## Lay out the system

1. Start by using a map, locate the desired position of the Masters on it.
2. Position each Remote a nominal distance of at most 1 km (line of sight), then proceed with more detailed design once all links have been defined to each Master with link paths minimised.
3. It may help to relocate the Masters to new positions to reduce link distances.
4. Next look at options for radio range extension on difficult links with overly large distances. Depending on terrain, distances in excess of 3 km are potentially problematic unless refinements are used.

The System Designer should try to optimise communications in the first instance by:

* Use high grade, 50 ohm impedance matched antennas tuned to the frequencies of interest (915-928 MHz).
* Use as much elevation as practicable when mounting antennas, and use low loss coaxial cabling (for 50 ohm systems).
* Ensure all equipment cases are correctly strapped or wired to earth (remove paint from the case if necessary).
* Use Yagi Antennas with high gain only where the most range is needed.
* Ask QTech if radio repeater options are a viable alternative for the application for increased range.
* Ensure that all cables are suitably tied to avoid fretting and degradation due to wind.
* Ensure that trees and foliage in the line of sight are regularly maintained or trimmed.

For regulatory reasons the Radio Power level for QTech supplied equipment is controlled and set in the factory. It cannot be changed by the Systems Designer or user. For the 900MHz band's power limits, see [900MHz ISM band channels](https://help.qtech.co.nz/datran/datran-telemetry/planning-and-design/900-mhz-ism-band-channels.md).

## What causes comms failures

* The weather can cause an increase in comms faults on a wet and windy or stormy day.
* Badly matched antennas can attenuate the signal with only marginal ability to communicate with a Remote sporadically if at all.
* A Remote located too far away or with a hardware fault (including low RF power output) or turned off would likely result in no messages getting through.
* Interference with other transmitters nearby could cause sporadic or bursts of comms faults.
* Tree or foliage growth in the line of sight of MPC and remote could degrade communications over time (experience more communications faults).

## Types of failure

| Failure         | What it means                                                                                                                                                                                                                                                                                                               | What the controller does                                                                                                                                                                                                                                                                                                                                                        |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Comms Fail**  | If either an MPC or Remote do not receive a response to a message sent by it to its paired device and all retries are exhausted then a Comms Fail fault is asserted in the transmitting device. It can persist or recur under adverse operating conditions or it can be a “one-off” due to a single message being affected. | The MPC asserts its Comms Fail Flag and also displays an error code on the Error led indicating the identity of the Remote that has not responded. A Comms Fail output (if configured) is asserted (turned ON) whenever a Comms Fail Flag is TRUE. The fault will remain in place until normal communications are resumed between the MPC and the relevant Remote (or Remotes). |
| **Link Fail**   | Communications with a Remote experience a continuous Comms Fail for about 30s.                                                                                                                                                                                                                                              | The MPC will only RELEASE (reset) those MPC outputs associated with the link in the I/O map and even then, only if those outputs are specifically configured with HOLD disabled (i.e. RELEASE enabled). The MPC will also partially reinitialise its radio module but try to avoid disrupting other links which are otherwise functioning normally.                             |
| **System Fail** | Communications with all remotes are such that they are all in Link Failure. This can also occur if all Remotes are turned off.                                                                                                                                                                                              | The MPC will reset itself entirely, it will reset all digital outputs, it will fully reinitialise its radio module and effectively behave as if it has been repowered. If this condition persists it will repeat the process until at least one Remote responds to messages.                                                                                                    |

## Outputs during a comms failure

* **Controller outputs:** on the MPC, the device is configured in Workbench for each of the 8 digital outputs to enable the HOLD function or the RELEASE function. See [Configure with Workbench](https://help.qtech.co.nz/qtech/wireless-remote-control/multi-point-controller/configure-with-workbench.md).
* **WP2P remotes:** the digital output will remain in its current state in the event of a link fault. See [Failsafe and output hold](https://help.qtech.co.nz/qtech/wireless-remote-control/planning-and-design/failsafe-and-output-hold.md), which notes a difference between QTech documents.

System Designers should consider carefully which behaviour is desired. For instance, using the HOLD facility could keep a water pump on and avoid temporary comms faults but other conditions might dictate that it is best to turn it off. On the other hand, if the RELEASE function is used then every time a message is missed (which might be reasonably often on a poor communications link), then the pump will drop out (be turned off), possibly needing manual intervention thereafter.

## Design ideas

* QTech recommends that the **HOLD** function be invoked where possible to avoid the effect of short or bursty communication failures.
* At least one output on the MPC should be dedicated to monitoring Comms Fail faults so that if they persist or of a long duration further action can be taken by a PLC, RTU, alarm messaging service or fail-safe controls.
* If a Comms Fail occurs and the HOLD function is configured just for key outputs, others could be released raising a fault condition to be handled by an alarm service, PLC or such like.
* Changes of state on the Comms Fail output could be counted or passed to a PLC where decision thresholds (e.g. the number of faults per hour) can be used to take further action. Changes of state on the Comms Fail output could be measured for duration or used by delay timers and if the comms fail is asserted for longer than a threshold time then further action can be taken.
* Remote units that are turned off for any length of time (out of service, say) should be dealt with by modifying the MPC I/O configuration to ignore the remote. Otherwise they will appear to show as Comms Failures.
* If there is sufficient I/O available, links can be monitored using a signal or a loopback at the remote or the MPC to check for continuity over the radio link and therefore if continuity is broken then implement alarm or contingency measures. If a loopback signal breaks, for example, local pump control can be instigated to avoid low pressure, or high-pressure faults. Loopbacks are also used to cycle the power on devices as a means of resetting elements of the system.
