KiCad V7 creepage and HV clearance

Hi All,

Can some1 indicate a tutorial on how to create HV clearance between different subnet classes?
I’m talking about logical flow (how to):

  1. easy select in schematics the HV nets (if the schematic is nicely drawn you can select a part of it and eventually create a list of nets from that selection?)
  2. create the rule for those nets that will apply on PCB.
  3. best practice - if exists.

there is creepage support in V7?

Looking forward for your feedback,
Best Regards,
Andrei

No, that’s still on the wishlist…

@AB007 you may have a look at
Trace Clearance Generator to generate a copper pour keepout for a selected trace, as in High Voltage user case.
It is a plugin included inb RF-tools kicad plugins.

I know that KiCad support now scripting base classes insulation (since V6) through custom rules as presented below:

Now, my question is: it is possible to do Netclass Assignments through schematic selection (eg. all tracks selected to be assigned to the same net class)?

Thanks,
Best Regards,
Andrei

PS: the indicated plugins support custom clearance but it is necessary to apply rules between various net classes.

eg. all tracks selected to be assigned to the same net class?

No, not graphically on the schematic side.

all current options to assign a netclass:

  1. select one net -->RMB-click → context-menu–>assign netclass.
    net needs a label for that.
    needs to be done for all nets.
    net is added to the netclass-list in the schematic-setup–>project->netclasses table (as well as to the board-setup–>project->netclasses table) with the exact netlabel-name-pattern
    disadvantage: later label-renaming leaves a false entry in the netclasses table
  2. place a netclass-directive label an one net.
    needs to be done for all nets. (use copy/paste)
    advantage:
    nets don’t need a label-name (but the netclass directive). So independent if a label-name changes
    disadvantage:
    clutters schematic
    is not listed in the netclass table, so no overview about used and assigned nets
  3. place the netclass-assignment directly into a field of a netlabel.
    needs to be done for all nets (netlabels) one after another
    advantage: automatically updates with netlabel changes.
    disadvantage:
    is not listed in the netclass table, so no overview about used and assigned nets
  4. use the old style netclass table and assign the netclasses manually with the pattern-matching
    for this all nets need a label
    but if you name the nets carefully you could probably assign netclasses with 1 pattern (using the schematic-subsheet-name or a marking string “HV” as part of the pattern

@mf_ibfeew and @qu1ck

As the new version of KiCAD support colored track I’m wondering if it’s possible to create a plugin to manage the rules between net classes in an easier way:

  1. the plugin shall display the net classes and eventually create or delete a netclass. When deleting a netclass al included nets can be assigned to default.
  2. the plugin shall manage included nets (remove or add an net inside a class - you can have 2 lists: on the left all nets within a net class and on the right the rest of nets - text color will be related to netclass); the assignation can be done by adding a netclass directive (with not visible symbol) on a certain clicked net; the net click will delete the netclass directive and assign the net to default; all net line shall change the color related to net-class assignation.
  3. on the bottom will be a rule generator for clarinet insulation (and other parameters)

On KiCAD 7, with existing features it is possible to create such plugin?

Thanks again and Most Appreciated!
Best Regards,
Andrei

Looks like that is possible, but the net class to avoid schematic cluttering should have a set for not visible attribute… this is how it looks:

Do you see any interes to generate such plugins?

On KiCAD 7, with existing features it is possible to create such plugin?

As there is currently no plugin-API for the schematic editor: probably no.
But you are right - the netclass handling could be improved.

Do you see any interes to generate such plugins?

Yes, I think improvements for netclass-management are interesting. In that way it could also be tested if some workflow is useful and easy to use in real projects.

A plugin for point 3 - a “rule generator” to generate the custom rules from a simple clearance-matrix, could be done from the board side - so there is a plugin possible for v7.

I discover I think a bug…you can add 2 net classes tabel on the schematic on the same track without having the existing one deleted…

I love the idea of having a simple clearance matrix with boxes to fill… :slight_smile:

Not “natively” because schematic editor has no api. It’s possible to modify schematic files directly if one is determined to write such functionality but it would be a lot of work.

I have seen schematic where it was used. All wires going out of microcontroller had their names according to uc port names and went into a bus. Then somewhere else (at another sheet) these wires went out of bus (with the same names) and then at the same wires there were new net names (according to function) and they went into next bus going to next sheet where these wires were used using only their functionally assigned net names.

manual net assignment using net classes is fine for now. The netclass table symbol with pin length 0.01mm and not label shown is small enough to prevent schematic cluttering.

What we need is a plugins (for PCB) that generates simple clearance rules: a matrix with all net classes on x and y axes with boxes that can be filled with clearance numbers; it should be straight forward and helpful for any user that needs to implement clearance rules (between nets and between planes and nets).

And yes, for long term, a schematic that allows manipulation based on an api is nice to have too… should I supposed that is a minimal link (at least for back annotate) but not exposed for external users.

@JuliaTruchsess
what do you think as you’re asking for this feature a while ago?

Ha, I still use KiCad 5 because I prefer it, but eventually I’ll update and I’m sure the new design rules will be great for HV design :slight_smile:

That kind of thing is not supported by data model of netclasses, it only exists in custom drc rules. There is no api for that. If I’m not mistaken custom drc rules are not used for routing either so it’s of limited value anyway.

I think it would be somewhat useful to have a custom rule generator for the clearance matrix but it doesn’t have to be a plugin at all, even a web script will do. You feed it a list of netclass names, it generates a UI to put clearance values, you press generate and it spits out DRC rules text.

I discover I think a bug…you can add 2 net classes tabel on the schematic on the same track without having the existing one deleted…

This was already discussed on gitlab. There are more chances to create ambiguity netclass-assignments. All assignment-options (see my 1…4 options above) can be assigned to the same net - all with different netclasses.
These situations are handled by the ERC - different netclasses on the same net can be detected as error.

I think it would be somewhat useful to have a custom rule generator for the clearance matrix but it doesn’t have to be a plugin at all, even a web script will do. You feed it a list of netclass names, it generates a UI to put clearance values, you press generate and it spits out DRC rules text.

+1 for a real plugin. direct acces from the board-editor, could directly read all available netclasses from the board.
Maybe even read existing custom rules back (bonus) to prefill the clearance-matrix with existing values.
for the UI: The clearance matrix in eagle worked very well. If wanted I can add a picture.

Why only net classes?
I was using for years Protel 3 (from 1997). There, at Clearance tab when I wanted to add rule (except default one I could add many of them) I had to select ‘From’ and ‘To’ and clearance value itself. For both 'From and ‘To’ I could (if remember well) select one of:

  • device pad,
  • device,
  • device class,
  • net,
  • net class,
  • board (to specify clearance of something to everything else)

And depending on that selection the selection boxes were showed to chose from.

I was using only net classes to specify clearance, and device classes to specify thermal connection width, but I think that when thinking of adding new tools you should not limit them to only one idea you imagine how it will be used.

Why do you think that?