-
Notifications
You must be signed in to change notification settings - Fork 749
Switch naming is inconsistent #580
Comments
Our switch footprints currently put manufacturer info last. See Button_Switch_SMD.pretty. Moving it would change the convention settled on in KiCad/kicad-footprints#218. Again, I'd rather not rename more things than absolutely necessary, and our current DIP switch naming seems okay overall. EDIT: We should probably have at least one more option for the NO/NC field to cover pushbutton switches that toggle between open and closed on each press. Something like Toggle or Latching. |
@poeschlr @jkriege2 @evanshultz Any more thoughts on this? While this isn't a major problem, I would like to improve our switch naming and filtering by 5.0 if there's time. To clarify: "I don't think there's time" is also a perfectly acceptable answer. 🙂 |
Then "I don't think there's time".
Are switches commonly multi-sourced? If so, then putting the vendor after switch type is OK with me. If switches are generally sole-sourced, then I think it should come first. Since switches are so diverse, I'm not strongly leaning one way or the other. On the Package* libraries, though, we put the vendor first. Always, AFAIK. Is there a reason to make this consistent? Buttons that only operate when depressed are |
Regarding the no time argument: |
@poeschlr Taking that into consideration, I'll take up the torch on this discussion again.
I don't really have a strong opinion on where manufacturer info should go in footprint names either, really. Putting it at the start would just mean we need a leading As I understand it, |
NO and NC do not necessarily mean momentary. there can also be switches that "keep" their state but still have NO and NC types. (Think about a emergency stop switch. It has a default state open or closed, pressing the button keeps it in the other state until some user action.) |
|
Okay, so we need another field for Momentary or Latch. I suggest putting it immediately before NO/NC. A switch with one NO and one NC contact could just be called e.g. Yes, two separate switch symbols in the same unit is |
Only if the symbols are different, I suppose. Latching coils only apply to relays so it probably doesn't affect switches like shown above. Momentary will use a different symbol and I commonly see https://upload.wikimedia.org/wikipedia/commons/thumb/5/5b/Push-to-make_switch_electronic_symbol.svg/500px-Push-to-make_switch_electronic_symbol.svg.png. I think we should be explicit. I would want to know what switch configuration was present and I don't think having one of each cancels them out somehow. Thanks for clarifying. I get it now. One question: because this nomenclature could be used elsewhere, is there a better name? |
You're right, |
We can think about a scheme that is used for new contributions. But existing symbols and footprints should not be changed in a manner that would break existing projects that use them. (Otherwise we are unable to supply users with bugfix updates of the library.) |
Edit: Disclaimer: The naming convention should be followed by all new additions. Yes it is still kind of experimental and can evolve but we will never discover how to properly do it if we do not field test it. I highly doubt we will ever find a system that will encompass everything i would go with the latest porbosal we had and codify that for now. Use that for new contributions and add further things to it if we see the need. The hope would be that by v6 there is a good naming convention that can then be used for all switch and button contributions. The fact that we are hung up on such details already shows that the standard for the lib is already quite high. My summary (with a bit of decision making added such that we can get this finalized) Fixed fields SW_[type]_[poles]P[throws]Tx[quantity]-[MP/SH]_[NO/NC]_[Latching/Toggle]_[control]_[light]_[options]_[Split] I would keep split (=multi unit) explicit. This way we can offer symbols for the same part in both multi and single unit style (We do not paint us into a corner if we have this as an explicit option) I would also explicitly mark it as the last suffix to ensure correct ordering if there is a single and multi unit option of the same part. MP/SH is to mark symbols (and footprints) that include mounting or shield pins. type field (symbol) footprint:
It might be an option to have fewer options for the type field for symbols vs footprints and map different types to the same symbol. Toggle: The same action changes the switch between its states footprints SW_[type]_[poles]P[throws]Tx[quantity]-[MP/SH]_[NO/NC]_[Latching/Toggle]_[control]_[light]_[options]_[Horizontal/Vertical]_[man]_[mpn] The footprint side would use this naming convention as a prefix. After that would be the footprint specification. (so man+mpn for manufactuer specific footprints, size definition, and pitch for generic footprints) This is done such that we can use simple footprint filters. We might also want to add a specifier for horizontal vs vertical. The alternative would be the use of atomic parts (specialized symbol and footprint for every manufacturer specific part) |
- Fixed fab outline - Corrected courtyard - Fixed placement of fields - Added 3d model - Filename as per new switch naming convention see KiCad/kicad-symbols#580
Is this ready to be documented in the KLC? Should I move the latest relevant information to the corresponding repo (https://github.com/KiCad/kicad-website/issues)? Thanks |
There is already an issue on the website repo. I simply decided to point to this topic from there as i do not feel that it is a good idea to duplicate information in multiple issues. |
Regarding What would you guys think about enforcing S for single, D for Dual and using numbers for anything above 2? In my opinion, that's what seems to be the "norm" mostly everywhere. I would be happy if we enforce the use of numbers too, I mainly want a unified convention since it makes it easier to search footprints. Thanks! |
I agree that words should not be used "above" dual. It gets too messy and looks ugly. My gut likes all numbers because then searches are a bit easier to me (thinking like a regular expression). However, DigiKey (https://www.digikey.com/products/en/switches/toggle-switches/201), Mouser (https://www.mouser.com/Electromechanical/Switches/_/N-5g2h/), and Farnell (https://www.newark.com/c/switches-relays/switches) all classify switch poles and throws just as you said so I support that. Great suggestion! |
I personally prefer to use |
I think that may be a good compromise. I will use this approach on related open pull requests unless someone disagrees. Please let me know. Thanks! |
After approximately a week, I'll assume that there is no disagreement so I'll start using this approach. The number of poles and throws must be specified using a number even for 1 and 2 which are commonly or traditionally specified as single ( Thanks! |
Sorry for the long silence. I must agree that i prefer numbers at least on the footprint side. This makes writing the rule a lot easier. The idea is that we then have generic symbols that already have the correct footprint filters such that users do not really need to search for the footprints. (cvpcb should already point to the correct selection.) |
No problem. I have just checked and yes, keywords work fine when searching for symbols, so it's probably a matter of simply adding keywords to existing generic symbols as well as footprint filters. I'll try to have a look. |
Background
The naming of our standard switch symbols is presently quite inconsistent. Below are some examples:
The suffix
x??
has two different meanings:SW_DIP_x02
: two SPST switches in a single unitSW_DPST_x2
: a single DPST switch split across two unitsSPST
is sometimes implicit, sometimes not:SW_SPST
: number of poles and throws explicitly listedSW_Push
: number of poles and throws is implicitFormat for listing number of poles and throws is inconsistent:
SW_DPST
: double pole, single throw switchSW_Push_Dual
: double pole, single throw pushbutton switchSW_Rotary12
: single pole, 12 throw rotary switchSW_Rotary3x4
: 3 pole, 4 throw rotary switchNaming of normally closed switches is inconsistent and unclear:
SW_Reed_Opener
SW_Push_Open
Reconciling these inconsistencies would make the library easier for users to search, and could make smarter footprint filtering possible if the footprints are renamed accordingly. This is related to KiCad/kicad-footprints#144.
Proposal
My proposal for a consistent naming convention for standard switches is as follows:
Fixed fields
Mandatory fields
Optional fields
SW_[type]_[poles]P[throws]Tx[quantity]_[NO/NC]_[control]_[light]_[options]
This would directly translate into footprint filters, as footprints could be named the same way with manufacturer name and part number as additional suffixes.
Effects
This proposal would reconcile all the inconsistencies above:
SW_DIP_x02
SW_DIP_1P1Tx02
SW_DPST_x2
SW_2P1T_Split
SW_SPST
SW_1P1T
SW_Push
SW_Push_1P1T_NO
SW_DPST
SW_2P1T
SW_Push_Dual
SW_Push_2P1T_NO
SW_Rotary12
SW_Rotary_1P12T
SW_Rotary3x4
SW_Rotary_3P4T
SW_Reed_Opener
SW_Reed_1P1T_NC
SW_Push_Open
SW_Push_1P1T_NC
Limitations
This only covers standard mPnT switches. Manufacturer-specific switch symbols and coded switches are not considered by this proposal.
This could be perceived as overly verbose, requiring DIP switches to be explicitly labeled as 1P1T, and Push and Reed switches to be explicitly labeled as NO or NC. I think the benefits in clarity, both to users and footprint filters, outweigh this drawback.
This would require renaming most of our switch symbols and footprints. This could prove difficult given the looming 5.0 freeze. The symbol changes could be done relatively quickly (as we don't have a ton of switch symbols), but the footprint changes would be more involved. None of the DIP switch footprints would need to be renamed, as they already match this proposal. I estimate a full day's worth of work to do the renaming, plus the time required to review the changes. I of course volunteer to do the renaming, as I'm the jerk who came up with this idea in the first place.
The text was updated successfully, but these errors were encountered: