Menu

Simulating a solenoid pneumatic valve as inductor or relay?

2019-02-12
2019-02-14
  • Foad S. Farimani

    Hi guys,

    Thanks for developing this great software. It is truly amazing that FOSS comminity can achive so much.
    I'm very novice to the electronics and am trying to simulate this tutorial, controlling a pneumatic valve. You may find What I have done so far in the attachment:

    simulation

    However I'm not sure what component should I use to represent the valve. Should be an inductor or a relay? and if either what should be the properties be to represent the power (W) and Voltage?

    Thanks for help in advance.

    Best,
    Foad

     

    Last edit: Foad S. Farimani 2019-02-12
  • Santiago

    Santiago - 2019-02-12

    I think the best representation for the valve is a relay.
    You can use a led to show when the valve is on/off.

    Values for the relay:
    Coil Resistance::
    12/0,056 = 214.28 rounded to 210
    Rcoil = 210

    Trigger current:
    Must be < 0,056
    Itrig = 0,05

    Also set "NoLinAcc" to 6 in Circuit properties.

     
    👍
    1
    • Foad S. Farimani

      I also implemented the relay version as you sugested. But maybe you can help me know what is the diffrence between this and the ESR one?

      a couple of poinst:
      1. the LED direction is not visible when off
      2. For BJts the selection between PNP and NPN is not obvoius. in the properties it says PNP off or on. It would better if it was type: NPN or PNP
      3. It would be great if there was an option to export graphs as CSV
      4. The Arduino board is apparantly working without a power :)
      5. It would be great if the Arduino could load the Arduino C/C++ code drictly instead of .hex file. KTechLab has something like this.

       

      Last edit: Foad S. Farimani 2019-02-13
      • Santiago

        Santiago - 2019-02-13

        Relay in simulide is actually an ESR, you can set resistance value, in adition you can set the trigger current.
        The valve you are simulating must have a minimum current value to trigger, there is no mention about this in that video tutorial.
        An electro-valve is very similar to a relay.

        1. Yes, it is barely visible, i want to address this somehow.
        2. You are right, it's not so ovbious, but using true/false values has some advantages.
        3. I think you mean plotters graphs: yes, this is in the TODO list.
        4. Yes, this is for simplicity, do you see some advantage having to add a power suply?
        5. You can load Arduino code from the Editor/Debugger.

        Thanks for your suggestions.

         
        👍
        1
        • Foad S. Farimani

          Thanks a lot.
          4. I think the more realistic the better.
          5. I mean when you right click on the MCU or board there is an option to load firmware and then select .hex and .elf files. it would be great if we could select the source codes of some higher level languages like Arduino or C... and then it compiles into the same folder the first time we ran the simulation.

           
          • Santiago

            Santiago - 2019-02-13

            There are many features that make an easier user experience, but in most cases these features add a lot of complexity to the code but little real advantages.
            Sometimes too much complexity makes a project fall by it's own weight.

            As you mention Ktechlab... i did a fork of Ktechlab 10 years ago (ktechlab-gcb).
            Soon i realized that it was really dificult to work in that code.. it was too big and too complex.

            That was the reason i started to develop simulide. And the first goal was: "As simple and small as possible", and i try to keep it that way: ( ktechlab ~200K lines of code / simulide ~20K lines of code).

             
            👍
            1
            • Foad S. Farimani

              Exactly: do one thing and do it good. I also started with KTechLab. The guy behind the project is awsome. but it is still not a viable option. Not all of th epoints I have mentione are equally important. I just shared some of the ideas I had.

              On a side note, I also created this ticket to add SimulIDe to Chocolatey. It would be great if you could do this. Then everytime you realise a new version users can update automatically.

               

              Last edit: Foad S. Farimani 2019-02-13
              • Foad S. Farimani

                something else I wanted to add about point 5, finding the hex file is anot that intutive with Arduino IDE. It took me a good 5 min or so to figure it out. For students who don't know how to use find on terminal it should take much longer :)

                 
                • Santiago

                  Santiago - 2019-02-13

                  It's always good to know about any idea, most of them are very good and easy to implement, some ohters maybe are not worth the added complexity, at least by now.
                  I just want to explain why i'm so obsessed with simplicity.

                  I'm thinking about automatic updates, let me have a look.

                  Yes hex file in Arduino build is an issue. i will address it, maybe just copy hex file to circuit folder and keep it there.

                   
                  👍
                  1
                  • Foad S. Farimani

                    One small issue, when connections/wires cross eachother it seems like a junction:

                     
  • Foad S. Farimani

    From here I ended up simulating it as a equivalent series resistance (ESR):

     

    Last edit: Foad S. Farimani 2019-02-13
    • Foad S. Farimani

      I also wrote about my experince here on this reddit post. You are awsome :)