You are on page 1of 7

instructables

Arduino Resolver Module

by Tiny9

Tinee9 is back with a new module. This module is Tutorial Plug and Play: Intermediate Level
called a Resolver module.
Supplies:
In the world of motor control there are various types
1: Arduino Nano
or methods of detecting position. Those method
include hall sensors, XY sensors, resolver, RVDT,
2: Resolver Module
LVDT, field directors, potentiometer, etc. Depending
on how each of these sensors are set up you can
3: Bread Board
even determine your absolute position with out even
having to save the last position to memory.
4: 9.0 Volt Battery or NScope
The module I am using can be used to demodulate an
5: Resolver
RVDT, LVDT, and Resolver but for today's purpose
will be demodulating a resolver.
6: 10x Bread board Jumper Wires
Technical Understanding: Expert Level

Arduino Resolver Module: Page 1


Step 1: Resolver Module

There are a couple of things you can do with a resolver you can demodulate a motor for motor commutation, you
can get absolute position if you do not go past the null point, and you can retrieve speed from a motor.

Where I have seen them used most is in aerospace applications of aileron, rudder, missile fin, or camera control.

They tend to be a bit pricier than a pot or hall sensor but they give you incredible resolution.

Arduino Resolver Module: Page 2


Arduino Resolver Module: Page 3
Step 2: Setup

1: First you will need to place your arduino nano on a 8: Connect the Resolver EX- wire to EX- on the
bread board Resolver Module

2: You need to hook up the 5V Pin on the Arduino to 9: Connect the Resolver COS+ wire to COS+ on the
the +3V3 Pin and 5V pin on the Resolver Module Resolver Module
(The module can have a supply of 3.3V while giving a
5V excitation on the resolver) 10: Connect the 2 Resolver RCOM wires to RCOM
on the Resolver Module
3: Connect RTN on the Arduino to the RTN on
Resolver Module 11: Connect the Resolver SIN+ wire to SIN+ on the
Resolver Module
4: Connect the D9 on the Arduino to the PWM on the
Resolver Module 12: Hook up 9V Battery to RTN (-)and VIN (+)

5: Connect A0 on the Arduino to MCU_COS+ on the 13: Or Hook up Nscope +5V to 5V Pin on Arduino
Resolver Module and RTN on Nscope to RTN on Arduino

6: Connect A1 on the Arduino to MCU_SIN+ on the 14: Hook up Scope to USB on PC


Resolver Module
15: Hook up Arduino to USB on PC
7: Connect the Resolver EX+ wire to EX+ on the
Resolver Module

Arduino Resolver Module: Page 4


Step 3: Load the Code

Arduino Resolver Module: Page 5


Copy Paste the Arduino Code below to your Sketch int A = A0;
in the Arduino IDE
int B = A1; int pwm = 9; int c1 = 0; int c2 = 0; int c3 =
What this code is going to do is going to PWM the 0; int c4 = 0; int c5 = 0; int c6 = 0; int s1 = 0; int s2 =
Resolver Module. That Module will excite the resolver 0; int s3 = 0; int s4 = 0; int s5 = 0; int s6 = 0; float
and produce a squarish wave on the secondary coils output = 0.00; int sin1 = 0; int cos1 = 0; int
of the resolver. The signals that come out of the Sin+ position_state = 1; int get_position = 0; void setup() {
and Cos+ then get fed to an OPAMP that will // put your setup code here, to run once:
centerish the Wave and reduce the output so that it pinMode(pwm, OUTPUT); Serial.begin(115200); }
goes between 0-5Volts.
void loop() {
Sin+ and Cos+ are as they mean. The Sin is 90
degrees out of phase with the Cos wave. if(get_position<5){ switch(position_state){ case(1):
digitalWrite(pwm, HIGH); delayMicroseconds(15);
Since they are 90 degrees out of phase we need to position_state +=1; break; case(2): position_state
use the Atan2 (Cos, Sin) function to get the correct +=1; delayMicroseconds(5); break; case(3):
coordinate of the resolver position. position_state +=1; c1+= analogRead(A); s1+=
analogRead(B); delayMicroseconds(5); break;
Then the Arduino will spit out, after it has gotten 4 case(4): position_state +=1; c2+= analogRead(A);
samples, a value between -3.14 and 3.14 which s2+= analogRead(B); delayMicroseconds(5); break;
represent -180 degrees and +180 degrees case(5): position_state +=1; delayMicroseconds(5);
respectively. This is why if you want to use the break; case(6): position_state +=1; digitalWrite(pwm,
resolver for absolute position you must only use LOW); delayMicroseconds(5); break; case(7):
between -180 and 180 with out over rotating or else position_state +=1; delayMicroseconds(5); break;
you will roll over and think you are back at the case(8): position_state +=1; c3+= analogRead(A);
beginning or end of your actuator stroke. This would s3+= analogRead(B); delayMicroseconds(5); break;
be a problem if you decided to use a resolver for the x case(9): position_state +=1; c4+= analogRead(A);
or y axis of a 3D printer and rolled over causing the s4+= analogRead(B); delayMicroseconds(5); break;
3D printer to mess up. case(10): position_state = 1; get_position +=1;
delayMicroseconds(5); break; default: break; } } else
if(get_position>=5){ cos1 = (c1+c2)-(c3+c4); sin1 =
I could have made the code a little better with (s1+s2)-(s3+s4); output = atan2(cos1, sin1); c1 = 0;
interrupts to have more continuous PWMing but this c2 = 0; c3 = 0; c4 = 0; s1 = 0; s2 = 0; s3 = 0; s4 = 0;
will be sufficient for this application. Serial.print("Position: "); Serial.println(output);
get_position = 1; }

// put your main code here, to run repeatedly:

Arduino Resolver Module: Page 6


Step 4: Step 3: Have Fun

Enjoy rotating the resolver and learning how the resolver works and what applications you could use this resolver
module.

Arduino Resolver Module: Page 7

You might also like