Trybotics Logo

Arduino Resolver Module

DESCRIPTION

Tinee9 is back with a new module. This module is called a Resolver module.

In the world of motor control there are various types or methods of detecting position. Those method include hall sensors, XY sensors, resolver, RVDT, LVDT, field directors, potentiometer, etc. Depending on how each of these sensors are set up you can even determine your absolute position with out even having to save the last position to memory.

The module I am using can be used to demodulate an RVDT, LVDT, and Resolver but for today's purpose will be demodulating a resolver.

Technical Understanding: Expert Level

Tutorial Plug and Play: Intermediate Level

Supplies:

1: Arduino Nano

2: Resolver Module

3: Bread Board

4: 9.0 Volt Battery or NScope

5: Resolver

6: 10x Bread board Jumper Wires

Description:

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.

Description:

1: First you will need to place your arduino nano on a bread board

2: You need to hook up the 5V Pin on the Arduino to the +3V3 Pin and 5V pin on the Resolver Module (The module can have a supply of 3.3V while giving a 5V excitation on the resolver)

3: Connect RTN on the Arduino to the RTN on Resolver Module

4: Connect the D9 on the Arduino to the PWM on the Resolver Module

5: Connect A0 on the Arduino to MCU_COS+ on the Resolver Module

6: Connect A1 on the Arduino to MCU_SIN+ on the Resolver Module

7: Connect the Resolver EX+ wire to EX+ on the Resolver Module

8: Connect the Resolver EX- wire to EX- on the Resolver Module

9: Connect the Resolver COS+ wire to COS+ on the Resolver Module

10: Connect the 2 Resolver RCOM wires to RCOM on the Resolver Module

11: Connect the Resolver SIN+ wire to SIN+ on the Resolver Module

12: Hook up 9V Battery to RTN (-)and VIN (+)

13: Or Hook up Nscope +5V to 5V Pin on Arduino and RTN on Nscope to RTN on Arduino

14: Hook up Scope to USB on PC

15: Hook up Arduino to USB on PC

Description:

Copy Paste the Arduino Code below to your Sketch in the Arduino IDE

What this code is going to do is going to PWM the Resolver Module. That Module will excite the resolver and produce a squarish wave on the secondary coils of the resolver. The signals that come out of the Sin+ and Cos+ then get fed to an OPAMP that will centerish the Wave and reduce the output so that it goes between 0-5Volts.

Sin+ and Cos+ are as they mean. The Sin is 90 degrees out of phase with the Cos wave.

Since they are 90 degrees out of phase we need to use the Atan2 (Cos, Sin) function to get the correct coordinate of the resolver position.

Then the Arduino will spit out, after it has gotten 4 samples, a value between -3.14 and 3.14 which represent -180 degrees and +180 degrees respectively. This is why if you want to use the resolver for absolute position you must only use between -180 and 180 with out over rotating or else you will roll over and think you are back at the beginning or end of your actuator stroke. This would be a problem if you decided to use a resolver for the x or y axis of a 3D printer and rolled over causing the 3D printer to mess up.

I could have made the code a little better with interrupts to have more continuous PWMing but this will be sufficient for this application.

int A = A0;

int B = A1; int pwm = 9; int c1 = 0; int c2 = 0; int c3 = 0; int c4 = 0; int c5 = 0; int c6 = 0; int s1 = 0; int s2 = 0; int s3 = 0; int s4 = 0; int s5 = 0; int s6 = 0; float output = 0.00; int sin1 = 0; int cos1 = 0; int position_state = 1; int get_position = 0; void setup() { // put your setup code here, to run once: pinMode(pwm, OUTPUT); Serial.begin(115200); }

void loop() {

if(get_position<5){ switch(position_state){ case(1): digitalWrite(pwm, HIGH); delayMicroseconds(15); position_state +=1; break; case(2): position_state +=1; delayMicroseconds(5); break; case(3): position_state +=1; c1+= analogRead(A); s1+= analogRead(B); delayMicroseconds(5); break; case(4): position_state +=1; c2+= analogRead(A); s2+= analogRead(B); delayMicroseconds(5); break; case(5): position_state +=1; delayMicroseconds(5); break; case(6): position_state +=1; digitalWrite(pwm, LOW); delayMicroseconds(5); break; case(7): position_state +=1; delayMicroseconds(5); break; case(8): position_state +=1; c3+= analogRead(A); s3+= analogRead(B); delayMicroseconds(5); break; case(9): position_state +=1; c4+= analogRead(A); s4+= analogRead(B); delayMicroseconds(5); break; case(10): position_state = 1; get_position +=1; delayMicroseconds(5); break; default: break; } } else if(get_position>=5){ cos1 = (c1+c2)-(c3+c4); sin1 = (s1+s2)-(s3+s4); output = atan2(cos1, sin1); c1 = 0; c2 = 0; c3 = 0; c4 = 0; s1 = 0; s2 = 0; s3 = 0; s4 = 0; Serial.print("Position: "); Serial.println(output); get_position = 1; }

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

}

Description:

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


YOU MIGHT ALSO LIKE