1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Question Pneumatic valve control with SMC3?

Discussion in 'DIY Motion Simulator Projects' started by Laszlo Horvath, Apr 5, 2024.

  1. Laszlo Horvath

    Laszlo Horvath New Member

    Joined:
    Dec 30, 2023
    Messages:
    5
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hi
    I bought a used pneumatic simulator. It was in pieces and there was no description or photos of it. It came with a P8055 Velleman controller. However, since I didn't know anything about the program and none of my computers recognized the panel, I thought I would solve it with the already tried and tested simtools-smc3 pairing.

    The system looks like this: there are 4 working cylinders with 4 control valves (R414002005). I branched out from the outputs of the valves, with one branch connected to the lower part of one working cylinder, while the other branch is connected to the upper part of another working cylinder. To control these, an analog signal of 0-10 volts is required, so I received a TLC2272 operational amplifier. Feedback is provided by two SM6-160 (R412010411) mounted on two working cylinders, which also communicate on 0-10V, thus receiving some resistance.

    I've approached the issue in several ways, tried putting analog signal directly to the output, tried with ibt2 and l293 insertion, and currently, the program is in MODE1, with each input of TLC2272 connected to a direction (IN1+, IN1- ---> ENA, PWM; IN2+, IN2- ---> ENB, PWM), with outputs going to the two valves working in opposition.

    Truth be told, I've reached the same point through various routes where I'm stuck now. When I start the system according to the description, I set all variables related to PID to 0, and the system stops. As I increase the Kp value even just to 1, the system starts moving, goes to the requested position, and starts oscillating there. For instance, if I choose "sine," it follows the signal and oscillates around it. The PWM values are still at zero. I'm attaching a few pictures and the currently modified code snippet.
    Please somebody help me.

    Code:
    "
    void SetOutputsMotor1()
    {
    if((Feedback1 > InputClipMax1) && (PWMrev1 != 0))
    {
    PWMout1 = PWMrev1;
    OutputPort &= ~(1 << ENApin1); // Unset Motor1 In 1
    OutputPort |= 1 << ENBpin1; // Set Motor1 In 2
    analogWrite(PWMpin1, PWMrev1);
    }
    else if((Feedback1 < InputClipMin1) && (PWMrev1 != 0))
    {
    PWMout1 = PWMrev1;
    OutputPort |= 1 << ENApin1; // Set Motor1 In 1
    OutputPort &= ~(1 << ENBpin1); // Unset Motor1 In 2
    analogWrite(PWMpin1, PWMrev1);
    }
    else if((Target1 > (Feedback1 + DeadZone1)) || (Target1 < (Feedback1 - DeadZone1)))
    {
    if (PWMout1 >= 0)
    {
    // Drive Motor Forward
    PWMout1 += PWMoffset1;
    if(PWMout1 > (PWMmax1 + LiftFactor1)){PWMout1 = PWMmax1 + LiftFactor1;}
    OutputPort |= 1 << ENApin1; // Set Motor1 In 1
    OutputPort &= ~(1 << ENBpin1); // Unset Motor1 In 2
    }
    else
    {
    // Drive Motor Backwards
    PWMout1 = abs(PWMout1);
    PWMout1 += PWMoffset1;
    if(PWMout1 > PWMmax1){PWMout1 = PWMmax1;}
    OutputPort &= ~(1 << ENApin1); // Unset Motor1 In 1
    OutputPort |= 1 << ENBpin1; // Set Motor1 In 2
    }
    analogWrite(PWMpin1, PWMout1);
    }
    else
    {
    // Brake Motor
    OutputPort |= (1 << ENApin1) | (1 << ENBpin1);
    MyPWMWrite(PWMpin1, 0);
    }
    PORTD = OutputPort;
    }"

    1.jpg 2.jpg 3.jpg 4.jpg
  2. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,929
    Location:
    London
    Balance:
    11,802Coins
    Ratings:
    +471 / 9 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    can you increase the deadzone ?

    perhaps you need a stop routine till the potentiometer is out of range
  3. Laszlo Horvath

    Laszlo Horvath New Member

    Joined:
    Dec 30, 2023
    Messages:
    5
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Deadzone in 20, but if i change it, nothings happen.
  4. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,929
    Location:
    London
    Balance:
    11,802Coins
    Ratings:
    +471 / 9 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    are the pneumatic valves solenoids ?

    they will not work with PID

    they are either on or off ?
  5. Laszlo Horvath

    Laszlo Horvath New Member

    Joined:
    Dec 30, 2023
    Messages:
    5
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    No. These are adjustable Electrical Proportional Valve R414002005 .
  6. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,929
    Location:
    London
    Balance:
    11,802Coins
    Ratings:
    +471 / 9 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    can the internal valves move quick enough ?

    increase the P number - see what happens
  7. Laszlo Horvath

    Laszlo Horvath New Member

    Joined:
    Dec 30, 2023
    Messages:
    5
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Actually, changing any of the values doesn't seem to have much effect. If kp=1 and kd is around 60, the amplitude of the oscillation decreases, sometimes stopping for 1-2 seconds, but in return, it doesn't move smoothly, rather erratically. I believe the significant difference between the two systems, and consequently in the program, is that while with the motor, you need to stop it, with pneumatics, you should maintain uniform pressure when in position to prevent the platform from moving due to its weight. So, there are two possibilities for the error: either it overshoots and repeatedly corrects itself, or it stops in position, shutting off the valve, or it adjusts to an improper pressure, causing the weight to shift. However, for consistency, I would lean towards the former.
  8. Laszlo Horvath

    Laszlo Horvath New Member

    Joined:
    Dec 30, 2023
    Messages:
    5
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    It was workable with these parts, just I dont't know how.