Non-traditional use of KiCad for water treatment system design and simulation

I’ve seen KiCad being (ab)used for things like electrical cabinet layout to hydraulic and pneumatic circuits.

This seems like normal schematic capture to me.

Good catch. The “In” pin was 10mils off. The end of the wire intended for the “Out” pin was too long. And, I hadn’t marked the “Ctl” pins a N/C yet.

One of the many things I’ve found out the hard way is how cumbersome it is to draw a symbol. I find myself turning off snap-to-grid to get graphics to look like I want, and then forget to turn it back on when placing pins. Also, the symbols themselves do seem pretty fat compared to the wires, as you pointed out. As I proceed I’m sure I’ll have more of the best practices paged-in from the KiCad Library Convention document, and probably end up redoing the entire library at some point to make it “right”.

Of course, I spell pride with a “?” so if someone more versed in this also wants to dive in then the water’s fine. That would include creating a netlister, suggestions on how the kinds of parameters needed to make the simulation happy/accurate, etc. It was a bit of an eye opener for me, as an EE, to see just how complicated the model parameters for “simple” things like pipes and valves become when you want to get accurate enough. If I were an ME instead then I probably wouldn’t have been so surprised.

True enough. The beauty of it is that so much can get done on simple home-scale projects with a tool that’s definitely not designed for hydraulic engineering. The libraries and simulation models are clearly different. Other differences are related to the design flow and the kinds of polymorphisms that hydraulics guys take for granted as table stakes when creating/evaluating designs. The $$$$ built for purpose tools treat PFDs, PI&D, PLD programming, cable harness wiring and test, enclosure design and placement, and control system engineering as integrated facets of the effort, much like KiCad tries to integrate schematic capture and PCB layout. For the basic things I want in a home project scale, KiCad seems to get me a long way.

KiCad V8 has “Grid Overrides”, which can be used to set different grids for different items (pins, graphics, texts) You can also temporarily ignore the grid by depressing the [Ctrl] key. There are lots of little things in KiCad that can make you more productive, but it takes some time to find and learn such things.

*Edit: [Shift][Ctrl]. Duh, silly me! (Noticed it while reading jmk’s post).

Somehow I missed that gem when reading the V8 Release Notes. Thanks :grinning:

The grid is off when the Ctrl key is held down.

My work flow tends to be to keep a grid for everything, but I have a bucket load of grids to choose from in every Editor and use a Hotkey for “Edit Grids” then select the appropriate for the job.

Default line width for symbols can be changed in Preferences > Symbol Editor > Editing Options.

Duplicate, Mirror and Rotate are really useful for creating symbols.
eg. your Pressure Booster drawing. Draw one line in the circle from control to out; then Duplicate, Move, Mirror and Move again to get a symetrical line to go from Out to the top of the circle.
Very handy, also, for things like the arcs on your pressure tank (get one right and Duplicate then Mirror) and the arrows on your gauges (draw half the arrow then Duplicate, Mirror and Rotate for the other half).

That is the only reason I went to the trouble of drawing the “map of the plumbing”. It only took me 15 years to get around to this creation. :rofl:

I’ve seen KiCad being (ab)used for things like electrical cabinet layout

About this. We have been ‘abusing’ Eagle CAD for this. So logically I made a small demo with a PLC and 3 IO blocks in KiCad.

As is now, It is extremely rudimentary. I would need to make good footprint and good symbol libraries along with style sheets.

afbeelding

I think that Kicad could actually be a viable replacement.We are ofcourse going over to Eplan which is for this task by far superior in every way (with user friendlyness as exception).

I like the hiearchy in the schematic editor. In Eagle we don’t have a nice route sheet. The hierarchy helps with navigating in the schematic.

I can already imagine that you can use busses and or wires to hierarchial sheets to ‘highlight’ the power nets and such.

The board editor can be used with extra footprints for things like cable ducts, DIN rails and a physical cabinet to design the actual cabinet. There are ways to export the drill files which we would need

And 3D is just nice to have.

So despite it ain’t perfect, I do see some potential in this kind of abuse :smiley:

:tumbler_glass:

Bas

You may want to take a look at scilab. Scilab is a free near MATLAB clone. It is not as compatible with MATLAB as Octave, but it comes with something like MATLAB’s Simulink, called Xcos (I don’t know how to pronounce it). Xcos is a full-featured controls and signal-processing toolkit with a very sophisticated gui. It may be possible to use the symbols you are making with Xcos, but Xcos comes with a rich gamut of symbols already. With Xcos, you can set up your system graphically and then run analog or digital simulations using scilab’s computational prowess, much like you would do with MATLAB’s Simulink.

There is also https://openmodelica.org/

I think they also offer a decent alternative for “abusive” schematics (and “simulation”?) that can cover these non-traditional cases.

Abusing KiCad is more fun though :slight_smile:

The water where I live is insanely hard, hence the RO. Some I’ve talked to swear by drinking/cooking with RO water, but I buy the argument that it’s actually less healthy because the mineral content is too low. Hence, two instances of remix with the Town water. One instance for cooking/drinking, seasoned to taste, and one for DHW (just enough to prevent corrosion).

TBH, until I stumbled on the EPANet software I had no plans to try simulation. But, the price was right and when I saw its models worked for 1/4" pipes as well as 12’ pipes and could deal with pumps, valves, tanks, even temperature and chemical concentration gradients (think remineralization and DHW recirculation), it tickled my funny bone too much.

I love Scilab. Xcos is pretty nice as well, but since I worked for Keysight I and used our EDA products (Advanced Design System) frequently, I tended to use what I already knew. I haven’t looked, but I suspect that a lot of modeling work would be needed to get XCos models to the level of maturity of the EPANet models. Perhaps I’m mistaken and should take another look.

On the other hand, I do want to simulate the complete control loops for stuff like preheating/post-cooling water for the RO filter, remineralization system, etc. which have both hydraulic and electronic/SW components on the loop. This is just what the Xcos folks had in mind. But then I’d need to generate Xcos “netlists” as well as the hydraulic models. It’s really a question of what’s the easiest path, since I’m lazy.

What I’d like is a decent co-simulation environment. ADS can do this, but since I retired my license expired:-(

1 Like

I know there’s some DNA sharing between Xcos and Modelica. How good are their hydraulic models?

1 Like

Gee, I feel like an old fogey singing songs around a campfire to the accompaniment of a ukelele about how good the days when we used KiCad to design just PCBs were. :crazy_face:

I would have used the phrase non-mainstream. :wink:

Don’t mind me, I actually think it’s quite creative to put tools to alternate uses. :+1:

Yeah; well, it’s easier to stuff around with what you think you know rather than yet another steep learning curve. :grinning:

I have no idea.

But from what i remember from the EE related libs, i was happy with what i found and what i was allowed to do with some additional scripting.

learning E-plan comes with a full 5-day course. I wanted to learn Fritizing once, I still don’t know how to use that program.

Instead I think I should make more custom symbols for KiCad for all the manuals I am about to make :smiley: That I know how to do :smiley:

1 Like

Another hobby of mine is making Archtop Guitars and when I make Pickguard’s for other players (meaning, I don’t need to use FreeCAD for Milling G-Code) then, I use Kicad to generate the Gerber and use CopperCAM to generate the G-Code.

I looked around for ISO-1219 stuff that wasn’t behind a paywall and found what looked like a good set of example symbols at https://www.emerson.com/documents/automation/european-catalog-solenoid-valve-iso-1219-symbols-asco-en-6867428.pdf. Holy Smokes! They reminded me of the ANSI symbols for logic gates:-( No wonder they seemed exotic. It seems like ISO-1219 is focused on hydraulic/pneumatic control valves, which do have a bewildering array of options they tried to allow for in the symbols (e.g. spring return, manual override, direct acting, pilot control, 3-position multiport/multiway valves with arbitrary connectivity between ports depnding on position, …). What I would think of as a simple 2x2 crossbar switch that you might use to control forward/reverse motion of a piston turns into a monster.

Fortunately, I’m not designing a bulldozer hydraulic control system. The most complicated part I might need is a motorized temperature mixing valve (assuming I can find one at a reasonable price). So I can stick wth the “simpler” symbols and use named paramaters (some with text values) to clarify their function. Even then, it seems like I’ll need several dozen basic shapes with variations for things like manual/solenoid/pilot/motor control, built-in limit switches, position indicators, etc.

Including the complete hydraulic/electronic control loop(s) in the design and simulation has always been in the back of my mind so including the electrical control/feedback ports in the symbols seems to make sense.

That does seem to be pretty abusive (and creative):slight_smile: I’ve played around with FreeCAD as an alternative to OpenSCAD for but it just hasn’t “clicked” with me. I sense that once I get into phase lock with the “workbench” concept then all sorts of things become easy.

Perhaps you’ve seen my this (my Milling Video… and this discussion/post…. Even though I can and have used FreeCAD for milling PCB’s, I much prefer using CopperCAM for PCB’s… very easy and excellent user interface.

I run CopperCAM on my Mac using PlayOnMac (there’s a PlayOnLinux, too)