PCB Footprint Text

Hi,

I have a PCB design on which I hid all the footprint references (made invisible) before realising the render pane could just hide the layer (doh). I am not 100% the reference text’s will be perfectly in place, perhaps there could be a mix-up when loading the smd machine.

As it happens I don’t want a silkscreen so this isn’t an issue, however the PCBA company I’m using needs the references for assembly. What is the best way to go about it?

PS) if I need to make the invisible text visible is that possible?

Cheers, Andrew

In the render tap there is an option to show hidden text.

Yes, it is possible.
How many footprints in the board?

A few:
-check the hidden text box (render tab)
-select the reference text, right click edit
-chekc visible
One footprint at a time.

A lot:
-Edit the .kicad_pcb file with a text editor
-Search for lines containing “fp_text reference”
-Delete the “hide” word at the end of the line

1 Like

I’m using a nightly and making them invisible doesn’t affect the fab layer. I just tested it. If you used library parts you might be OK. Otherwise the file is a text file so you can use a script or text editor to fix it up quicker than by clicking on every component.

If you made some components and didn’t add a fab layer you might have to go back and fix them up.

In the official lib: The reference on the fab layer is not the true reference. It is a copy. (It is also not affected by the reference visibility selected in the render tab.)

Hi guys,

Thanks for the quick answers.

So to confirm in 4.0.7 there are no references in the fab layer. This is the same if I click “Plot Footprint References”.

As I’ve made the text invisible I can use the force invisible option to plot them onto the silkscreen. My issue with this is:

a) I don’t want to give them silk layers in case they print it (they are Chinese so… :wink: )
b) maybe I moved some references before and they are slightly confusing, especially given components are very close together (silkscreen is impossible, the main reason for discarding it).

Oddly he hasn’t had a problem before which would have been in 4.0.6, so perhaps then it was printing them to the fab layer even though I’d made them invisible (which I had, plus he didn’t have silkscreen layers then either)?

Ultimately what I want is to automatically plot references smack bang in the middle of every component onto the fab layer. At least I think the fab layer the best one to allow them to do the PCBA?

Regards,

A

Sounds like what I’m after and what I had in 4.0.6. Is this borked in 4.0.7?

Hi All,

Just tested and on the fab layer “Plot Footprint Values” works but the “Plot Footprint References” does not (4.0.7).

I like the idea that they are a copy and not based on the silkscreen reference texts which I may have moved. It explains how he had them last time when I didn’t give him the silk layers. Downgrade to 4.0.6?

Best, Andrew

Well, plot the Gerber for silkscreen but change its name before sending the file to the fab, so they don’t take it as a silkscreen layer.

Something we do: plot a pdf with the outline of every footprint and its reference in the middle of the footprint (or near where it is not possible).

If you need to do a global edit of Reference texts (layer, position etc) that is relatively easy with a script. For texts other than Reference or Value, I’m not sure how to do that with a script.

I had a look at the text and here’s an example

    (fp_text reference R21 (at 0 -1.65) (layer F.SilkS)
  (effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value "0.1 [1%]" (at 0 1.75) (layer F.Fab)
  (effects (font (size 1 1) (thickness 0.15)))
)
(fp_text user %R (at 0 -1.65) (layer F.Fab) hide
  (effects (font (size 1 1) (thickness 0.15)))
)

So unless I’m mistaken it’s hidden the reference on the fab and not the silk, although it disappears from both until forced to show on plot.

Trying to figure this out, I’m sure it’s the F-fab text’s that I want. They are the correct size for the footprints. The thing is, many are missing!

(I’ve removed all ‘hide’ text from the file manually).

If you made the footprints you can edit it and add the fab layer. Well, even if you didn’t make it that would work. I think the FAB layer is part of the current specification for new compontents but I don’t know because my own symbols are pretty crude so I don’t upload them.

Here is a script which moves all refs to Fab layer and set their position to module center

from pcbnew import *

"""
To run from KiCad script console in pcbnew:

1. Open the console with Tools->Scripting Console
2. Save open files before running script!
3. type the following command in the console window:

execfile ("c:/python_progs/test_pcb/set_text.py")

change "c:/python_progs/test_pcb/" to where you stored "set_text.py".

"""

def SetText(Filename = None):
    if Filename: 
        my_board = pcbnew.LoadBoard (Filename)
    else:
        my_board = pcbnew.GetBoard()

    for module in my_board.GetModules():
        print ("module ref %s %s" % ( module.GetReference(), my_board.GetLayerName(module.Reference().GetLayer())))

        # set size in mm
        #module.Reference().SetSize (wxSize (FromMM(2),FromMM(2)))
        
        # set thickness in mm
        #module.Reference().SetThickness (FromMM(0.3))

        # set visibility
        module.Reference().SetVisible (True)

        # set ref text position to module pos
        mpos = module.GetPosition()
        module.Reference().SetTextPosition(mpos)

        # set layer to Fab
        module.Reference().SetLayer (pcbnew.F_Fab)


# SetText("C:\\git_bobc\\bobc_hardware_live\\Smart_RGB_LED_AT85\\rgb_led.kicad_pcb")
SetText()
1 Like

Thanks Bob, but what about the components without a reference?

For example some of the most common ones (I’ve just been finding this out) like SOIC-8-N, SOT-23 do not have the %R text field.

All components have the Reference field, but not all have the %R field. So you can either just use the Reference field if you don’t need it on the silkscreen, or use the %R field, but you would need to add it where missing. That could be done in the script as well.

I’m adding the %R field, it’s missing from SOIC-8-N, SOT-23, MSOP-8_3x3mm_Pitch0.65mm so far. Perhaps the library maintainers could write a script to add it to any footprints missing the field?

Sure, I could do that. Generally symbols get updated to latest KLC when someone happens to update them, but there are many symbols that need updating to even a basic level of KLC compliance.

I am working my way through several libs, but it’s a very time consuming task.

1 Like

I have a better idea of what’s going on now. I can see that when the components were added the footprint is cached in some fashion. It’s using old footprints without the reference fields. I update the footprint and select to change all and there is the text!