Example Code

cRIO code to read position from a Synchro

Code and Documents

Attachment

Overview

Sychros are small rotary devices that are commonly used in aircraft to remotely duplicate an angle mechanically in different locations. They can also be used to measure angular position and that is what this code achieves.

Description

Synchros have an inductively coupled rotor and three phase windings in the stator. Apply an ac excitation to the rotor and you will get three outputs whose magnitude is dependent on the angle between rotor and stator. If we measure the differences between these three outputs, we can accurately calculate that angle.

In this first version, a simultaneous sampling module is used (NI 9215) to measure the three outputs and also the excitation waveform. The excitation for this particular synchro is supposed to be 400Hz at 26V but for the purposes of this work, I've just used an NI 9269 AO module to directly drive the rotor coil. It can only manage 1V amplitude before it all becomes too much for it, but 1V is sufficient for our needs. It would be better to use a simple amplifier and also to ac couple the drive so that if the output stops mid-cycle, we don't just heat the rotor coil. The 9269 can only output 10mA and so there is little to worry about in this example.

The code sums the measurements during the upper 80% of the peak or trough in the excitation waveform. It then uses the difference between these to calculate the angle, updating the reading at 800Hz.

In preliminary testing I am reading the angle with a noise level of about +-0.01 degrees.

This is still version 1 as I want to implement the arctangent on the FPGA to report the angle directly, but in testing I was having issues to the extent that I've written a replacement atn function. This appears to work well but does introduce an angular offset error when included in this code and so it will follow later once more testing has been done.

Steps to Implement or Execute Code

Connect it all up (refer to the project) changing module references as needed.

Connect your synchro as follows...

The rotor connects directly to the 9269 module. Connect one side to common on the 9215 and connect the rotor drive signal across AI3

Now, for the phases, connect one phase to each side of AI0 AI1 and AI2. They form a triangle so AI0 is phase 1 - phase 2, AI1 is phase 2 - phase 3 and AI2 is phase 3 - phase 1. Also connect one of any of the inputs to common to stop it floating too far.

Run the code.

Suggest improvements...

Requirements

Software

LabVIEW 2015

LabVIEW 2015 RT module

LabVIEW 2015 FPGA module

(This could be done exactly the same in older versions too)

Hardware

A compactRIO target

NI 9215 or similar( the NI 9220 is a great choice)

NI 9269 or other analogue output module with some amplification

Additional Images or Video


Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors