I need help using expansion valve

Hello everyone, first of all I apologize for my poor English. That's why I write using a translation app. I have a Danfoss ETS 6 model expansion valve. I need to use PWM with Arduino. It has 5 pins. I'm thinking of using the L298N motor driver module. However, I could not find any reliable data about entry and exit. The valve has a working structure like a servo motor. Can you help me to use this foundation on Arduino without damaging it? I would like to share the official Datasheet file I found for the engine.
Danfoss_ETS_6_electronic_expansion_valves.pdf (912.1 KB)

The translation seems to be working just fine.
But are we looking at the same documentation? When I read through what you linked to, it SPECIFICALLY says and shows it uses stepper motor logic. There is never a mention of PWM,

this link seems to explain what you are looking of :wink:

you need to check your servo wiring and 'number of steps per revolutions' as it may differ from the example but the coding should be the same.

hope that helps...

The tutorial linked to by sherzaad in post # 3 is for a bipolar stepper motor.

This is the Last Minute Engineers tutorial for a unipolar stepper motor like the Danfoss expansion valve has:

1 Like

I would not recommend an Arduino for that application, failure could be catastrophic depending on the rest of the system. Be sure you are sure it will be OK if the Arduino fails.

Arduinos were designed for and are are intended for experimentation and learning, often with breadboards and loose wires that eventually break if vibrated. Most important, the boards are not protected against harsh, dirty or electrically noisy environments found in industrial, automotive and other commercial applications. It is unreliable as it is not suitable for industrial, automotive and other commercial operation.

Thanks everyone for your answers. I barely had time to look. I didn't realize it was a stepper motor. I want to try it and write information as soon as possible. I would like to say this about Arduino. It's another world. I sit it on the PCB. I will fix it and there will be a box with a cooling system on the outside.

Thank you everyone, I didn't realize that. Now I need your help on 1 issue. How can I go directly to the step count for a 480 step stepper motor? I edited the stepper.h library. I saw an int variable called stepper_number there, I think that's what I'm looking for.

Hope you have found what you want. But, what provision have you made to know where the stepper is in relation to the internal end stops of the valve?

I'm just trying to adjust it to full open and full closed position. If I solve this, I will find a solution to it. Do you have any suggestions?

What tells you that the valve is full open or closed? Don't see anything about it in the documentation. I suspect the only feedback is the volume passing through the valve.

This is what comes to my mind: If I can figure out which step to take, I think I can understand the fully open and fully closed positions with the control switch or by forcing the amperage it draws. But first, how do I get there?

Looking at the sample layout and use in the documentation, the temperature of the refrigerant seems to be the feedback controlling the valve opening and closing. Are you doing a similar project and can use the analog of some other sensor to tell when to open or close just a bit?

The datasheet warns not to exceed 520 pulses so I would assume, on startup or reset you would drive 490 ~ 500 pulses toward closed and call that 0 (zero). The coil resistance is 43Ω, at 12V, 280mA, so maybe too high for ULN2003 (150mA).
Arduino Stepper library cannot do the single coil at a time sequence (wave step) the datasheet describes.

You can parallel sections of the ULN2003 per the data sheet if you have a current problem. The ones I have are rated at 500mA per section.

There are some methods I want to try today. I will write again later and comment, friends.

Hello guys, I think I'm making a connection error. It both warms up and cannot turn with difficulty. I gave energy as 12v and 24v. It hasn't changed. When I give 12v, 9v comes to the outputs and out2 cannot be energized.When I give 24v, it reaches around 16v and 17v, again O3 cannot receive healthy energy. As a result, the engine does not turn, I am angry. Do you have any comments?


Scripts;

#include <Stepper.h>
const int stepsPerRevolution = 480;
int targetStep;
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); 
void setup() {
 myStepper.setSpeed(5);
 Serial.begin(9600);
}

void loop() {

/*
myStepper.step(stepsPerRevolution);
myStepper.step(stepsPerRevolution);
myStepper.step(stepsPerRevolution);
myStepper.step(stepsPerRevolution);

Serial.println(stepsPerRevolution);*/



  targetStep = 0;
  myStepper.step(targetStep);
  Serial.println(targetStep);

    delay(500);

  targetStep = 480;
  myStepper.step(targetStep);
  Serial.println(targetStep);

    delay(500);
  
}

I have changed the relevant section in the library.

if (this->pin_count == 4) {
    switch (thisStep) {
      case 0:  // 1000
        digitalWrite(motor_pin_1, HIGH);
        digitalWrite(motor_pin_2, LOW);
        digitalWrite(motor_pin_3, LOW);
        digitalWrite(motor_pin_4, LOW);
      break;
      case 1:  // 1010
        digitalWrite(motor_pin_1, HIGH);
        digitalWrite(motor_pin_2, LOW);
        digitalWrite(motor_pin_3, HIGH);
        digitalWrite(motor_pin_4, LOW);
      break;
      case 2:  // 0010
        digitalWrite(motor_pin_1, LOW);
        digitalWrite(motor_pin_2, LOW);
        digitalWrite(motor_pin_3, HIGH);
        digitalWrite(motor_pin_4, LOW);
      break;
      case 3:  // 0110
        digitalWrite(motor_pin_1, LOW);
        digitalWrite(motor_pin_2, HIGH);
        digitalWrite(motor_pin_3, HIGH);
        digitalWrite(motor_pin_4, LOW);
      break;
      case 4:  // 0100
        digitalWrite(motor_pin_1, LOW);
        digitalWrite(motor_pin_2, HIGH);
        digitalWrite(motor_pin_3, LOW);
        digitalWrite(motor_pin_4, LOW);
      break;
      case 5:  // 0101
        digitalWrite(motor_pin_1, LOW);
        digitalWrite(motor_pin_2, HIGH);
        digitalWrite(motor_pin_3, LOW);
        digitalWrite(motor_pin_4, HIGH);
      break;
      case 6:  // 0001
        digitalWrite(motor_pin_1, LOW);
        digitalWrite(motor_pin_2, LOW);
        digitalWrite(motor_pin_3, LOW);
        digitalWrite(motor_pin_4, HIGH);
      break;
      case 7:  // 1001
        digitalWrite(motor_pin_1, HIGH);
        digitalWrite(motor_pin_2, LOW);
        digitalWrite(motor_pin_3, LOW);
        digitalWrite(motor_pin_4, HIGH);
      break;
    }
  }

Hello to everyone. I made it work. I'm writing an answer in case it helps someone else in the future. Throw away the datasheet data. It needs to be rotated in order. It throws 80 species.