Author Topic: Calculate a sum of values of a parameter for all components in Altium? ATEX  (Read 6564 times)

0 Members and 1 Guest are viewing this topic.

Offline ManCaveTopic starter

  • Regular Contributor
  • *
  • Posts: 90
Hi

I've been searching altium documentation but am unable to solve this. I am working on a design where I need to see in some way a sum of total capacitance of capacitors belonging to certain evaluation group.

For example:
I would use a query to search for: HasParameter('CapGroup', 'GroupA')
Then I would like to calculate a sum of capacitance values:    Parameter('Capacitance_uF', '[values]')

Ideally I would like to create a textbox on the schematic sheet where I would have a table showing sums of capacitances in various groups. e.g.

GROUP      TOTAL CAPACITANCE
GroupA          22.5uF
GroupB          120uF
GroupC          22.6uF
....etc...

Please, I'm pulling my hair out. I know this is quite an advanced thing I'm asking altium to do but hey, you never know. It would really make my life easier.

Thanks!
« Last Edit: June 08, 2017, 10:24:55 am by ManCave »
 

Offline pigrew

  • Frequent Contributor
  • **
  • Posts: 680
  • Country: us
I don't think the software by default can do that. One possibility would be to write a script to make the calculation. Another would be to export a BOM which includes the value column, and have excel perform the sum. You could even make a custom BOM template to "automatically" do the calculation when the BOM is exported.
 

Offline ManCaveTopic starter

  • Regular Contributor
  • *
  • Posts: 90
Thanks!

Scripting, I might look into it but at the moment cannot write altium scripts.

BOM, That is the next best choice which I considered but would really like to have a calculation shown on the sheet and updated when I change something. If there is no other way to do this, I think I'll do that.

Any other ideas?
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21684
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
You'll have to evaluate it manually.

The query system is powerful, but it's first-order only, and selects objects based on their data.  That is, you can't select objects based on their child properties, or based on relationships between objects.

(You can select the child properties themselves, if they are objects -- system parameters are not objects (but system parameters are integrated with the parent object, so can be filtered on, directly), but user parameters are.  Once you have parameter objects selected, go to Inspector and click the Owner link to select the Parts.)

You can also make powerful use of the List panel, or the Parameter Manager, by filtering and editing in those directly, or copying the data into a spreadsheet program to do more powerful things there, then paste it back.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: ManCave

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2300
  • Country: gb
Curiosity has got the better of me! Got to ask, why do you need to add up capacitance values?
ATEX application? But then voltage across capacitors would need to be considered also.
 

Offline ManCaveTopic starter

  • Regular Contributor
  • *
  • Posts: 90
You can also make powerful use of the List panel, or the Parameter Manager, by filtering and editing in those directly, or copying the data into a spreadsheet program to do more powerful things there, then paste it back.

Tim

Thanks Tim!
Copying from the parameter manager to a spreadsheet with pre-made formulas to calculate what I need might be the simplest way then (I'm torn between this and using a template for BOM export)...

Curiosity has got the better of me! Got to ask, why do you need to add up capacitance values?
ATEX application? But then voltage across capacitors would need to be considered also.
It is for ATEX and ICEx. It's an intrinsically safe design where you are only allowed certain energy to prevent sparking, hence limited capacitance at certain voltage.

Voltage across capacitor is taken care of using zener barriers and capacitors are selected at Vcap>1.5*Vmax of the circuit. No more consideration needs to be given to the voltage across capacitor than in standard design practice, really ;)
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2300
  • Country: gb
Interesting, thanks.
We've not yet tackled an ATEX design, circled the problem several times but didn't take the plunge.
It looks to be quite an undertaking both for initial design (working with certified body) and ongoing manufacturing re-cert where having ISO9000 accreditation can help.

If you had a few minutes to create thread and outline some of your thoughts on the process it would be greatly appreciated, by me at least!
 

Offline ManCaveTopic starter

  • Regular Contributor
  • *
  • Posts: 90
Interesting, thanks.
We've not yet tackled an ATEX design, circled the problem several times but didn't take the plunge.
It looks to be quite an undertaking both for initial design (working with certified body) and ongoing manufacturing re-cert where having ISO9000 accreditation can help.

If you had a few minutes to create thread and outline some of your thoughts on the process it would be greatly appreciated, by me at least!

It is! Although the concept (once understood) is logical and straightforward, lots and lots of thought and care needs to go into component selection, correct schematic design and especially layout. A good starting point would be to grab a copy of the 60079-11 standard and read through it, then read again....then once again :)It's not that long.

Also worth looking at 60079-0 which is a general Explosive Atmospheres standard. I think I saw older version available for free online. Although, not up to date, the concepts are the same, some specific requirements will be different so if doing design make sure you buy the latest copy.

I did think about sharing my knowledge (somehow limited still as don't have years of experience doing Ex-i design) but wasn't sure how helpful that would be. It's an involving topic. I do have my own youtube channel so though of doing a Ex-i design series but just don't have time at the moment as working 120% both at work and on my house refurb...If you have any specific questions, feel free to ask. I might get to doing the videos or write some articles some time in the future.
 
The following users thanked this post: voltsandjolts

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2300
  • Country: gb
ATEX is a niche topic and I find there is a lack of practical information from actual engineers who have been there and done it, even on this excellent forum.

Info comes from
(1) Technical standards like those you mentioned
(2) Certified bodies who have a vested interest in extrapolating the project

It would be great to hear about your experience, although I don't think it would get 100K hits on YouTube!
 

Offline ManCaveTopic starter

  • Regular Contributor
  • *
  • Posts: 90
Quite right, not many views, but I know how difficult it is to get started with Ex design without prior experience in the field. I really would like to share my knowledge, but unfortunately at the moment time doesn't allow.

It is also one thing to be able to get my particular design through the certification process, but a completely different thing to explain all aspects off design for explosive atmospheres to someone else. Every design requires different approach with its own little issues.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
in your schematic symbols : add two parameters. one called group and one called capacitance or value or whatever (value is numerical only ! without suffixes. and 1uf based. so 1 pf is written as 0.000001) to all the capacitors ( ideally you do that in the library )

now you can in the sch filter simply filter on net

if innet('this') and incomponent 'C*') 
this will list all the capacitors attached to that net. now simply scroll to the column 'capacitance' copy , past in excel . and done.
you can filter net immediately.

but this is an interesting thing. i will see if i can write a small scrit where you simply click on a net and it displays the total capacitance attached to it. it is easy to do. all i have ot do is let you pick a net, extract the name, make an iterator over components called c* and see if they have a pin attached to the net. simply tally up value

var total_capacitance : double;
current_project   :icb_project;
part_iterator   :ipcb_iterator;
capacitor :ipcb_component;
procedure Get_Total_capacitance
   current:project :=pcbserver.getcurrentproject
   part_iterator :=current_project.create_iterator;
   part_iterator.addfilter ("designator","C*);
   capacitor := part_iterator.getfirstitem
   while capacitor <>nil do begin
    try
       if capacitor.pins[1].net := selectednet then total_capacitance := total_capacitance + capacitor.parameters("capacitance").todouble;
       if capacitor.pins[2].net := selectednet then total_capacitance := total_capacitance + capacitor.parameters("capacitance").todouble;
   finally
end;
       capacitor :=part_iterator.getnextitem;
   end
   shomessage ("total capacitance " + float2str(total_capacitance.)


note : the above script is very rudementary as it does not contain code to let you pick the net. it may contain typo's as it has not been run. but you get the idea ...
« Last Edit: June 09, 2017, 04:45:52 am by free_electron »
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 6987
  • Country: ca
You can't add the capacitance values alone, you must include the +% tolerance. That's what the certification bodies do.

I have done IEC 60079-11 hazloc designs. I add up capacitance manually, per voltage category (gas group) and then tack on the extra tolerance.

 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21684
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Also, FWIW, XSPICE (which Altium's simulation is based on) can calculate the total capacitance on a node.  Often, this is a completely useless function (it doesn't calculate actual C equivalent, from circuit behavior / parameters), but it does at least tell you how much capacitance is attached to a node (so, real capacitors to GND/VCC, and digital logic gate input pin capacitances).  Which is exactly what you're asking for. :)

Note that, to perform this test, you need capacitances connected to the node of interest, and no direct voltage sources (which would short out the capacitances!).  So, not just capacitors, but capacitance models inside the capacitors.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline ManCaveTopic starter

  • Regular Contributor
  • *
  • Posts: 90
You can't add the capacitance values alone, you must include the +% tolerance. That's what the certification bodies do.

I have done IEC 60079-11 hazloc designs. I add up capacitance manually, per voltage category (gas group) and then tack on the extra tolerance.

Indeed. I've just made a BOM template which does it all. Not ideal, but best that can be done I guess. It takes capacitance vlaue, converts to uF, adds tolerance capacitance and then sums up all caps in the schematic which are marked as "Fitted" in the particular variant.
 

Offline ManCaveTopic starter

  • Regular Contributor
  • *
  • Posts: 90
in your schematic symbols : add two parameters. one called group and one called capacitance or value or whatever (value is numerical only ! without suffixes. and 1uf based. so 1 pf is written as 0.000001) to all the capacitors ( ideally you do that in the library )


note : the above script is very rudementary as it does not contain code to let you pick the net. it may contain typo's as it has not been run. but you get the idea ...

Thanks free_electron! Unfortunately this still is more labour intensive than I was hoping for (if I interpret it correctly). Going around probing nets for sum of capacitance is a time saving as opposed to counting individual caps, but might be more error prone as if you accidentally probe same net which is visually discontinuous on the same schematic you get incorrect value. Also if you forget to probe one net... I prefer fully automated solution which shows all caps and always uses same algorithm to count them.

Thank you for the script though! I've learned something :)
 

Offline MagicSmoker

  • Super Contributor
  • ***
  • Posts: 1408
  • Country: us
I don't use Altium Designer so take this with a grain of salt, but the approach I would consider is to write a script to find all of the capacitors on a particular net. Or add two fields to the BOM export script for the nets each component attaches, etc.

Sure you'll still have to manually add up the capacitance if common multiplier suffixes are used (p, n, u, etc.) but for the most part you can just ignore everything but the u (micro) and m (milli) suffixed values.

 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
in your schematic symbols : add two parameters. one called group and one called capacitance or value or whatever (value is numerical only ! without suffixes. and 1uf based. so 1 pf is written as 0.000001) to all the capacitors ( ideally you do that in the library )


note : the above script is very rudementary as it does not contain code to let you pick the net. it may contain typo's as it has not been run. but you get the idea ...

Thanks free_electron! Unfortunately this still is more labour intensive than I was hoping for (if I interpret it correctly). Going around probing nets for sum of capacitance is a time saving as opposed to counting individual caps, but might be more error prone as if you accidentally probe same net which is visually discontinuous on the same schematic you get incorrect value. Also if you forget to probe one net... I prefer fully automated solution which shows all caps and always uses same algorithm to count them.

Thank you for the script though! I've learned something :)
my script doesn't care how a net is drawn. i only use the 'click' to retrieve the netname of interest. then i walk over all capacitors in every page of the entire project and find anything hanging off that net. so it is fully automated.

feed the netname of interest and the script collects the capacitors. i could even present you with a visual list of the parts . if your symbols contain the value and the tolerance i can extract that too.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline ManCaveTopic starter

  • Regular Contributor
  • *
  • Posts: 90
in your schematic symbols : add two parameters. one called group and one called capacitance or value or whatever (value is numerical only ! without suffixes. and 1uf based. so 1 pf is written as 0.000001) to all the capacitors ( ideally you do that in the library )


note : the above script is very rudementary as it does not contain code to let you pick the net. it may contain typo's as it has not been run. but you get the idea ...

Thanks free_electron! Unfortunately this still is more labour intensive than I was hoping for (if I interpret it correctly). Going around probing nets for sum of capacitance is a time saving as opposed to counting individual caps, but might be more error prone as if you accidentally probe same net which is visually discontinuous on the same schematic you get incorrect value. Also if you forget to probe one net... I prefer fully automated solution which shows all caps and always uses same algorithm to count them.

Thank you for the script though! I've learned something :)
my script doesn't care how a net is drawn. i only use the 'click' to retrieve the netname of interest. then i walk over all capacitors in every page of the entire project and find anything hanging off that net. so it is fully automated.

feed the netname of interest and the script collects the capacitors. i could even present you with a visual list of the parts . if your symbols contain the value and the tolerance i can extract that too.

...I understand that it is automated for a net on all pages, but it still means I need to go around clicking on each net of interest, right? And this is where a human error could happen.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf