Manual annotation causes Netlist to miss connections on schematic

Bug #1677282 reported by David Pearce
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
High
Wayne Stambaugh

Bug Description

Seen on Ubuntu and Windows Nightlies

I have created a simple three level hierarchical schematic.
All four parts are in block2a

F1 was a polarised fuse.
I annotated, ran netlist, opened in pcb new and saw all parts and nets as expected.
Then I deleted F1 and replaced it with a new F1, different symbol but same footprint.

Pcbnew now shows the F1 pads as unconnected and I see that the nets are not connected to F1, although the schematic does connect.

Application: kicad
Version: no-vcs-found-8f3423b~58~ubuntu16.04.1, release build
Libraries: wxWidgets 3.0.2
           libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.4.0-70-generic x86_64, 64 bit, Little endian, wxGTK
- Build Info -
wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.58.0
Curl: 7.47.0
KiCad - Compiler: GCC 5.4.0 with C++ ABI 1009
        Settings: USE_WX_GRAPHICS_CONTEXT=OFF
                  USE_WX_OVERLAY=OFF
                  KICAD_SCRIPTING=ON
                  KICAD_SCRIPTING_MODULES=ON
                  KICAD_SCRIPTING_WXPYTHON=ON
                  KICAD_SCRIPTING_ACTION_MENU=ON
                  BUILD_GITHUB_PLUGIN=ON
                  KICAD_USE_OCE=ON

Revision history for this message
David Pearce (halzia) wrote :
Revision history for this message
Jakob Möderl (jmoederl-deactivatedaccount) wrote :

seems to work in my version.

when i opened the project the connection was missing (the connection is missing in the netlist) but when i changed the symbol back again to a polarized fuse (same value and footprint) and update the PCB the connection reapears.

Application: kicad
Version: (2017-03-05 revision 541b91fd1)-master, release build
Libraries: wxWidgets 3.0.2
           libcurl/7.53.1 OpenSSL/1.0.2k zlib/1.2.11 libpsl/0.17.0 (+libicu/58.2) libssh2/1.8.0
Platform: Linux 4.10.6-1-ARCH x86_64, 64 bit, Little endian, wxGTK
- Build Info -
wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.63.0
Curl: 7.53.1
KiCad - Compiler: GCC 6.3.1 with C++ ABI 1010
        Settings: USE_WX_GRAPHICS_CONTEXT=OFF
                  USE_WX_OVERLAY=OFF
                  KICAD_SCRIPTING=ON
                  KICAD_SCRIPTING_MODULES=ON
                  KICAD_SCRIPTING_WXPYTHON=ON
                  KICAD_SCRIPTING_ACTION_MENU=OFF
                  BUILD_GITHUB_PLUGIN=ON
                  KICAD_USE_OCE=OFF

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1677282] [NEW] Netlist misses connections to a substituted part

@David, what grid spacing are you using? The components and wires do
not appear to be on a 50mil grid which can cause connection issues if
you are not careful. You should always use 50mil grid spacing when
placing components, wires, and labels to avoid connection issues.

On 3/29/2017 11:19 AM, David Pearce wrote:
> Public bug reported:
>
> Seen on Ubuntu and Windows Nightlies
>
> I have created a simple three level hierarchical schematic.
> All four parts are in block2a
>
> F1 was a polarised fuse.
> I annotated, ran netlist, opened in pcb new and saw all parts and nets as expected.
> Then I deleted F1 and replaced it with a new F1, different symbol but same footprint.
>
> Pcbnew now shows the F1 pads as unconnected and I see that the nets are
> not connected to F1, although the schematic does connect.
>
> Application: kicad
> Version: no-vcs-found-8f3423b~58~ubuntu16.04.1, release build
> Libraries: wxWidgets 3.0.2
> libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
> Platform: Linux 4.4.0-70-generic x86_64, 64 bit, Little endian, wxGTK
> - Build Info -
> wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8)
> Boost: 1.58.0
> Curl: 7.47.0
> KiCad - Compiler: GCC 5.4.0 with C++ ABI 1009
> Settings: USE_WX_GRAPHICS_CONTEXT=OFF
> USE_WX_OVERLAY=OFF
> KICAD_SCRIPTING=ON
> KICAD_SCRIPTING_MODULES=ON
> KICAD_SCRIPTING_WXPYTHON=ON
> KICAD_SCRIPTING_ACTION_MENU=ON
> BUILD_GITHUB_PLUGIN=ON
> KICAD_USE_OCE=ON
>
> ** Affects: kicad
> Importance: Undecided
> Status: New
>
> ** Attachment added: "zip file of simple example project"
> https://bugs.launchpad.net/bugs/1677282/+attachment/4849811/+files/recoverybug.zip
>

Revision history for this message
David Pearce (halzia) wrote : Re: Netlist misses connections to a substituted part

Good point about the grid, but I have been carefully looking for the boxes on wire ends and dragging to check connection.
Anyway I have re-gridded from 10 to 50 mil and ERC finds an unconnected pin on J1 pin 2, although I cannot see why.
I think this is the root cause.
Updated project attached

Revision history for this message
David Pearce (halzia) wrote :

I can reproduce the error on a single sheet schematic.
Examining the schematic file does not show anything off grid

Steps
Create simple circuit
Run ERC - All OK
Substitute part by:
 Add new component
 Delete old component
 Connect new component in place of old component
 Manually edit Ref to previous reference
Run ERC - Not connected
Run Netlist - no warnings but result is wrong
Run Annotate (No obvious effect)
Run ERC - Now everything is connected
Run Netlist - Now correct

Revision history for this message
David Pearce (halzia) wrote :

Looking at the schematic file I see that Annotate silently changes a "0" to a "1" on two lines
$Comp
L C C1 (Component is a "C", reference "C1")
U 0 1 58DC707A ---> U 1 1 58DC707A
P 6600 3700
F 0 "C1" H 6715 3746 50 0000 L CNN
F 1 "100n" H 6715 3655 50 0000 L CNN
F 2 "" H 6638 3550 50 0001 C CNN
F 3 "" H 6600 3700 50 0001 C CNN
0 6600 3700 ----> 1 6600 3700 (the coordinate of the centre of the substituted part)
1 0 0 -1

David Pearce (halzia)
summary: - Netlist misses connections to a substituted part
+ Manual annotation causes Netlist to miss connections on schematic
Revision history for this message
David Pearce (halzia) wrote :

I changed the bug title to be more accurate.
My finding is that adding a component symbol and setting the reference manually using "U" or simply editing the reference on screen, causes the schematic file to have set N in the line:

U N mm timestamp to "0", where N is the unit number.

This causes the Netlist generator and ERC to ignore the part and not connect it
Running automatic annotation then sets the unit number to a "1" and the Netlist can be generated correctly.
I have tested 4.0.6 and the "U" command behaves as expected, generating a "1" (or higher for multi-units) immediately, resulting in a correct netlist.

Changed in kicad:
status: New → Confirmed
assignee: nobody → Wayne Stambaugh (stambaughw)
Changed in kicad:
importance: Undecided → High
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 40f60c9871949935f2b4f2f856b04234b2ae3440
https://git.launchpad.net/kicad/patch/?id=40f60c9871949935f2b4f2f856b04234b2ae3440

Changed in kicad:
status: Confirmed → Fix Committed
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@David, thank you for the help in finding this bug. It should be fixed in commit 40f60c987. You will get a warning dialog when unit specifier in the loaded schematic file is 0 and fixed automatically by the file parser. Please let me know if this doesn't solve your issue.

Revision history for this message
David Pearce (halzia) wrote :

Thanks, I will test it soon, I am travelling this weekend.
I looked at your patch and was concerned about blindly forcing a detected Unit N = 0 to a "1", but tested a swapping a 7400 Unit B to a 7402 Unit B and the U command does correctly write a "2".
This means the manual annotation bug seems to only affect single unit parts, all the basic R and C etc

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1677282] Re: Manual annotation causes Netlist to miss connections on schematic

It was not the manual annotation that caused the issue. It's actually
the placement of the component from the new component chooser dialog
that was incorrectly setting the unit to 0 on components without
multiple units. Apparently the automatic annotation was fixing this by
setting the unit to 1.

On 3/30/2017 7:48 PM, David Pearce wrote:
> Thanks, I will test it soon, I am travelling this weekend.
> I looked at your patch and was concerned about blindly forcing a detected Unit N = 0 to a "1", but tested a swapping a 7400 Unit B to a 7402 Unit B and the U command does correctly write a "2".
> This means the manual annotation bug seems to only affect single unit parts, all the basic R and C etc
>

Revision history for this message
David Pearce (halzia) wrote :

Ok, tested working correctly now.
Is the root cause chooser unit error also being fixed?

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

Yes, the component chooser was fixed.

On 4/2/2017 9:25 PM, David Pearce wrote:
> Ok, tested working correctly now.
> Is the root cause chooser unit error also being fixed?
>

Revision history for this message
David Pearce (halzia) wrote :

Thanks.
Also, I find the warning about the schematic file being corrected to prevent compatibility problems perfectly clear

Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.