discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Modelling PC Board with NopSCADlib

LM
Leonard Martin Struttmann
Sat, Jan 28, 2023 6:48 PM

Good day! I am attempting to use NopSCADlib to model a PC board and I have
some questions.  Is it just me, or is the documentation for modeling PC
boards a bit sparse?

I spent most of yesterday examining the PC board example. It seems that you
start by building a PC board descriptor that is a list of the board
characteristics and includes a sublist of the components that you wish to
place on the board.  For example, here is the list of components from the
example LIPO_fuel_gauge board:

  • [ // components*

  •    [17, 5, 90, "jst_ph", 2, true],*
    
  •    [2.54 + 5.27,  1.5 * 2.54 + 5, 0, "-2p54joiner", 3, 1],*
    
  •    [2.54 + 5.27, -1.5 * 2.54 + 5, 0, "-2p54joiner", 3, 1],*
    
  •    [3 * 2.54 + 5.27, 5,           0, "-2p54joiner", 1, 2],*
    
  •    [6.4 + 1.5, 5, 0, "chip", 3, 2, 0.8],*
    
  •    [1.2,  2.5, 90, "smd_res", RES0603, "472"],*
    
  •    [2.4,  2.5, 90, "smd_res", RES0603, "472"],*
    
  •    [1.2, -2.5, 90, "smd_res", RES0603, "472"],*
    
  •    [2.4, -2.5, 90, "smd_res", RES0603, "472"],*
    
  •    [10.35, -4, -90, "smd_res", RES0603, "181"],*
    
  •    [10.35,  4, -90, "smd_res", RES0603, "102"],*
    
  •    [12.89, 1.5 * 2.54 + 5, 0, "smd_cap", CAP0603, 0.85],*
    
  •    [12.89,-1.5 * 2.54 + 5, 0, "smd_cap", CAP0603, 0.85],*
    
  • ],*

I have inferred from the examples that the first three values for each
component specify the X offset, the Y offset, and any rotation angle.

The fourth value is the type of component and if the first character of the
type is “-”, the part is to be placed on the bottom of the board.

The remaining values are specific to the type of component.  The difficulty
I’m having is determining the string type of the part and the remaining
parameters.  From what I can tell, this is the process for determining
those values:

  1. First, based on the component that you wish to place, search
    through the module
    pcb_component()
    in vitamins/pcb.scad to find the string name for the
    component.  For example, let’s say I wanted to place a surface mounted
    capacitor.  In  pcb_component() I find the line:

if(show(comp, "smd_cap"))      smd_capacitor(comp[4], comp[5], param(6,
undef));

…so I know that the component entry will be made up of seven values.  So
far, then the entry is:

[ offsetX, offsetY, rotation, “smd_cap”, … ],

  1. Now I search for the TWO library files that contain the info that I need
    for the remaining values. For this example, these are vitamins/smds.scad
    and vitamins/smd.scad.

In vitamin/smds.scad I find:

CAP0603 = ["CAP0603", [1.6, 0.8], 0.3];

CAP0805 = ["CAP0805", [2.0, 1.2], 0.4];

CAP1206 = ["CAP1206", [3.1, 1.6], 0.5];

These are the predefined package types that I can choose from.  In this
example, I will use CAP0603 (even though, at this point I have no idea what
the numbers  [1.6, 0.8], 0.3] refer to.

Now my component descriptor is:

[ offsetX, offsetY, rotation, “smd_cap”, CAP0603  … ]

  1. Now I look in vitamins*/smd.scad*. I find:

function smd_cap_size(type)    = type[1]; //! Body length, width

function smd_cap_end_cap(type) = type[2]; //! End cap width

Now I know what those numbers ( [1.6, 0.8], 0.3] refer to: length, width
and end cap width.

  1. I also see:

module smd_capacitor(type, height, value = undef) { //! Draw an SMD
capacitor with specified height

Now, I finally know what the last two values of the component descriptor
need to be: Height and an optional capacitance value.

So, my component descriptor is now:

[ offsetX, offsetY, rotation, “smd_cap”, CAP0603, 0.85 ]

  1. If I wanted to specify the capacitance value, I still don’t know if I
    should specify a numeric value (1000), or a string value (“1000”), or a
    string description (“1000uF”).

Q. Is there an easier way to create such a component  descriptor?

Thanks! Len

Good day! I am attempting to use NopSCADlib to model a PC board and I have some questions. Is it just me, or is the documentation for modeling PC boards a bit sparse? I spent most of yesterday examining the PC board example. It seems that you start by building a PC board descriptor that is a list of the board characteristics and includes a sublist of the components that you wish to place on the board. For example, here is the list of components from the example LIPO_fuel_gauge board: * [ // components* * [17, 5, 90, "jst_ph", 2, true],* * [2.54 + 5.27, 1.5 * 2.54 + 5, 0, "-2p54joiner", 3, 1],* * [2.54 + 5.27, -1.5 * 2.54 + 5, 0, "-2p54joiner", 3, 1],* * [3 * 2.54 + 5.27, 5, 0, "-2p54joiner", 1, 2],* * [6.4 + 1.5, 5, 0, "chip", 3, 2, 0.8],* * [1.2, 2.5, 90, "smd_res", RES0603, "472"],* * [2.4, 2.5, 90, "smd_res", RES0603, "472"],* * [1.2, -2.5, 90, "smd_res", RES0603, "472"],* * [2.4, -2.5, 90, "smd_res", RES0603, "472"],* * [10.35, -4, -90, "smd_res", RES0603, "181"],* * [10.35, 4, -90, "smd_res", RES0603, "102"],* * [12.89, 1.5 * 2.54 + 5, 0, "smd_cap", CAP0603, 0.85],* * [12.89,-1.5 * 2.54 + 5, 0, "smd_cap", CAP0603, 0.85],* * ],* I have inferred from the examples that the first three values for each component specify the X offset, the Y offset, and any rotation angle. The fourth value is the type of component and if the first character of the type is “-”, the part is to be placed on the bottom of the board. The remaining values are specific to the type of component. The difficulty I’m having is determining the string type of the part and the remaining parameters. From what I can tell, this is the process for determining those values: 1. First, based on the component that you wish to place, search through the *module pcb_component()* in *vitamins/pcb.scad* to find the string name for the component. For example, let’s say I wanted to place a surface mounted capacitor. In *pcb_component()* I find the line: *if(show(comp, "smd_cap")) smd_capacitor(comp[4], comp[5], param(6, undef));* …so I know that the component entry will be made up of seven values. So far, then the entry is: *[ offsetX, offsetY, rotation, “smd_cap”, … ],* 2. Now I search for the TWO library files that contain the info that I need for the remaining values. For this example, these are *vitamins/smds.scad* and *vitamins/smd.scad*. In *vitamin/smds.scad* I find: *CAP0603 = ["CAP0603", [1.6, 0.8], 0.3];* *CAP0805 = ["CAP0805", [2.0, 1.2], 0.4];* *CAP1206 = ["CAP1206", [3.1, 1.6], 0.5];* These are the predefined package types that I can choose from. In this example, I will use CAP0603 (even though, at this point I have no idea what the numbers [1.6, 0.8], 0.3] refer to. Now my component descriptor is: *[ offsetX, offsetY, rotation, “smd_cap”, CAP0603 … ]* 3. Now I look in *vitamins**/smd.scad*. I find: *function smd_cap_size(type) = type[1]; //! Body length, width* *function smd_cap_end_cap(type) = type[2]; //! End cap width* Now I know what those numbers ( [1.6, 0.8], 0.3] refer to: length, width and end cap width. 4. I also see: *module smd_capacitor(type, height, value = undef) { //! Draw an SMD capacitor with specified height* Now, I finally know what the last two values of the component descriptor need to be: Height and an optional capacitance value. So, my component descriptor is now: *[ offsetX, offsetY, rotation, “smd_cap”, CAP0603, 0.85 ]* 5. If I wanted to specify the capacitance value, I still don’t know if I should specify a numeric value (1000), or a string value (“1000”), or a string description (“1000uF”). *Q. Is there an easier way to create such a component descriptor?* Thanks! Len
NH
nop head
Sat, Jan 28, 2023 7:52 PM

Hi Len,
You seem to have worked out all the details apart from the value is just
a optional string to go on the BOM.

CAP0603 is just a capacitor with a standard 0603 footprint. The number is
just the width and length in 100th of an inch. The numbers in the
descriptor are the size in mm. Unlike SMT resistors, the height of
capacitors varies with the value and voltage rating, so it is specified
with a parameter.

There isn't individual documentation for the components but there is an
example PCB with an instance of each one shown under the PCB heading and a
link to the code. I just noticed that the SMT capacitors don't have values,
so I will add some.

Crystals are on my todo list but they are radial components, so a new a
new vitamin type, that has to cope with the wires having a double bend to
match the hole pitch when mounted on veroboard.

I agree the documentation could be better. The individual component
modules get auto documented but the connection to list of parameters in the
PCB description is missing because it isn't auto documented.

Regards, Chris

On Sat, 28 Jan 2023 at 18:49, Leonard Martin Struttmann <
lenstruttmann@gmail.com> wrote:

Good day! I am attempting to use NopSCADlib to model a PC board and I have
some questions.  Is it just me, or is the documentation for modeling PC
boards a bit sparse?

I spent most of yesterday examining the PC board example. It seems that
you start by building a PC board descriptor that is a list of the board
characteristics and includes a sublist of the components that you wish to
place on the board.  For example, here is the list of components from the
example LIPO_fuel_gauge board:

  • [ // components*

  •    [17, 5, 90, "jst_ph", 2, true],*
    
  •    [2.54 + 5.27,  1.5 * 2.54 + 5, 0, "-2p54joiner", 3, 1],*
    
  •    [2.54 + 5.27, -1.5 * 2.54 + 5, 0, "-2p54joiner", 3, 1],*
    
  •    [3 * 2.54 + 5.27, 5,           0, "-2p54joiner", 1, 2],*
    
  •    [6.4 + 1.5, 5, 0, "chip", 3, 2, 0.8],*
    
  •    [1.2,  2.5, 90, "smd_res", RES0603, "472"],*
    
  •    [2.4,  2.5, 90, "smd_res", RES0603, "472"],*
    
  •    [1.2, -2.5, 90, "smd_res", RES0603, "472"],*
    
  •    [2.4, -2.5, 90, "smd_res", RES0603, "472"],*
    
  •    [10.35, -4, -90, "smd_res", RES0603, "181"],*
    
  •    [10.35,  4, -90, "smd_res", RES0603, "102"],*
    
  •    [12.89, 1.5 * 2.54 + 5, 0, "smd_cap", CAP0603, 0.85],*
    
  •    [12.89,-1.5 * 2.54 + 5, 0, "smd_cap", CAP0603, 0.85],*
    
  • ],*

I have inferred from the examples that the first three values for each
component specify the X offset, the Y offset, and any rotation angle.

The fourth value is the type of component and if the first character of
the type is “-”, the part is to be placed on the bottom of the board.

The remaining values are specific to the type of component.  The
difficulty I’m having is determining the string type of the part and the
remaining parameters.  From what I can tell, this is the process for
determining those values:

  1. First, based on the component that you wish to place, search through
    the module pcb_component() in vitamins/pcb.scad to find the string
    name for the component.  For example, let’s say I wanted to place a surface
    mounted capacitor.  In  pcb_component() I find the line:

if(show(comp, "smd_cap"))      smd_capacitor(comp[4], comp[5], param(6,
undef));

…so I know that the component entry will be made up of seven values.  So
far, then the entry is:

[ offsetX, offsetY, rotation, “smd_cap”, … ],

  1. Now I search for the TWO library files that contain the info that I
    need for the remaining values. For this example, these are
    vitamins/smds.scad and vitamins/smd.scad.

In vitamin/smds.scad I find:

CAP0603 = ["CAP0603", [1.6, 0.8], 0.3];

CAP0805 = ["CAP0805", [2.0, 1.2], 0.4];

CAP1206 = ["CAP1206", [3.1, 1.6], 0.5];

These are the predefined package types that I can choose from.  In this
example, I will use CAP0603 (even though, at this point I have no idea what
the numbers  [1.6, 0.8], 0.3] refer to.

Now my component descriptor is:

[ offsetX, offsetY, rotation, “smd_cap”, CAP0603  … ]

  1. Now I look in vitamins*/smd.scad*. I find:

function smd_cap_size(type)    = type[1]; //! Body length, width

function smd_cap_end_cap(type) = type[2]; //! End cap width

Now I know what those numbers ( [1.6, 0.8], 0.3] refer to: length, width
and end cap width.

  1. I also see:

module smd_capacitor(type, height, value = undef) { //! Draw an SMD
capacitor with specified height

Now, I finally know what the last two values of the component descriptor
need to be: Height and an optional capacitance value.

So, my component descriptor is now:

[ offsetX, offsetY, rotation, “smd_cap”, CAP0603, 0.85 ]

  1. If I wanted to specify the capacitance value, I still don’t know if I
    should specify a numeric value (1000), or a string value (“1000”), or a
    string description (“1000uF”).

Q. Is there an easier way to create such a component  descriptor?

Thanks! Len


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Hi Len, You seem to have worked out all the details apart from the value is just a optional string to go on the BOM. CAP0603 is just a capacitor with a standard 0603 footprint. The number is just the width and length in 100th of an inch. The numbers in the descriptor are the size in mm. Unlike SMT resistors, the height of capacitors varies with the value and voltage rating, so it is specified with a parameter. There isn't individual documentation for the components but there is an example PCB with an instance of each one shown under the PCB heading and a link to the code. I just noticed that the SMT capacitors don't have values, so I will add some. Crystals are on my todo list but they are radial components, so a new a new vitamin type, that has to cope with the wires having a double bend to match the hole pitch when mounted on veroboard. I agree the documentation could be better. The individual component modules get auto documented but the connection to list of parameters in the PCB description is missing because it isn't auto documented. Regards, Chris On Sat, 28 Jan 2023 at 18:49, Leonard Martin Struttmann < lenstruttmann@gmail.com> wrote: > Good day! I am attempting to use NopSCADlib to model a PC board and I have > some questions. Is it just me, or is the documentation for modeling PC > boards a bit sparse? > > I spent most of yesterday examining the PC board example. It seems that > you start by building a PC board descriptor that is a list of the board > characteristics and includes a sublist of the components that you wish to > place on the board. For example, here is the list of components from the > example LIPO_fuel_gauge board: > > * [ // components* > > * [17, 5, 90, "jst_ph", 2, true],* > > * [2.54 + 5.27, 1.5 * 2.54 + 5, 0, "-2p54joiner", 3, 1],* > > * [2.54 + 5.27, -1.5 * 2.54 + 5, 0, "-2p54joiner", 3, 1],* > > * [3 * 2.54 + 5.27, 5, 0, "-2p54joiner", 1, 2],* > > * [6.4 + 1.5, 5, 0, "chip", 3, 2, 0.8],* > > * [1.2, 2.5, 90, "smd_res", RES0603, "472"],* > > * [2.4, 2.5, 90, "smd_res", RES0603, "472"],* > > * [1.2, -2.5, 90, "smd_res", RES0603, "472"],* > > * [2.4, -2.5, 90, "smd_res", RES0603, "472"],* > > * [10.35, -4, -90, "smd_res", RES0603, "181"],* > > * [10.35, 4, -90, "smd_res", RES0603, "102"],* > > * [12.89, 1.5 * 2.54 + 5, 0, "smd_cap", CAP0603, 0.85],* > > * [12.89,-1.5 * 2.54 + 5, 0, "smd_cap", CAP0603, 0.85],* > > * ],* > > I have inferred from the examples that the first three values for each > component specify the X offset, the Y offset, and any rotation angle. > > The fourth value is the type of component and if the first character of > the type is “-”, the part is to be placed on the bottom of the board. > > The remaining values are specific to the type of component. The > difficulty I’m having is determining the string type of the part and the > remaining parameters. From what I can tell, this is the process for > determining those values: > > 1. First, based on the component that you wish to place, search through > the *module pcb_component()* in *vitamins/pcb.scad* to find the string > name for the component. For example, let’s say I wanted to place a surface > mounted capacitor. In *pcb_component()* I find the line: > > *if(show(comp, "smd_cap")) smd_capacitor(comp[4], comp[5], param(6, > undef));* > > …so I know that the component entry will be made up of seven values. So > far, then the entry is: > > *[ offsetX, offsetY, rotation, “smd_cap”, … ],* > > 2. Now I search for the TWO library files that contain the info that I > need for the remaining values. For this example, these are > *vitamins/smds.scad* and *vitamins/smd.scad*. > > In *vitamin/smds.scad* I find: > > *CAP0603 = ["CAP0603", [1.6, 0.8], 0.3];* > > *CAP0805 = ["CAP0805", [2.0, 1.2], 0.4];* > > *CAP1206 = ["CAP1206", [3.1, 1.6], 0.5];* > > These are the predefined package types that I can choose from. In this > example, I will use CAP0603 (even though, at this point I have no idea what > the numbers [1.6, 0.8], 0.3] refer to. > > Now my component descriptor is: > > *[ offsetX, offsetY, rotation, “smd_cap”, CAP0603 … ]* > > 3. Now I look in *vitamins**/smd.scad*. I find: > > *function smd_cap_size(type) = type[1]; //! Body length, width* > > *function smd_cap_end_cap(type) = type[2]; //! End cap width* > > Now I know what those numbers ( [1.6, 0.8], 0.3] refer to: length, width > and end cap width. > > 4. I also see: > > *module smd_capacitor(type, height, value = undef) { //! Draw an SMD > capacitor with specified height* > > Now, I finally know what the last two values of the component descriptor > need to be: Height and an optional capacitance value. > > So, my component descriptor is now: > > *[ offsetX, offsetY, rotation, “smd_cap”, CAP0603, 0.85 ]* > > 5. If I wanted to specify the capacitance value, I still don’t know if I > should specify a numeric value (1000), or a string value (“1000”), or a > string description (“1000uF”). > > > *Q. Is there an easier way to create such a component descriptor?* > > > Thanks! Len > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
LM
Leonard Martin Struttmann
Sun, Jan 29, 2023 12:04 AM

Thanks, Chris!

On Sat, Jan 28, 2023 at 1:53 PM nop head nop.head@gmail.com wrote:

Hi Len,
You seem to have worked out all the details apart from the value is just
a optional string to go on the BOM.

CAP0603 is just a capacitor with a standard 0603 footprint. The number
is just the width and length in 100th of an inch. The numbers in the
descriptor are the size in mm. Unlike SMT resistors, the height of
capacitors varies with the value and voltage rating, so it is specified
with a parameter.

There isn't individual documentation for the components but there is an

example PCB with an instance of each one shown under the PCB heading and a
link to the code. I just noticed that the SMT capacitors don't have values,
so I will add some.

Crystals are on my todo list but they are radial components, so a new a
new vitamin type, that has to cope with the wires having a double bend to
match the hole pitch when mounted on veroboard.

I agree the documentation could be better. The individual component
modules get auto documented but the connection to list of parameters in the
PCB description is missing because it isn't auto documented.

Regards, Chris

On Sat, 28 Jan 2023 at 18:49, Leonard Martin Struttmann <
lenstruttmann@gmail.com> wrote:

Good day! I am attempting to use NopSCADlib to model a PC board and I
have some questions.  Is it just me, or is the documentation for modeling
PC boards a bit sparse?

I spent most of yesterday examining the PC board example. It seems that
you start by building a PC board descriptor that is a list of the board
characteristics and includes a sublist of the components that you wish to
place on the board.  For example, here is the list of components from the
example LIPO_fuel_gauge board:

  • [ // components*

  •    [17, 5, 90, "jst_ph", 2, true],*
    
  •    [2.54 + 5.27,  1.5 * 2.54 + 5, 0, "-2p54joiner", 3, 1],*
    
  •    [2.54 + 5.27, -1.5 * 2.54 + 5, 0, "-2p54joiner", 3, 1],*
    
  •    [3 * 2.54 + 5.27, 5,           0, "-2p54joiner", 1, 2],*
    
  •    [6.4 + 1.5, 5, 0, "chip", 3, 2, 0.8],*
    
  •    [1.2,  2.5, 90, "smd_res", RES0603, "472"],*
    
  •    [2.4,  2.5, 90, "smd_res", RES0603, "472"],*
    
  •    [1.2, -2.5, 90, "smd_res", RES0603, "472"],*
    
  •    [2.4, -2.5, 90, "smd_res", RES0603, "472"],*
    
  •    [10.35, -4, -90, "smd_res", RES0603, "181"],*
    
  •    [10.35,  4, -90, "smd_res", RES0603, "102"],*
    
  •    [12.89, 1.5 * 2.54 + 5, 0, "smd_cap", CAP0603, 0.85],*
    
  •    [12.89,-1.5 * 2.54 + 5, 0, "smd_cap", CAP0603, 0.85],*
    
  • ],*

I have inferred from the examples that the first three values for each
component specify the X offset, the Y offset, and any rotation angle.

The fourth value is the type of component and if the first character of
the type is “-”, the part is to be placed on the bottom of the board.

The remaining values are specific to the type of component.  The
difficulty I’m having is determining the string type of the part and the
remaining parameters.  From what I can tell, this is the process for
determining those values:

  1. First, based on the component that you wish to place, search through
    the module pcb_component() in vitamins/pcb.scad to find the string
    name for the component.  For example, let’s say I wanted to place a surface
    mounted capacitor.  In  pcb_component() I find the line:

if(show(comp, "smd_cap"))      smd_capacitor(comp[4], comp[5], param(6,
undef));

…so I know that the component entry will be made up of seven values.  So
far, then the entry is:

[ offsetX, offsetY, rotation, “smd_cap”, … ],

  1. Now I search for the TWO library files that contain the info that I
    need for the remaining values. For this example, these are
    vitamins/smds.scad and vitamins/smd.scad.

In vitamin/smds.scad I find:

CAP0603 = ["CAP0603", [1.6, 0.8], 0.3];

CAP0805 = ["CAP0805", [2.0, 1.2], 0.4];

CAP1206 = ["CAP1206", [3.1, 1.6], 0.5];

These are the predefined package types that I can choose from.  In this
example, I will use CAP0603 (even though, at this point I have no idea what
the numbers  [1.6, 0.8], 0.3] refer to.

Now my component descriptor is:

[ offsetX, offsetY, rotation, “smd_cap”, CAP0603  … ]

  1. Now I look in vitamins*/smd.scad*. I find:

function smd_cap_size(type)    = type[1]; //! Body length, width

function smd_cap_end_cap(type) = type[2]; //! End cap width

Now I know what those numbers ( [1.6, 0.8], 0.3] refer to: length, width
and end cap width.

  1. I also see:

module smd_capacitor(type, height, value = undef) { //! Draw an SMD
capacitor with specified height

Now, I finally know what the last two values of the component descriptor
need to be: Height and an optional capacitance value.

So, my component descriptor is now:

[ offsetX, offsetY, rotation, “smd_cap”, CAP0603, 0.85 ]

  1. If I wanted to specify the capacitance value, I still don’t know if I
    should specify a numeric value (1000), or a string value (“1000”), or a
    string description (“1000uF”).

Q. Is there an easier way to create such a component  descriptor?

Thanks! Len


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Thanks, Chris! On Sat, Jan 28, 2023 at 1:53 PM nop head <nop.head@gmail.com> wrote: > Hi Len, > You seem to have worked out all the details apart from the value is just > a optional string to go on the BOM. > > CAP0603 is just a capacitor with a standard 0603 footprint. The number > is just the width and length in 100th of an inch. The numbers in the > descriptor are the size in mm. Unlike SMT resistors, the height of > capacitors varies with the value and voltage rating, so it is specified > with a parameter. > > There isn't individual documentation for the components but there is an > example PCB with an instance of each one shown under the PCB heading and a > link to the code. I just noticed that the SMT capacitors don't have values, > so I will add some. > > Crystals are on my todo list but they are radial components, so a new a > new vitamin type, that has to cope with the wires having a double bend to > match the hole pitch when mounted on veroboard. > > I agree the documentation could be better. The individual component > modules get auto documented but the connection to list of parameters in the > PCB description is missing because it isn't auto documented. > > Regards, Chris > > On Sat, 28 Jan 2023 at 18:49, Leonard Martin Struttmann < > lenstruttmann@gmail.com> wrote: > >> Good day! I am attempting to use NopSCADlib to model a PC board and I >> have some questions. Is it just me, or is the documentation for modeling >> PC boards a bit sparse? >> >> I spent most of yesterday examining the PC board example. It seems that >> you start by building a PC board descriptor that is a list of the board >> characteristics and includes a sublist of the components that you wish to >> place on the board. For example, here is the list of components from the >> example LIPO_fuel_gauge board: >> >> * [ // components* >> >> * [17, 5, 90, "jst_ph", 2, true],* >> >> * [2.54 + 5.27, 1.5 * 2.54 + 5, 0, "-2p54joiner", 3, 1],* >> >> * [2.54 + 5.27, -1.5 * 2.54 + 5, 0, "-2p54joiner", 3, 1],* >> >> * [3 * 2.54 + 5.27, 5, 0, "-2p54joiner", 1, 2],* >> >> * [6.4 + 1.5, 5, 0, "chip", 3, 2, 0.8],* >> >> * [1.2, 2.5, 90, "smd_res", RES0603, "472"],* >> >> * [2.4, 2.5, 90, "smd_res", RES0603, "472"],* >> >> * [1.2, -2.5, 90, "smd_res", RES0603, "472"],* >> >> * [2.4, -2.5, 90, "smd_res", RES0603, "472"],* >> >> * [10.35, -4, -90, "smd_res", RES0603, "181"],* >> >> * [10.35, 4, -90, "smd_res", RES0603, "102"],* >> >> * [12.89, 1.5 * 2.54 + 5, 0, "smd_cap", CAP0603, 0.85],* >> >> * [12.89,-1.5 * 2.54 + 5, 0, "smd_cap", CAP0603, 0.85],* >> >> * ],* >> >> I have inferred from the examples that the first three values for each >> component specify the X offset, the Y offset, and any rotation angle. >> >> The fourth value is the type of component and if the first character of >> the type is “-”, the part is to be placed on the bottom of the board. >> >> The remaining values are specific to the type of component. The >> difficulty I’m having is determining the string type of the part and the >> remaining parameters. From what I can tell, this is the process for >> determining those values: >> >> 1. First, based on the component that you wish to place, search through >> the *module pcb_component()* in *vitamins/pcb.scad* to find the string >> name for the component. For example, let’s say I wanted to place a surface >> mounted capacitor. In *pcb_component()* I find the line: >> >> *if(show(comp, "smd_cap")) smd_capacitor(comp[4], comp[5], param(6, >> undef));* >> >> …so I know that the component entry will be made up of seven values. So >> far, then the entry is: >> >> *[ offsetX, offsetY, rotation, “smd_cap”, … ],* >> >> 2. Now I search for the TWO library files that contain the info that I >> need for the remaining values. For this example, these are >> *vitamins/smds.scad* and *vitamins/smd.scad*. >> >> In *vitamin/smds.scad* I find: >> >> *CAP0603 = ["CAP0603", [1.6, 0.8], 0.3];* >> >> *CAP0805 = ["CAP0805", [2.0, 1.2], 0.4];* >> >> *CAP1206 = ["CAP1206", [3.1, 1.6], 0.5];* >> >> These are the predefined package types that I can choose from. In this >> example, I will use CAP0603 (even though, at this point I have no idea what >> the numbers [1.6, 0.8], 0.3] refer to. >> >> Now my component descriptor is: >> >> *[ offsetX, offsetY, rotation, “smd_cap”, CAP0603 … ]* >> >> 3. Now I look in *vitamins**/smd.scad*. I find: >> >> *function smd_cap_size(type) = type[1]; //! Body length, width* >> >> *function smd_cap_end_cap(type) = type[2]; //! End cap width* >> >> Now I know what those numbers ( [1.6, 0.8], 0.3] refer to: length, width >> and end cap width. >> >> 4. I also see: >> >> *module smd_capacitor(type, height, value = undef) { //! Draw an SMD >> capacitor with specified height* >> >> Now, I finally know what the last two values of the component descriptor >> need to be: Height and an optional capacitance value. >> >> So, my component descriptor is now: >> >> *[ offsetX, offsetY, rotation, “smd_cap”, CAP0603, 0.85 ]* >> >> 5. If I wanted to specify the capacitance value, I still don’t know if I >> should specify a numeric value (1000), or a string value (“1000”), or a >> string description (“1000uF”). >> >> >> *Q. Is there an easier way to create such a component descriptor?* >> >> >> Thanks! Len >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
RW
Rogier Wolff
Sun, Jan 29, 2023 3:00 PM

On Sat, Jan 28, 2023 at 07:52:36PM +0000, nop head wrote:

Unlike SMT resistors, the height of capacitors varies with the value
and voltage rating, so it is specified with a parameter.

about two weeks ago I bought some 7W SMT resistors and they are quite
a bit thicker than I expected. That said for getting a 3D impression
of a PCB, that's not very relevant.

I just noticed that the SMT capacitors don't have values, so I will
add some.

I think that is because the "472" is the text on the resistor.
SMT capacitors normally don't have any text printed on them.

Roger. 

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.

On Sat, Jan 28, 2023 at 07:52:36PM +0000, nop head wrote: > Unlike SMT resistors, the height of capacitors varies with the value > and voltage rating, so it is specified with a parameter. about two weeks ago I bought some 7W SMT resistors and they are quite a bit thicker than I expected. That said for getting a 3D impression of a PCB, that's not very relevant. > I just noticed that the SMT capacitors don't have values, so I will > add some. I think that is because the "472" is the text on the resistor. SMT capacitors normally don't have any text printed on them. Roger. -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** f equals m times a. When your f is steady, and your m is going down your a is going up. -- Chris Hadfield about flying up the space shuttle.
NH
nop head
Sun, Jan 29, 2023 3:09 PM

Yes the value doesn't show on the capacitor but it goes on the BOM if
present and the PCB has the parts on BOM property set to true. So if you
make your own PCB or veroboard assembly you can get a BOM but if you buy
one ready made you don't need the components on the BOM, just the PCB.

I have never seen 7W SMT resistors, what footprint are they on? The
dissipation is mostly to do with surface area, rather than thickness. I.e.
making them thicker would not dissipate much more power.

On Sun, 29 Jan 2023 at 15:01, Rogier Wolff R.E.Wolff@bitwizard.nl wrote:

On Sat, Jan 28, 2023 at 07:52:36PM +0000, nop head wrote:

Unlike SMT resistors, the height of capacitors varies with the value
and voltage rating, so it is specified with a parameter.

about two weeks ago I bought some 7W SMT resistors and they are quite
a bit thicker than I expected. That said for getting a 3D impression
of a PCB, that's not very relevant.

I just noticed that the SMT capacitors don't have values, so I will
add some.

I think that is because the "472" is the text on the resistor.
SMT capacitors normally don't have any text printed on them.

     Roger.

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110
**
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Yes the value doesn't show on the capacitor but it goes on the BOM if present and the PCB has the parts on BOM property set to true. So if you make your own PCB or veroboard assembly you can get a BOM but if you buy one ready made you don't need the components on the BOM, just the PCB. I have never seen 7W SMT resistors, what footprint are they on? The dissipation is mostly to do with surface area, rather than thickness. I.e. making them thicker would not dissipate much more power. On Sun, 29 Jan 2023 at 15:01, Rogier Wolff <R.E.Wolff@bitwizard.nl> wrote: > On Sat, Jan 28, 2023 at 07:52:36PM +0000, nop head wrote: > > Unlike SMT resistors, the height of capacitors varies with the value > > and voltage rating, so it is specified with a parameter. > > about two weeks ago I bought some 7W SMT resistors and they are quite > a bit thicker than I expected. That said for getting a 3D impression > of a PCB, that's not very relevant. > > > I just noticed that the SMT capacitors don't have values, so I will > > add some. > > I think that is because the "472" is the text on the resistor. > SMT capacitors normally don't have any text printed on them. > > Roger. > > -- > ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 > ** > ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** > f equals m times a. When your f is steady, and your m is going down > your a is going up. -- Chris Hadfield about flying up the space shuttle. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
RW
Rogier Wolff
Sun, Jan 29, 2023 3:34 PM

On Sun, Jan 29, 2023 at 03:09:12PM +0000, nop head wrote:

Yes the value doesn't show on the capacitor but it goes on the BOM if
present and the PCB has the parts on BOM property set to true. So if you
make your own PCB or veroboard assembly you can get a BOM but if you buy
one ready made you don't need the components on the BOM, just the PCB.

I have never seen 7W SMT resistors, what footprint are they on? The
dissipation is mostly to do with surface area, rather than thickness. I.e.
making them thicker would not dissipate much more power.

Yup.

They are Humungous compared to what you normally see. I looked it up:
4527 is the size code. (I'd written "2512 IIRC" first. Well I did NOT
remember correctly... :-) )

Roger. 

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.

On Sun, Jan 29, 2023 at 03:09:12PM +0000, nop head wrote: > Yes the value doesn't show on the capacitor but it goes on the BOM if > present and the PCB has the parts on BOM property set to true. So if you > make your own PCB or veroboard assembly you can get a BOM but if you buy > one ready made you don't need the components on the BOM, just the PCB. > > I have never seen 7W SMT resistors, what footprint are they on? The > dissipation is mostly to do with surface area, rather than thickness. I.e. > making them thicker would not dissipate much more power. Yup. They are Humungous compared to what you normally see. I looked it up: 4527 is the size code. (I'd written "2512 IIRC" first. Well I did NOT remember correctly... :-) ) Roger. -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** f equals m times a. When your f is steady, and your m is going down your a is going up. -- Chris Hadfield about flying up the space shuttle.
NH
nop head
Sun, Jan 29, 2023 5:05 PM

They seem to be 11.5 by 7mm and either 1.8mm thick or 2.5mm thick. They
have a heatsink pad in the middle though but you can't see that when
mounted.

They seem to be only very low value current sense resistors, so not quite
the same as normal SMT resistors. Do you want one added to the library?

On Sun, 29 Jan 2023 at 15:35, Rogier Wolff R.E.Wolff@bitwizard.nl wrote:

On Sun, Jan 29, 2023 at 03:09:12PM +0000, nop head wrote:

Yes the value doesn't show on the capacitor but it goes on the BOM if
present and the PCB has the parts on BOM property set to true. So if you
make your own PCB or veroboard assembly you can get a BOM but if you buy
one ready made you don't need the components on the BOM, just the PCB.

I have never seen 7W SMT resistors, what footprint are they on? The
dissipation is mostly to do with surface area, rather than thickness.

I.e.

making them thicker would not dissipate much more power.

Yup.

They are Humungous compared to what you normally see. I looked it up:
4527 is the size code. (I'd written "2512 IIRC" first. Well I did NOT
remember correctly... :-) )

     Roger.

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110
**
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

They seem to be 11.5 by 7mm and either 1.8mm thick or 2.5mm thick. They have a heatsink pad in the middle though but you can't see that when mounted. They seem to be only very low value current sense resistors, so not quite the same as normal SMT resistors. Do you want one added to the library? On Sun, 29 Jan 2023 at 15:35, Rogier Wolff <R.E.Wolff@bitwizard.nl> wrote: > On Sun, Jan 29, 2023 at 03:09:12PM +0000, nop head wrote: > > Yes the value doesn't show on the capacitor but it goes on the BOM if > > present and the PCB has the parts on BOM property set to true. So if you > > make your own PCB or veroboard assembly you can get a BOM but if you buy > > one ready made you don't need the components on the BOM, just the PCB. > > > > I have never seen 7W SMT resistors, what footprint are they on? The > > dissipation is mostly to do with surface area, rather than thickness. > I.e. > > making them thicker would not dissipate much more power. > > Yup. > > They are Humungous compared to what you normally see. I looked it up: > 4527 is the size code. (I'd written "2512 IIRC" first. Well I did NOT > remember correctly... :-) ) > > Roger. > > -- > ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 > ** > ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** > f equals m times a. When your f is steady, and your m is going down > your a is going up. -- Chris Hadfield about flying up the space shuttle. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
RW
Rogier Wolff
Mon, Jan 30, 2023 11:19 AM

On Sun, Jan 29, 2023 at 05:05:02PM +0000, nop head wrote:

They seem to be 11.5 by 7mm and either 1.8mm thick or 2.5mm thick. They
have a heatsink pad in the middle though but you can't see that when
mounted.

They seem to be only very low value current sense resistors, so not quite
the same as normal SMT resistors. Do you want one added to the library?

No, not for me. I usually have enough of an idea what my PCB will look
like. And instead of learning how to use the generic stuff I usually just
do things by hand. e.g.

color ("green") difference () {
cube ([100,50,1.6]);
translate ([3,3,-1]) cylinder (d=3, h=5);
translate ([97,3,-1]) cylinder (d=3, h=5);
translate ([97,47,-1]) cylinder (d=3, h=5);
translate ([3,47,-1]) cylinder (d=3, h=5);
}
translate ([45.43,12.6,1.6]) color ("darkgrey") cylinder (d=10, h=20);

to check the height of the capacitor and the position of the mounting
holes.

A thermal pad??? Hmm. The PCB doesn't have that. :-(
It is going to be a replacement current-sense-resistor for a
KA3005D lab power supply that I blew up.

Roger.

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.

On Sun, Jan 29, 2023 at 05:05:02PM +0000, nop head wrote: > They seem to be 11.5 by 7mm and either 1.8mm thick or 2.5mm thick. They > have a heatsink pad in the middle though but you can't see that when > mounted. > > They seem to be only very low value current sense resistors, so not quite > the same as normal SMT resistors. Do you want one added to the library? No, not for me. I usually have enough of an idea what my PCB will look like. And instead of learning how to use the generic stuff I usually just do things by hand. e.g. color ("green") difference () { cube ([100,50,1.6]); translate ([3,3,-1]) cylinder (d=3, h=5); translate ([97,3,-1]) cylinder (d=3, h=5); translate ([97,47,-1]) cylinder (d=3, h=5); translate ([3,47,-1]) cylinder (d=3, h=5); } translate ([45.43,12.6,1.6]) color ("darkgrey") cylinder (d=10, h=20); to check the height of the capacitor and the position of the mounting holes. A thermal pad??? Hmm. The PCB doesn't have that. :-( It is going to be a replacement current-sense-resistor for a KA3005D lab power supply that I blew up. Roger. -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** f equals m times a. When your f is steady, and your m is going down your a is going up. -- Chris Hadfield about flying up the space shuttle.
NH
nop head
Mon, Jan 30, 2023 11:24 AM

How did you blow it up? It is supposed to have overload protection being a
lab supply.

On Mon, 30 Jan 2023 at 11:20, Rogier Wolff R.E.Wolff@bitwizard.nl wrote:

On Sun, Jan 29, 2023 at 05:05:02PM +0000, nop head wrote:

They seem to be 11.5 by 7mm and either 1.8mm thick or 2.5mm thick. They
have a heatsink pad in the middle though but you can't see that when
mounted.

They seem to be only very low value current sense resistors, so not quite
the same as normal SMT resistors. Do you want one added to the library?

No, not for me. I usually have enough of an idea what my PCB will look
like. And instead of learning how to use the generic stuff I usually just
do things by hand. e.g.

color ("green") difference () {
cube ([100,50,1.6]);
translate ([3,3,-1]) cylinder (d=3, h=5);
translate ([97,3,-1]) cylinder (d=3, h=5);
translate ([97,47,-1]) cylinder (d=3, h=5);
translate ([3,47,-1]) cylinder (d=3, h=5);
}
translate ([45.43,12.6,1.6]) color ("darkgrey") cylinder (d=10, h=20);

to check the height of the capacitor and the position of the mounting
holes.

A thermal pad??? Hmm. The PCB doesn't have that. :-(
It is going to be a replacement current-sense-resistor for a
KA3005D lab power supply that I blew up.

     Roger.

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110
**
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

How did you blow it up? It is supposed to have overload protection being a lab supply. On Mon, 30 Jan 2023 at 11:20, Rogier Wolff <R.E.Wolff@bitwizard.nl> wrote: > On Sun, Jan 29, 2023 at 05:05:02PM +0000, nop head wrote: > > They seem to be 11.5 by 7mm and either 1.8mm thick or 2.5mm thick. They > > have a heatsink pad in the middle though but you can't see that when > > mounted. > > > > They seem to be only very low value current sense resistors, so not quite > > the same as normal SMT resistors. Do you want one added to the library? > > No, not for me. I usually have enough of an idea what my PCB will look > like. And instead of learning how to use the generic stuff I usually just > do things by hand. e.g. > > color ("green") difference () { > cube ([100,50,1.6]); > translate ([3,3,-1]) cylinder (d=3, h=5); > translate ([97,3,-1]) cylinder (d=3, h=5); > translate ([97,47,-1]) cylinder (d=3, h=5); > translate ([3,47,-1]) cylinder (d=3, h=5); > } > translate ([45.43,12.6,1.6]) color ("darkgrey") cylinder (d=10, h=20); > > to check the height of the capacitor and the position of the mounting > holes. > > A thermal pad??? Hmm. The PCB doesn't have that. :-( > It is going to be a replacement current-sense-resistor for a > KA3005D lab power supply that I blew up. > > > Roger. > > -- > ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 > ** > ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** > f equals m times a. When your f is steady, and your m is going down > your a is going up. -- Chris Hadfield about flying up the space shuttle. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
RW
Rogier Wolff
Mon, Jan 30, 2023 12:19 PM

On Mon, Jan 30, 2023 at 11:24:23AM +0000, nop head wrote:

How did you blow it up? It is supposed to have overload protection being a
lab supply.

Apparently it can't handle that you reverse-connect an empty 1200Wh
lithium battery. Who would have thought? :-)

There is a diode that should prevent the voltage going "too negative"
on the positive output terminal. That blew. And the current sense
resistor blew (to pieces!). I'm hoping that's all.

At say 100A, 1kW, the resistor would dissipate enough to start melting
and failing in seconds. It didn't do that. It exploaded. About a kA I'd
guess.

Roger. 

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.

On Mon, Jan 30, 2023 at 11:24:23AM +0000, nop head wrote: > How did you blow it up? It is supposed to have overload protection being a > lab supply. Apparently it can't handle that you reverse-connect an empty 1200Wh lithium battery. Who would have thought? :-) There is a diode that should prevent the voltage going "too negative" on the positive output terminal. That blew. And the current sense resistor blew (to pieces!). I'm hoping that's all. At say 100A, 1kW, the resistor would dissipate enough to start melting and failing in seconds. It didn't do that. It exploaded. About a kA I'd guess. Roger. -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** f equals m times a. When your f is steady, and your m is going down your a is going up. -- Chris Hadfield about flying up the space shuttle.