[Arya Raychaudhuri's one-man enterprise that believes in Always Move Ahead with New Ideas]
"home" , "code snippets", "via check add paper" "backpage" buttons on the left side, to select a specific page
[Norton Security Seal is now discontinued by Yahoo for Site Solution based websites, but moved from http to https]
the pages are best viewed through internet explorer
WordPress
BLOG PAGE: http://lvs-debug-solutions.com/blog/
[kept inactive to avoid spam]
This is the age of search engines - quickly search for entities and their inter-relationships. And, LVS Debug is all about analyzing netlists and gds/oasis layout databases, and finding their correspondences/matches/mismatches in the post-PD domain. So, much of the codes presented in the 'code snippets' page focus on searching and parsing these huge netlist and layout files, to extract the relevant information and their connection. The other important thing is the focus on revenue/jobs generating creative ideas - because if you cannot come up with new product ideas every now and then, what will you sell tomorrow, in the future? I have now transformed LVS DEBUG SOLUTIONS LLC into a multi-engineering concepts platform (please review the code snippets* pages under https://www.lvs-debug-solutions.com)
google email: arya.raychaudhuri@gmail.com
Please direct all official communications to
arya@lvs-debug-solutions.com, or call 408-480-1936
I typically don't answer calls from unknown callers, to avoid spam. If you are a serious caller, please leave voice or text message, or email...For text message from international locations, please use cellphone number as 1-408-480-1936
LVS DEBUG SOLUTIONS LLC
980 Kiely Blvd, Unit 308
Santa Clara, CA 95051
United States
ph: 1-408-480-1936
arya
** all the coding/graphing/plotting work in Item#s497-514 done with a dual boot Linux mint 20.1 running on a Dell E6420 using Intel i5 processor, some codes (e.g., pathFind_allGraphs_splC.sh, pathFind_allGraphs.sh ) tested in a very limited way on an old Linux Meego (Asus) mini laptop,
Item#s 497 through 514 serve to establish recursive and non-recursive shell based parsing of hashable data structures as a workable discipline.
Item#514> A Moving YoYo trace of the depth of recursion as the transcript moves - a more dynamic depiction than the plots of Item#505
A snapshot of the moving transcript is shown below
[Dec 12, 2021, Arya Raychaudhuri, Santa Clara, California]
The moving transcript with the YoYo can be obtained by turning the terminal by 90 degrees to the right using the command "xrandr -o right" ( "xrandr -o normal" brings it back to regular), and running a varirant (with a few edits) of a path finder routine, e.g., spice_to_edges_splC.sh of Item#513. If we call the variant xxx.sh then the edits can be seen as,
diff xxx.sh pathFind_allGraphs_splC.sh -->
32,33c32
< let DepthRec=$DepthRec+1; let jj=$jj+1; #entering the recursive function, incrementing the depth of recursion by 1
< echo $jj $DepthRec|awk '{printf "\n"; printf $1 "\t\tDepthRec=" $2 "\t\t"; for(iit=0; iit<=$2-2; iit=iit+1) printf "o"; printf "@"}'
---
> let DepthRec=$DepthRec+1; let jj=$jj+1; echo $jj " DepthRec=" $DepthRec #entering the recursive function, incrementing the depth of recursion by 1
47,48c46,47
< let ii=$ii+1;
< echo $ii|awk '{printf "---->" $1}'
---
> let ii=$ii+1; echo " "$ii
>
52,53c51
< let DepthRec=$DepthRec-1; let jj=$jj+1; ## reducing the depth of recursion
< echo $jj $DepthRec|awk '{printf "\n"; printf $1 "\t\tDepthRec=" $2 "\t\t"; for(iit=0; iit<=$2-2; iit=iit+1) printf "o"; if($2 !=0) printf "@"}'
---
> let DepthRec=$DepthRec-1; let jj=$jj+1; echo $jj " DepthRec=" $DepthRec ## reducing the depth of recursion
194,195c192
< let DepthRec=0;
< echo $jj $DepthRec|awk '{printf $1 "\t\tDepthRec=" $2; for(iit=0; iit<=$2-1; iit=iit+1) printf "@"; printf "\n"}'
---
> let DepthRec=0; echo $jj " DepthRec=" $DepthRec
206c203
< echo "###################" |awk '{printf "\n"; print $1}'
---
> echo "###################"
[ run command used: ./xxx.sh ../graph_path_rec/path_list.txt C U|tee transcript_yoyo ]
Turning the terminal left ("xrandr -o left") instead of right would show a moving mountain range. The numbered paths are always found on a peak - in this case, 211 peaks are taken. In any situation, increasing the ratio of "taken" to "untaken" would improve the efficiency (speed) of the algorithm.
***
Item#513> Making the codes used in Item#512 deal with special chracters - [ ] , <> , ( ) , { } , % , #, . , : , - , _
Below is an edited version of the netlist 'test3.net' used earlier in Item#502, 512. The subckt and isnstance names are edited to include the special characters. Not all of them typically appear in netlists though!
cat test3ed.net -->
.subckt toplevel[1] AA BB CC
X_1 AA BB mysub-1#
X4. BB AA mysub-1#
X(2) CC BB mysub[2]
X%3% AA BB mysub.3%
.ends
.subckt mysub-1# JJ KK
x<4> PP mysub[2]
.ends
.subckt mysub[2] LL GG
DD LL YY diode_model
DX YY LL diode_model
M1 1 LL GG GG NMOS L=0.045um W=0.090um
C1 LL GG 100pF
R1 YY 1 100
.ends
.subckt mysub.3% SS TT
X1# TT mysub[2]
x2: SS mysub-1#
X%[3] SS TT mysub_#%{4}
.ends
.subckt mysub_#%{4} EE FF
R1 EE FF 10
.ends
The corresponding scripts are listed in the >>misc_algor page. They are called
edges_to_dot_splC.sh
pathFind_allGraphs_splC.sh
spice_to_edges_splC.sh
For example,
./spice_to_edges_splC.sh test3ed.net test3ed.edges
cat test3ed.edges -->
toplevel[1] mysub-1# X_1 >
toplevel[1] mysub-1# X4. >
toplevel[1] mysub[2] X(2) >
toplevel[1] mysub.3% X%3% >
mysub-1# mysub[2] x<4> >
mysub.3% mysub[2] X1# >
mysub.3% mysub-1# x2: >
mysub.3% mysub_#%{4} X%[3] >
./edges_to_dot_splC.sh test3ed.edges test3ed.dot
cat test3ed.dot -->
digraph {
rankdir=TD
node [shape=diamond]
graph [layout = dot]
size=4
ratio=0.6
"toplevel[1]" -> "mysub-1#"[style=bold, label="X_1"]
"toplevel[1]" -> "mysub-1#"[style=bold, label="X4."]
"toplevel[1]" -> "mysub[2]"[style=bold, label="X(2)"]
"toplevel[1]" -> "mysub.3%"[style=bold, label="X%"]
"mysub-1#" -> "mysub[2]"[style=bold, label="x<4>"]
"mysub.3%" -> "mysub[2]"[style=bold, label="X1#"]
"mysub.3%" -> "mysub-1#"[style=bold, label="x2:"]
"mysub.3%" -> "mysub_#%{4}"[style=bold, label="X%[3]"]
dot -Tjpg test3ed.dot -o test3ed.jpg
xview test3ed.jpg & -->
[Nov 28, 2021, Arya Raychaudhuri, Los Angeles, California]
On the pathFind side,
./pathFind_allGraphs_splC.sh test3ed.edges 'toplevel[1]' 'mysub[2]' 10
[note that single quotes are used to specify the start and end nodes]
-->
'treedone_toplevel[1]->mysub[2]_10'
cat 'treedone_toplevel[1]->mysub[2]_10' -->
0 toplevel[1] X_1 mysub-1# x<4> mysub[2]
0 toplevel[1] X(2) mysub[2]
0 toplevel[1] X%3% mysub.3% X1# mysub[2]
0 toplevel[1] X%3% mysub.3% x2: mysub-1# x<4> mysub[2]
0 toplevel[1] X4. mysub-1# x<4> mysub[2]
./pathFind_allGraphs_splC.sh test3ed.edges 'toplevel[1]' 'mysub_#%{4}' 10 -->
'treedone_toplevel[1]->mysub_#%{4}_10'
cat 'treedone_toplevel[1]->mysub_#%{4}_10' -->
0 toplevel[1] X%3% mysub.3% X%[3] mysub_#%{4}
So, the flow so far has successfully dealt with the special characters to produce the graph view of the edited netlist ('test3ed.net'), and extract the relevant paths leading from the top level subcircuit to the two leafcell subcircuits
Getting the full minimal tree:
sed -e 's?^0 ??' 'treedone_toplevel[1]->mysub[2]_10' > 'treedone_toplevel[1]'
sed -e 's?^0 ??' 'treedone_toplevel[1]->mysub_#%{4}_10' >> 'treedone_toplevel[1]'
cat 'treedone_toplevel[1]' -->
toplevel[1] X_1 mysub-1# x<4> mysub[2]
toplevel[1] X(2) mysub[2]
toplevel[1] X%3% mysub.3% X1# mysub[2]
toplevel[1] X%3% mysub.3% x2: mysub-1# x<4> mysub[2]
toplevel[1] X4. mysub-1# x<4> mysub[2]
toplevel[1] X%3% mysub.3% X%[3] mysub_#%{4}
Getting the full expanded tree:
for ll in `cat 'treedone_toplevel[1]' |sed -e 's?\s\+?\!?g'` ;do lx=`echo $ll|sed -e 's?\!? ?g'`; ww=`echo $lx|wc -w`; while [ $ww -ge 0 ] ;do echo $lx|awk '{for (i=1 ; i<="'$ww'"; i++) printf $i " "; printf "\n"}'; let ww=$ww-2;done; done|sort |uniq -->
toplevel[1]
toplevel[1] X_1 mysub-1#
toplevel[1] X_1 mysub-1# x<4> mysub[2]
toplevel[1] X(2) mysub[2]
toplevel[1] X4. mysub-1#
toplevel[1] X4. mysub-1# x<4> mysub[2]
toplevel[1] X% mysub.3%
toplevel[1] X% mysub.3% X1# mysub[2]
toplevel[1] X% mysub.3% x2: mysub-1#
toplevel[1] X% mysub.3% x2: mysub-1# x<4> mysub[2]
toplevel[1] X% mysub.3% X%[3] mysub_#%{4}
***
Item#512> An application of the mixed-multi graph in Spice Subcircuits representation, and circuit tree extraction using the shell code of Item#511
[Nov 23, 2021, Arya Raychaudhuri, Santa Clara, California]
The example spice netlist ("test3.net") shown on top left is the same as used in Item#502. It is converted to the edges table ("edge_table") using a small shell script "spice_to_edges.sh" (see listing in >>misc_algor page.
./spice_to_edges.sh test3.net edge_table
The "edge_table" is processed by the small shell script "edges_to_dot.sh" (see listing in >>misc_algor page) to produce a graphviz dot file ("edge_table.dot") shown in top right.
./edges_to_dot.sh edge_table edge_table.dot
The "edge_table.dot" file generates the mixed-multi graph view of the subcircuits on the right bottom of the above figure using commands
dot -Tjpg edge_table.dot -o edge_table.jpg
xview edge_table.jpg &
On the other hand, the "edge_table" is processed by the recursive shell "pathFind_allGraphs.sh" of Item#511 to find the paths between the "toplevel" and the two leafcells "mysub2", and "mysub4" (see bottom left and middle)
./pathFind_allGraphs.sh edge_table toplevel mysub2 10
cat treedone_toplevel_mysub2_10 -->
0 toplevel X1 mysub1 X4 mysub2
0 toplevel X2 mysub2
0 toplevel X3 mysub3 X1 mysub2
0 toplevel X3 mysub3 X2 mysub1 X4 mysub2
0 toplevel X4 mysub1 X4 mysub2
./pathFind_allGraphs.sh edge_table toplevel mysub4 10
cat treedone_toplevel_mysub4_10 -->
0 toplevel X3 mysub3 X3 mysub4
These are minimal trees that can be concatenated after removing the leading 0s on each line to get the complete minimal tree for the "toplevel":
sed -e 's?^0 ??' treedone_toplevel_mysub2_10 > treedone_toplevel
sed -e 's?^0 ??' treedone_toplevel_mysub4_10 >> treedone_toplevel
cat treedone_toplevel -->
toplevel X1 mysub1 X4 mysub2
toplevel X2 mysub2
toplevel X3 mysub3 X1 mysub2
toplevel X3 mysub3 X2 mysub1 X4 mysub2
toplevel X4 mysub1 X4 mysub2
toplevel X3 mysub3 X3 mysub4
Now, this minimal tree can be expanded with the shell script shown in Item#500
for ll in `cat treedone_toplevel|sed -e 's?\s\+?%?g'` ;do lx=`echo $ll|sed -e 's?%? ?g'`; ww=`echo $lx|wc -w`; while [ $ww -ge 0 ] ;do echo $lx|awk '{for (i=1 ; i<="'$ww'"; i++) printf $i " "; printf "\n"}'; let ww=$ww-2;done; done|sort |uniq -->
toplevel
toplevel X1 mysub1
toplevel X1 mysub1 X4 mysub2
toplevel X2 mysub2
toplevel X3 mysub3
toplevel X3 mysub3 X1 mysub2
toplevel X3 mysub3 X2 mysub1
toplevel X3 mysub3 X2 mysub1 X4 mysub2
toplevel X3 mysub3 X3 mysub4
toplevel X4 mysub1
toplevel X4 mysub1 X4 mysub2
This happens to be the same tree extracted in Item#502 - showing the equivalence of the two algorithms.
Note that in Item#s 136, 199, we had discussed the pins and ports graph to exemplify an application of simple undirected edge graphs - because currents can flow both ways on metal lines. But, a lower level subcircuit doesn't invoke a higher level one, and one subcircuit can invoke a lower level entity multiple times on separate instances - hence a mixed-multi graph here. Also, in Item#199, a scilab routine was used to draw the graph - but, here graphviz dot program is being used.
***
Item#511> A revised algorithm that accomplishes optimal pendants reduction as motivated by the discussion of Item#510. The algorithm caters to both mixed_multi and simple graphs
The code is presented in the >>misc_algor page. The user can spectfy the pendants reduction mode as an optional 4th argument in the run command line, e.g,,
Usage: ./pathFind_allGraphs.sh <paths list file> <startNode> <endNode> <pendants_reduce_switch>
<pendants_reduce_switch> can be 0 for ==0 mode, 1 for ==1 mode, 10 for twoStage, Nothing for no filtering. The 10 (twotage) mode is the optimal reduction indicated earlier in Item#510. The mixed-multi graph is first simplified by removing all multiple edges, and all directed edges turned to undirected. The first step is to reduce this edited simple graph with the ==1 mode, and collect the nodes removed in the reduction. These filtered nodes are then subtracted from the original mixed-multi graph, and ==0 reduction is applied to the reduced mixed-multi graph.
Pictorial views of the twostage (10) filtering of the pendant nodes and edges are shown below. The filtered nodes information is extracted from a transcript while finding the paths from C to U
[Nov 21, 2021, Arya Raychaudhuri, Santa Clara, California]
Note that the nodes A, G, N, O and the "black" edges are filtered out after the 1st stage pendants reduction
[Nov 21, 2021, Arya Raychaudhuri, Santa Clara, California]
The node L and the "olive" edges D-->L and M-->L are filtered out after the 2nd stage, leaving the "red" graph to be processed by the path find algorithm.
The algorithm also works with simple (no multiple edges between vertices, no directed edges) graphs such as the ones used in Item#s 504, 506 etc.; one can use no pendants reduce switch, or 1; mode 10 should work like mode 1, while mode 0 will reduce nothing.
***
Item#510> Pendants reduction related information as obtained from the transcripts of the recursive pathFinder runs - with respect to the test case created in Item#509
Case 1. pendants reduction section of the pathFind_rec_mm.sh (Item#508) is suppressed
No. of nodes reduced - None
tail -5 transcript_CU -->
430 DepthRec= 0
###################
end path find
Tue 16 Nov 2021 02:05:53 PM PST
strt_time was 02:05:48
pathFind run time 5s, No. of recursive routine entry/exit events 430
Case 2. Iteratively filter out only non start/end nodes with 0 outgoing edges ( if [[ `wc -l ./hashFiles/$ff|awk '{print $1}'` == 0 && ($ff != $startNode && $ff != $endNode) ]] )
grep -B 1 YES transcript_CU_0|grep -v YES|grep -v '\-\-'|sed -e 's?#??g' -->
N
L
No. of nodes reduced - 2 : N, L
The reduced graph in "red" is superimposed (see script in >>misc_algor page) on the original graph ("black"), as seen below. Note the sub-optimal pendants removal.
[Nov 16, 2021, Arya Raychaudhuri, Santa Clara, California]
tail -5 transcript_CU_0
354 DepthRec= 0
###################
end path find
Tue 16 Nov 2021 02:02:41 PM PST
strt_time was 02:02:36
pathFind run time 5s, No. of recursive routine entry/exit events 354
Case 3. Iteratively filter out only non start/end nodes with 1 outgoing edges ( if [[ `wc -l ./hashFiles/$ff|awk '{print $1}'` == 1 && ($ff != $startNode && $ff != $endNode) ]] )
grep -B 1 YES transcript_CU_1|grep -v YES|grep -v '\-\-'|sed -e 's?#??g' -->
A
G
J
L
O
T
No. of nodes reduced - 6 : A, G, J. L, O, T
The reduced graph in "red" is superimposed (see script in >>misc_algor page) on the original graph ("black"), as seen below. Pendants removal more aggressive, but, goes on an overdrive when it removes "J" for example - producing errors in the final results.
[Nov 16, 2021, Arya Raychaudhuri, Santa Clara, California]
tail -5 transcript_CU_1
146 DepthRec= 0
###################
end path find
Tue 16 Nov 2021 02:00:40 PM PST
strt_time was 02:00:38
pathFind run time 2s, No. of recursive routine entry/exit events 146
(Note the significant impact of the pendants removal on the run time, and the number of recursion events)
A careful reader will appreciate the algorithm's play towards graph reduction in the last two cases. Now, a revised algorithm will try to make an optimal reduction without producing errors in the final results.
***
Item#509> Creating a mixed-multi graph test case to explore the removal of pendant vertices as mentioned in the context of a bugfix in Item#508
The edges table used for this case is derived (edited from) from the original graph used in Item#s 122, 123, 503, etc. and is listed on the >>misc_algor page. The graph (below) is drawn with graphviz version 2.43.0 that takes the "dot" format input files. The format conversion bash script, and the "dot" format file are also listed on the >>misc_algor page
[Nov 15, 2021, Arya Raychaudhuri, Santa Clara, California]
Note the directed edges and the multiple edges between some nodes. This graph is used as a test case for checking on the pendants reduction.
If the pendants reduction section of the pathFind_rec_mm.sh (Item#508) is suppressed or if
if [[ `wc -l ./hashFiles/$ff|awk '{print $1}'` == 0 && ($ff != $startNode && $ff != $endNode) ]]
[it means find out non start/end nodes that have 0 edges outgoing]
is used, we get exactly the same 10 paths extracted from C to U:
11 C 4 D 1 K 1 M 1 P 2 Q 2 U
13 C 4 D 1 K 1 M 1 R 1 S 1 P 2 Q 2 U
14 C 4 D 1 E 1 J 1 V 3 P 2 Q 2 U
14 C 4 D 1 E 2 H 2 I 3 Q 2 U
14 C 4 D 1 K 2 V 3 P 2 Q 2 U
15 C 4 D 1 E 1 J 1 V 2 K 1 M 1 P 2 Q 2 U
17 C 4 D 1 E 1 J 1 V 2 K 1 M 1 R 1 S 1 P 2 Q 2 U
17 C 4 D 1 E 2 H 2 I 1 V 3 P 2 Q 2 U
18 C 4 D 1 E 2 H 2 I 1 V 2 K 1 M 1 P 2 Q 2 U
20 C 4 D 1 E 2 H 2 I 1 V 2 K 1 M 1 R 1 S 1 P 2 Q 2 U
[Note the remarkable reduction in the number of paths from 211 to 10 as we introduce some directed edges]
But, if we use,
if [[ `wc -l ./hashFiles/$ff|awk '{print $1}'` == 1 && ($ff != $startNode && $ff != $endNode) ]]
[it means find out non start/end nodes that have exactly 1 edge outgoing]
We get only 7 paths
11 C 4 D 1 K 1 M 1 P 2 Q 2 U
13 C 4 D 1 K 1 M 1 R 1 S 1 P 2 Q 2 U
14 C 4 D 1 E 2 H 2 I 3 Q 2 U
14 C 4 D 1 K 2 V 3 P 2 Q 2 U
17 C 4 D 1 E 2 H 2 I 1 V 3 P 2 Q 2 U
18 C 4 D 1 E 2 H 2 I 1 V 2 K 1 M 1 P 2 Q 2 U
20 C 4 D 1 E 2 H 2 I 1 V 2 K 1 M 1 R 1 S 1 P 2 Q 2 U
This means that the pendants reduction as applied to the simple graphs earlier (Item#506) undesirably disconnects some nodes - we will look at the situations more closely in the next Item.
***
Item#508> A treatment for mixed (a combination of directed and undirected edges) multi (including the possibility of multiple edges between some/all pairs of vertices) graphs, through a variation of the code of Item#506 ...
[Nov 10, 2021, Arya Raychaudhuri, Santa Clara, California]
Note that I have added a directed edge e2 between "home" and "market", this makes the earlier graph shown in Item#504 a mixed multi graph. There could be more pairs of vertices with multiple edges connecting them, and more directed/undirected edges; if the code works for the above graph, it will work for them as well. Also, since the edge length is just a property of the edge, I have replaced the numerical values with variables e1, e2, e3, etc. to make it more general, and catering to graphs coming from various other fields, and not just traffic routes.
For the directed edge, I am following a format of adding the symbol ">" at the end of the edge entry in the edges table, as shown on the right of the above figure. Also, for a directed edge, the ordering of the nodes defining the edge is important - the edge happens from the first node towards the second node, in this case, from "home" towards the "market". For the undirected edges, the ordering is unimportant - the edge will translate to the hash files of both the first and the second node.
The edges table in this case is manually configured from looking at the graph, but, typically, one can write a script to create it from the context where the graph is being applied to model a network. For example, a graph of subcircuit names coming from the context of a spice netlist.
The edited code pathFind_rec_mm.sh is listed on the >>misc_algor page
The alterations with respect to the earlier code for Item#506 are marked in blue (add code) and red (remove code). Note that it's mainly the hasher that needs to be edited - a feature of segmenting the problem into making the hash files, and path finding.
Since a directed edge has been added, now we find more paths going from "home" to "factory", than from "factory" to "home" - see below.
./pathFind_rec_mm.sh path_list_nanej home factory
cat treedone -->
0 home e1 doctors e1 school e2 factory
0 home e1 doctors e2 market e1 police e1 school e2 factory
0 home e1 market e1 police e1 school e2 factory
0 home e1 market e2 doctors e1 school e2 factory
0 home e2 market e1 police e1 school e2 factory
0 home e2 market e2 doctors e1 school e2 factory
0 home e3 school e2 factory
./pathFind_rec_mm.sh path_list_nanej factory home
cat treedone -->
0 factory e2 school e1 doctors e1 home
0 factory e2 school e1 doctors e2 market e1 home
0 factory e2 school e1 police e1 market e1 home
0 factory e2 school e1 police e1 market e2 doctors e1 home
0 factory e2 school e3 home
Since, variables (e1, e2, e3, etc) have replaced numbers (1, 2, 3) the total path lengths have been computed as 0s (the first element of each path line, above).
** A bugfix coming up soon - the bugfix will involve editing the pendants removal (graph reduction) portion of the path find section, and moving it into the hasher section. At this point, the "== 0" in the line
if [[ `wc -l ./hashFiles/$ff|awk '{print $1}'` == 0 && ($ff != $startNode && $ff != $endNode) ]]
gives sub-optimal reduction for mixed-multi graphs. While the "== 1" used for simple graphs earlier (e.g., Item#506), if used here for mixed-multi graphs, would give rise to over-reduction (inaccurate results) in some cases. Sub-optimal is better than inaccurate results - so, sticking with "== 0" in this Item.
***
Item#507> The shortest and the longest paths out of the 211 paths extracted in Item#506
The shortest (path length 9 units) and the longest (path length 27 units) paths are indicated on the graph
[Nov 4, 2021, Arya Raychaudhuri, Santa Clara, California]
All of the 211 paths from C to U are listed in the >>misc_algor page
***
Item#506> Speed improvement for the recursive shell code of Item#504
[Repeated from Item#122]
Sun 31 Oct 2021 01:12:47 PM PDT
Sun 31 Oct 2021 01:15:20 PM PDT
### nonRec C U --> 2m 33s (Item#503)
Sun 31 Oct 2021 01:18:32 PM PDT
Sun 31 Oct 2021 01:21:42 PM PDT
#### Recursive C U --> 3m 10s (Item#504)
Mon 01 Nov 2021 08:55:20 PM PDT
Mon 01 Nov 2021 08:56:37 PM PDT
### Recursive with edits C U --> 1m 17s (Item#506)
The edited code (pathFind_rec_ed.sh) is shown in the >>misc_algor page
The edits target the run time in two ways:
1. Iteratively removes the non-relevant pendant nodes from the hashFiles, in order to reduce the recursion (entry/exit) events. For example, with the above graph, nodes A, G, N, O got removed - that reduced the entry exit events from 7234 to 5860
./pathFind_rec_ed.sh path_list.txt C U|tee transcript_CU
grep DepthRec= transcript_CU|wc -l
5861
2. Making the looping vertices check outside the for...do loop in the pathRec_func, reducing the number of candidates for the for...do loop
***
Item#505> Depth of Recursion plot from the transcript (see >>misc_algor page) of the code of Item#504
Note that for the run of the code to find paths between "home" and "factory" there are 55 data points for the depth of recursion (DofR) - meaning 27 entries and 27 exits to the recursive function, pathRec_func. The 5 paths extracted are indicated with red circles on the plot:
[Oct 29, 2021, Arya Raychaudhuri, Santa Clara, California]
The DofR going up means successive entries into the recursive function, while the DofR going down indicates exits. The up and down nature of the plot is an indicator of the recursive search process.
** The plot is made with gnuplot-x11 for Linux Mint 20.1 Cinnamon
The shell code used for parsing the transcript to create the .dat file for gnuplot, and the gnuplot script to make the above plot is given in the >>misc_algor page
As mentioned at the bottom of Item#504, the 211 paths between C,U of the larger graph of Item# 122 were also plotted in a similar way:
[Oct 31, 2021, Arya Raychaudhuri, Santa Clara, California]
Note that there are 7235 DepthRec points in this case, meaning that the entries and the exits to the recursive function are made (7235-1)/2 or 3617 times each.
***
Item#504> Another Recursive Shell program - A recursive bash implementation of the graph paths finding problem of Item#s 122, 123, .....
The recursive bash (pathFind_rec.sh) is listed in the >>misc_algor page
This time we use a smaller graph to look at the code's run more closely. The graph example is taken from the Wikipedia:
https://en.wikipedia.org/wiki/Graph_theory
[**Note the vast application spaces for the vertex edge Graphs]
I have renamed the nodes to more realistic town spots, and added a "flyover" edge between nodes 1 and 4
[Oct 27, 2021, Arya Raychaudhuri, Santa Clara, California]
Now, if I want to find the paths between "home" and "factory", for example, I simply need to first make the code executable:
chmod 755 pathFind_rec.sh
and then run with the path_list shown on the right of the above graph:
./pathFind_rec.sh path_list home factory
to get all the paths written out to file "treedone" -->
4 home 1 doctors 1 school 2 factory
5 home 1 market 1 police 1 school 2 factory
5 home 3 school 2 factory
6 home 1 market 2 doctors 1 school 2 factory
7 home 1 doctors 2 market 1 police 1 school 2 factory
[Oct 27, 2021, Arya Raychaudhuri, Santa Clara, California]
As is seen, the paths listed out are sorted by the path lengths (the first number in each line) - the shortest appearing at the top. Once you have "treedone" files for multiple pairs of nodes, you can easily query them for paths with various properties. For example, what are the paths between the "home" and the "factory" that go/don't go via the "market", etc. Note that you can't avoid the "school" to get to the "factory".
The Depth of Recursion also gets reported as the code runs. Note how the flow gets deeper and shallower, and ultimately goes to 0 - as expected. The n of the nth successful pathfind is reported with a higher indentation in the transcript.
You can verify that this recursive code gives exactly the same 211 paths as the nonRecursive code of Item#503, if one uses the same path list file (graph) and the same pair of the starting, ending nodes (C, U).
***
Item#503> A non-recursive bash implementation of the graph paths finding problem of Item#s 122, 123, .....
This algorithm is a variant of the non-recursive tree extraction code of Item#501. The code (graphPaths.sh) listed in the >>misc_algor page, first generates the hash files from a graph paths list file, and then computes all the unique paths (with at least one vertex uncommon), sorts the paths by the path lengths - the shortest at the top and the longest at the bottom. The final paths result is saved in file "treedone"
As an example, the same graph as in Item#122 can be used.So, the path_list.txt file lists as shown in >>misc_algor page
We can run the graphPaths.sh as:
chmod 755 graphPaths.sh
./graphPaths.sh <paths list file> <startNode> <endNode>
We had earlier got 211 paths from C to U (Item#123).
./graphPaths.sh path_list.txt C U
will also generate 211 uniq paths in treedone --->
cp treedone treedone_CU
sort treedone_CU|uniq|wc -l
211
Reversing the node order to U C will give the same 211 uniq paths in the opposite sense (also, see Item#125) -->
./graphPaths.sh path_list.txt U C
cp treedone treedone_UC
sort treedone_UC |uniq|wc -l
211
Compare the paths after reversing the sense:
cat treedone_CU |awk '{printf $1 ; for(i=NF; i>1 ; i=i-1) printf " " $i; printf "\n"}' > treedone_CU_to_UC
sort treedone_UC > treedone_UC_sorted
sort treedone_CU_to_UC >treedone_CU_to_UC_sorted
diff treedone_UC_sorted treedone_CU_to_UC_sorted
--> NULL
This means that exactly the same paths are being traversed in the C to U direction, and in the U to C direction - as intended for the code to find.
The code uses "%", "#", "_" for padding, delimiter, etc. - these special characters should not be used in naming the vertices.
***
Item#502> A recursive bash variant of the non-recursive tree parser of Item#501
The listing of the recursive shell code "treeRec.sh" is given on the >>misc_algor page
Note that the hasher part is identical with respect to the non-recursive code (treeparse.sh) of Item#501
The code was run with a command:
chmod 755 treeRec.sh
./treeRec.sh test3.net toplevel
Where the example test3.net used is here:
.subckt toplevel AA BB CC
X1 AA BB mysub1
X4 BB AA mysub1
X2 CC BB mysub2
X3 AA BB mysub3
.ends
.subckt mysub1 JJ KK
X4 PP mysub2
.ends
.subckt mysub2 LL GG
DD LL YY diode_model
DX YY LL diode_model
M1 1 LL GG GG NMOS L=0.045um W=0.090um
C1 LL GG 100pF
R1 YY 1 100
.ends
.subckt mysub3 SS TT
X1 TT mysub2
X2 SS mysub1
X3 SS TT mysub4
.ends
.subckt mysub4 EE FF
R1 EE FF 10
.ends
The corresponding tree extracted in the 'treedone' file :
toplevel
toplevel X1 mysub1
toplevel X1 mysub1 X4 mysub2
toplevel X2 mysub2
toplevel X3 mysub3
toplevel X3 mysub3 X1 mysub2
toplevel X3 mysub3 X2 mysub1
toplevel X3 mysub3 X2 mysub1 X4 mysub2
toplevel X3 mysub3 X3 mysub4
toplevel X4 mysub1
toplevel X4 mysub1 X4 mysub2
***
Item#501> A non-recursive bash based tree parser that can be used to verify the full netlist trees extracted with the recursive approach as in Item#s 496-500
The example netlist (test2.net) used:
.subckt toplevel AA BB CC
X1 AA BB mysub1
X4 BB AA mysub1
X2 CC BB mysub2
.ends
.subckt mysub1 JJ KK
X4 PP mysub2
.ends
.subckt mysub2 LL GG
DD LL YY diode_model
DX YY LL diode_model
M1 1 LL GG GG NMOS L=0.045um W=0.090um
C1 LL GG 100pF
R1 YY 1 100
.ends
The listing of the non-recursive shell code "treeparse.sh" is given on the >>misc_algor page
The command used to run the tree parser:
chmod 755 treeparse.sh
./treeparse.sh test2.net toplevel
Note that the first part of the routine creates the hash files (like perl hashes) for the subckt names. Each file then contains the key, value pairs in each line - the key is an instance name, the value is the corresponding subckt ihe instance refers to.
In this small example, therefore, three hash files are generated in a hashFiles subdirectory:
toplevel -->
X1 mysub1
X4 mysub1
X2 mysub2
mysub1 -->
X4 mysub2
mysub2 -->
[Note that the hashing ignores the basic devices (^R, ^M, ^C, ^D, etc), only ^X instances are considered]
The resulting tree is saved in a file called 'treedone' :
toplevel
toplevel X1 mysub1
toplevel X1 mysub1 X4 mysub2
toplevel X2 mysub2
toplevel X4 mysub1
toplevel X4 mysub1 X4 mysub2
If the instances are not needed,
cat treedone |awk '{for(i=1; i<=NF; i=i+2) printf $i " "; printf "\n"}'|sort|uniq
toplevel
toplevel mysub1
toplevel mysub1 mysub2
toplevel mysub2
Note that the routine also checks for the invalid entries, and computes the runtimes. The top subckt specified need not be the absolute top level, it can be any lower level subckt. But, the hashing will be done for the entire netlist. Thus, one can appropriately edit the hashes and the code (to bypass repeated hashings) to let the parsing happen on segments of the netlist, parallelly, and then stitch the resulting tree segments to get the full tree. This can be useful in dealing with extremely long netlists. The method in its current form doesn't consider net propagation.
** I had used the basic concept of a non-recursive parser earlier in a code that I wrote for Jasper Display Corp in 2019. The current version contains important simplifying edits that make the parser run faster, incorporate instance names
***
Item#500> Expanding a minimal subTree/Tree into a regular looking incremental subTree/Tree - using an example of a subTree impacted by top net 'ctlout4lr' in the netlist of Item#499
top net 'ctlout4lr' impacted subTree:(minimal)
grep ctlout4lr bidirShift.dev.net > bidirShift.ctlout4lr.net
cat bidirShift.ctlout4lr.net | awk '{print $1}'|sed -e 's/(/ /g' |sed -e 's/)/ /g'|sed -e 's/_/ /g'|awk '{for(i=4; i<=NF; i=i+2) printf $i " " $(i-1) " " ; printf $2 "\n"}'|sort|uniq -->
bidirShift Xbit4 shiftstage XNANDLR NAND3shift
bidirShift Xbit4 shiftstage XRSLX RSLX XNAND2 NAND4shift
bidirShift Xbit5 shiftstage XRSLX RSLX XNAND1 NAND4shift
SubTree Expand:
Let's put the above minimal subTree into bidirShift.ctlout4lr.subtree, and then,
for ll in `cat bidirShift.ctlout4lr.subtree|sed -e 's?\s\+?%?g'` ;do lx=`echo $ll|sed -e 's?%? ?g'`; ww=`echo $lx|wc -w`; while [ $ww -ge 0 ] ;do echo $lx|awk '{for (i=1 ; i<="'$ww'"; i++) printf $i " "; printf "\n"}'; let ww=$ww-2;done; done|sort |uniq
-->
bidirShift
bidirShift Xbit4 shiftstage
bidirShift Xbit4 shiftstage XNANDLR NAND3shift
bidirShift Xbit4 shiftstage XRSLX RSLX
bidirShift Xbit4 shiftstage XRSLX RSLX XNAND2 NAND4shift
bidirShift Xbit5 shiftstage
bidirShift Xbit5 shiftstage XRSLX RSLX
bidirShift Xbit5 shiftstage XRSLX RSLX XNAND1 NAND4shift
We got the expanded subTree for net ctlout4lr .... Note that each line of the expanded subTree no longer ends in a leafcell containing basic components (mosfet, diode, caps, resistors, etc). The Tree builds on incremental stages step by step.
------------------------------------------------------------------------------
The above was just one way to get the expanded Tree or subTree from the minimal, using the recursive shell approach. The other way is indicated by the example chosen for the Item# 498 - where the minimal Tree and the expanded Tree are the same. This is because each subckt contains one or more basic components. So, one can add one dummy basic component using an edited fltnr2.sh to each separated subcircuit (@subcktname@), and then apply the recursive shell approach to directly get the expanded Tree, w/o post-processing of a minimal Tree. Later the dummy devices can be grepped out of the flattened netlist.
***
Item#499> SubTree impacted by the propagation of a top level net - extracted using the recursive shell of Item#497
In this case, I take the example circuit from Item#260 - bidirectional clk-to-q shift register
.SUBCKT NAND4shift in1 in2 in3 in4 out vdd vss
MN1 out in1 midx vss NMOS L=0.09um W=0.045um
MN2 midx in2 midx2 vss NMOS L=0.09um W=0.045um
MN3 midx2 in3 midx3 vss NMOS L=0.09um W=0.045um
MN4 midx3 in4 vss vss NMOS L=0.09um W=0.045um
MP1 out in1 vdd vdd PMOS L=0.09um W=0.09um
MP2 out in2 vdd vdd PMOS L=0.09um W=0.09um
MP3 out in3 vdd vdd PMOS L=0.09um W=0.09um
MP4 out in4 vdd vdd PMOS L=0.09um W=0.09um
.ENDS
.SUBCKT NAND3shift in1 in2 in3 out vdd vss
MN1 out in1 midx vss NMOS L=0.09um W=0.045um
MN2 midx in2 midx2 vss NMOS L=0.09um W=0.045um
MN3 midx2 in3 vss vss NMOS L=0.09um W=0.045um
MP1 out in1 vdd vdd PMOS L=0.09um W=0.09um
MP2 out in2 vdd vdd PMOS L=0.09um W=0.09um
MP3 out in3 vdd vdd PMOS L=0.09um W=0.09um
.ENDS
.SUBCKT RSLX in1t in2t in3t in1b in2b in3b out outbar vdd vss
XNAND1 in1t in2t in3t outbar out vdd vss NAND4shift
XNAND2 in1b in2b in3b out outbar vdd vss NAND4shift
.ENDS
.SUBCKT shiftstage pulsein din setdlr setdrl resetdlr resetdrl sysreset LR RL qd qdbar ctloutlr ctloutrl vdd vss
XNANDLR qd pulsein LR ctloutlr vdd vss NAND3shift
XNANDRL qd pulsein RL ctloutrl vdd vss NAND3shift
XRSLX setdlr setdrl din resetdlr resetdrl sysreset qd qdbar vdd vss RSLX
.ENDS
.SUBCKT bidirShift
Xbit0 pulsein1 p0 vdd ctlout1rl ctlout0lr ctlout0rl sysreset LR RL qq0 qq0bar ctlout0lr ctlout0rl vdd vss shiftstage
Xbit1 pulsein1 p1 ctlout0lr ctlout2rl ctlout1lr ctlout1rl sysreset LR RL qq1 qq1bar ctlout1lr ctlout1rl vdd vss shiftstage
Xbit2 pulsein1 p2 ctlout1lr ctlout3rl ctlout2lr ctlout2rl sysreset LR RL qq2 qq2bar ctlout2lr ctlout2rl vdd vss shiftstage
Xbit3 pulsein1 p3 ctlout2lr ctlout4rl ctlout3lr ctlout3rl sysreset LR RL qq3 qq3bar ctlout3lr ctlout3rl vdd vss shiftstage
Xbit4 pulsein1 p4 ctlout3lr ctlout5rl ctlout4lr ctlout4rl sysreset LR RL qq4 qq4bar ctlout4lr ctlout4rl vdd vss shiftstage
Xbit5 pulsein1 p5 ctlout4lr ctlout6rl ctlout5lr ctlout5rl sysreset LR RL qq5 qq5bar ctlout5lr ctlout5rl vdd vss shiftstage
Xbit6 pulsein1 p6 ctlout5lr ctlout7rl ctlout6lr ctlout6rl sysreset LR RL qq6 qq6bar ctlout6lr ctlout6rl vdd vss shiftstage
Xbit7 pulsein1 p7 ctlout6lr ctlout8rl ctlout7lr ctlout7rl sysreset LR RL qq7 qq7bar ctlout7lr ctlout7rl vdd vss shiftstage
Xbit8 pulsein1 p8 ctlout7lr ctlout9rl ctlout8lr ctlout8rl sysreset LR RL qq8 qq8bar ctlout8lr ctlout8rl vdd vss shiftstage
Xbit9 pulsein1 p9 ctlout8lr vdd ctlout9lr ctlout9rl sysreset LR RL qq9 qq9bar ctlout9lr ctlout9rl vdd vss shiftstage
.ENDS
[Note that the '_' character removed to avoid later conflict with instance separators. Also, the top level portion of the netlist has been encapsulated between a .SUBCKT bidirShift and a .ENDS - this is needed by the routine to work]
Again, after running
source fltnr2.sh
source flatten_func.fsh
source main_flat.sh |tee bidirShift.flat.net
We get the bidirShift.flat.net that is grepped to bidirShift.dev.net as in Item#498. This contains only 280 FETs:
grep '^M' bidirShift.dev.net|wc -l
280
140 each of nmos and pmos:
grep '^MN' bidirShift.dev.net|wc -l
140
grep '^MP' bidirShift.dev.net|wc -l
140
The full Tree (minimal) with instances can be found like
cat bidirShift.dev.net | awk '{print $1}'|sed -e 's/(/ /g' |sed -e 's/)/ /g'|sed -e 's/_/ /g'|awk '{for(i=4; i<=NF; i=i+2) printf $i " " $(i-1) " " ; printf $2 "\n"}'|sort|uniq > bidirShift.instabces.tree
The full Tree (minimal) without instances can be found like
cat bidirShift.dev.net | awk '{print $1}'|sed -e 's/(/ /g' |sed -e 's/)/ /g'|sed -e 's/_/ /g'|awk '{for(i=4; i<=NF; i=i+2) printf $i " " ; printf $2 "\n"}'|sort|uniq > bidirShift.subckts.tree
These Trees are listed in misc_algor page.
Now, let's see where a toplevel net such as sysreset propagates.
grep ' sysreset ' bidirShift.dev.net > bidirShift.sysreset.net
bidirShift.sysreset.net is listed in the misc_algor page. Looks like 20 FETs are associated with this net:
wc -l bidirShift.sysreset.net
20 bidirShift.sysreset.net
The sysreset subTree with instances is here:
cat bidirShift.sysreset.net | awk '{print $1}'|sed -e 's/(/ /g' |sed -e 's/)/ /g'|sed -e 's/_/ /g'|awk '{for(i=4; i<=NF; i=i+2) printf $i " " $(i-1) " " ; printf $2 "\n"}'|sort|uniq
-->
bidirShift Xbit0 shiftstage XRSLX RSLX XNAND2 NAND4shift
bidirShift Xbit1 shiftstage XRSLX RSLX XNAND2 NAND4shift
bidirShift Xbit2 shiftstage XRSLX RSLX XNAND2 NAND4shift
bidirShift Xbit3 shiftstage XRSLX RSLX XNAND2 NAND4shift
bidirShift Xbit4 shiftstage XRSLX RSLX XNAND2 NAND4shift
bidirShift Xbit5 shiftstage XRSLX RSLX XNAND2 NAND4shift
bidirShift Xbit6 shiftstage XRSLX RSLX XNAND2 NAND4shift
bidirShift Xbit7 shiftstage XRSLX RSLX XNAND2 NAND4shift
bidirShift Xbit8 shiftstage XRSLX RSLX XNAND2 NAND4shift
bidirShift Xbit9 shiftstage XRSLX RSLX XNAND2 NAND4shift
w/o instances (subckts only):
cat bidirShift.sysreset.net | awk '{print $1}'|sed -e 's/(/ /g' |sed -e 's/)/ /g'|sed -e 's/_/ /g'|awk '{for(i=4; i<=NF; i=i+2) printf $i " "; printf $2 "\n"}'|sort|uniq
-->
bidirShift shiftstage RSLX NAND4shift
***
Item#498> Extracting the circuit Tree from the flattened netlist test1.flt.net of Item#497, component counts
Let's first remove all the commented lines to clean up the netlist, and keep only the lines starting with the flattened devices (components). Since we have 4 component types, mosfet, diode, capacitor, resistor, let's create a small grep file (grepf) with 4 lines -->
^M
^D
^C
^R
-----------------
Now, the command
grep -f grepf -i test1.flt.net > test1.dev.net
gets us the components only netlist --> test1.dev.net
See that there are 16 components in the flattened,
wc -l test1.dev.net | awk '{print $1}' --> 16
4 mosfets: grep -i '^M' test1.dev.net | wc -l| awk '{print $1}' --> 4
7 diodes: grep -i '^D' test1.dev.net | wc -l| awk '{print $1}' --> 7
1 cap: grep -i '^C' test1.dev.net | wc -l| awk '{print $1}' --> 1
4 resistor: grep -i '^R' test1.dev.net | wc -l| awk '{print $1}' --> 4
------------------------------------------------------------------------------
Now, let's get the circuit Tree with subckt instance names:
cat test1.dev.net | cat test1.dev.net | awk '{print $1}'|sed -e 's/(/ /g' |sed -e 's/)/ /g'|sed -e 's/_/ /g'|awk '{for(i=4; i<=NF; i=i+2) printf $i " " $(i-1) " " ; printf $2 "\n"}'|sort|uniq
-->
toplevel
toplevel X1 mysub1
toplevel X1 mysub1 X4 mysub2
toplevel X2 mysub2
toplevel X4 mysub1
toplevel X4 mysub1 X4 mysub2
minimal Tree w/o subckt instance names :
cat test1.dev.net | awk '{print $1}'|sed -e 's/(/ /g' |sed -e 's/)/ /g'|sed -e 's/_/ /g'|awk '{for(i=4; i<=NF; i=i+2) printf $i " "; printf $2 "\n"}'|sort|uniq
-->
toplevel
toplevel mysub1
toplevel mysub1 mysub2
toplevel mysub2
The minimal trees extracted from the flattened netlist are somewhat different from trees extracted with other routines in that in order to qualify as a leafcell (the last element of each line) in the minimal trees, the subcircuit must contain some basic devices (components like mosfet, diode, capacitor, resistor, bipolar). No leaves no photo-synthesis! Intermediate leafcell-less branches are omitted. Of course, one can break the minimal trees to show all the branches as with other tree extractors.
** the edited version of the scripts run with a dual boot Linux mint 20.1 running on a Dell E6420 using Intel i5 processor
***
Item#497> Re-visiting the recursive shell (bash) of Item#s 70, 66 towards extracting more information about the subcircuits, components, etc. Depth of recursion movementa [See listings of codes in "misc_algor" page]
test circuit, test1.net listing :
.subckt toplevel AA BB CC
C1 BB CC 100pF
X1 AA BB mysub1
X4 BB AA mysub1
M1 AA CC BB BB NMOS L=0.045um W=0.135um
X2 CC BB mysub2
D1 CC BB diode_model
.ends
.subckt mysub1 JJ KK
R1 JJ PP 100
X4 PP mysub2
R2 PP KK 200
.ends
.subckt mysub2 LL GG
DD LL YY diode_model
DX YY LL diode_model
M1 1 LL GG GG NMOS L=0.045um W=0.090um
.ends
[Note that the X2 instance from the toplevel exercises both pins of mysub2, but, the X4 from mysub1 exercises only the first pin of mysub2, leaving the pin GG to be a net internal to mysub2]
Step 1: Run the subcircuits extractor fltnr2.sh (listing in misc_algor page) on the above test1.net to get the individual files named after the subcircuits with delimited entities, using command
source fltnr2.sh
In this case, three subcircuit files @toplevel@, @mysub1@, @mysub2@ are generated
cat @toplevel@ -->
..subckt @toplevel@ @AA@ @BB@ @CC@
@C1(toplevel)@ @BB@ @CC@ @100pF@
@X1(toplevel)@ @AA@ @BB@ @mysub1@
@X4(toplevel)@ @BB@ @AA@ @mysub1@
@M1(toplevel)@ @AA@ @CC@ @BB@ @BB@ @NMOS@ @L=0.045um@ @W=0.135um@
@X2(toplevel)@ @CC@ @BB@ @mysub2@
@D1(toplevel)@ @CC@ @BB@ @diode_model@
.ends
cat @mysub1@_or -->
.subckt @mysub1@ @JJ@ @KK@
@R1(mysub1)@ @JJ@ @PP@ @100@
@X4(mysub1)@ @PP@ @mysub2@
@R2(mysub1)@ @PP@ @KK@ @200@
.ends
cat @mysub2@ -->
.subckt @mysub2@ @LL@ @GG@
@DD(mysub2)@ @LL@ @YY@ @diode_model@
@DX(mysub2)@ @YY@ @LL@ @diode_model@
@M1(mysub2)@ @1@ @LL@ @GG@ @GG@ @NMOS@ @L=0.045um@ @W=0.090um@
.ends
[Since these are intermediate files they are deleted at the end of the task]
Step2: the recursive bash function flatten_func.fsh (listing in misc_algor page) needs to be activated within the shell, using command
source flatten_func.fsh
This makes the function flatten_func available for invocation by another routine, or by itself
Step3: Flatten the circuit using the shell routine main_flat.sh (listing in misc_algor page), using command
source main_flat.sh |tee test1.flt.net
This produces the flattened circuit test1.flt.net. Note that debug related commented (starts with **) lines can be grepped out by a user. The transcript also reports the depth of recursion (REC_DEPTH) as the function traverses the circuit hierarchy down or up ...
cat test1.flt.net -->
****REC_DEPTH= 0
****REC_DEPTH = 1
.subckt toplevel AA BB CC
C1(toplevel) BB CC 100pF
**@X1(toplevel)@ @AA@ @BB@ @mysub1@
****REC_DEPTH = 2
**.subckt mysub1 AA% BB%
R1(mysub1)_X1(toplevel) AA PP_X1(toplevel) 100
**@X4(mysub1)@_@X1(toplevel)@ @PP@_@X1(toplevel)@ @mysub2@_@X1(toplevel)@
****REC_DEPTH = 3
**.subckt mysub2 PP_X1(toplevel)% GG
DD(mysub2)_X1(toplevel)_X4(mysub1) PP_X1(toplevel) YY_X1(toplevel)_X4(mysub1) diode_model
DX(mysub2)_X1(toplevel)_X4(mysub1) YY_X1(toplevel)_X4(mysub1) PP_X1(toplevel) diode_model
M1(mysub2)_X1(toplevel)_X4(mysub1) 1_X1(toplevel)_X4(mysub1) PP_X1(toplevel) GG_X1(toplevel)_X4(mysub1) GG_X1(toplevel)_X4(mysub1) NMOS L=0.045um W=0.090um
**.ends
****REC_DEPTH = 2
R2(mysub1)_X1(toplevel) PP_X1(toplevel) BB 200
**.ends
****REC_DEPTH = 1
**@X4(toplevel)@ @BB@ @AA@ @mysub1@
****REC_DEPTH = 2
**.subckt mysub1 BB% AA%
R1(mysub1)_X4(toplevel) BB PP_X4(toplevel) 100
**@X4(mysub1)@_@X4(toplevel)@ @PP@_@X4(toplevel)@ @mysub2@_@X4(toplevel)@
****REC_DEPTH = 3
**.subckt mysub2 PP_X4(toplevel)% GG
DD(mysub2)_X4(toplevel)_X4(mysub1) PP_X4(toplevel) YY_X4(toplevel)_X4(mysub1) diode_model
DX(mysub2)_X4(toplevel)_X4(mysub1) YY_X4(toplevel)_X4(mysub1) PP_X4(toplevel) diode_model
M1(mysub2)_X4(toplevel)_X4(mysub1) 1_X4(toplevel)_X4(mysub1) PP_X4(toplevel) GG_X4(toplevel)_X4(mysub1) GG_X4(toplevel)_X4(mysub1) NMOS L=0.045um W=0.090um
**.ends
****REC_DEPTH = 2
R2(mysub1)_X4(toplevel) PP_X4(toplevel) AA 200
**.ends
****REC_DEPTH = 1
M1(toplevel) AA CC BB BB NMOS L=0.045um W=0.135um
**@X2(toplevel)@ @CC@ @BB@ @mysub2@
****REC_DEPTH = 2
**.subckt mysub2 CC% BB%
DD(mysub2)_X2(toplevel) CC YY_X2(toplevel) diode_model
DX(mysub2)_X2(toplevel) YY_X2(toplevel) CC diode_model
M1(mysub2)_X2(toplevel) 1_X2(toplevel) CC BB BB NMOS L=0.045um W=0.090um
**.ends
****REC_DEPTH = 1
D1(toplevel) CC BB diode_model
.ends
****REC_DEPTH = 0
--------------------------------------------------------------------------------------------
The flattened netlist shows the lowest level components in detail - its position interms of the instance and subckt hierarchy, its nets traced upwards along the pins/ports correspondence chains.
Note that the X2 instance of the toplevel has mosfet M1 correctly listed as M1(mysub2)_X2(toplevel), meaning it belongs to the subckt mysub2 which is the X2 instance of the toplevel. Its source and substrate pins could be traced to the top net BB, since both pins were asserted.
Whereas, the X4 instance of mysub1 is listed as M1(mysub2)_X1(toplevel)_X4(mysub1), meaning it belongs to the subckt mysub2 which is the X4 instance of the mysub1, the latter being the X1 instance of the toplevel. Its GG net could not be traced up due to insufficient asserting - GG_X1(toplevel)_X4(mysub1), meaning it's a local net in toplevel --> X1 --> mysub1 --> X4
Similar arguments hold true for M1(mysub2)_X4(toplevel)_X4(mysub1). The net 1 of mysub2 is always a local net, and is listed as such.
***
Item#496> More comments on the braking equation of Item#495 -> w = sqrt [w0^2 - ((2.F/(M+m))/r).theta]
[Nov 18, 2020, Arya Raychaudhuri, Santa Clara, California]
The way to go about reducing the braking distance is to increase f or F. The dependence of the braking distance on M suggests that over-loading of the vehicle will adversely impact the braking distance.
In a new braking mechanism such as the one shown in Item#492, a resonably accurate estimate of F may not be available for application into the braking model equation, nor any dependence of F on the paddle materials, radius, numbers, etc. Knowing the other parameters, the F and its dependences can be computed from the braking distance measurements, using the equation used in the above numerical example.
Who is supplying the braking energy? The vehicle itself - it's just a process of transformation of the kinetic energy into heat (mainly). For example, the 2288 J of kinetic energy will give rise to 547 Calories - very small amount of heat, it can make roughly half a kg of water hotter by just 1°C .
***
Item#495> Is it easier (lower braking distance) to brake a vehicle with larger wheel diameter? Not really, as the following analysis shows
[Nov 15, 2020, Arya Raychaudhuri, Los Angeles, California]
***
Item#494> Gravity-assisted power steering indicated in Item#493 translates the vertical foot push to horizontal steering push, with simple gear tooth-ratio based transformation to force (F) and the translation (Dx)
[Nov 8,2020, Arya Raychaudhuri, Santa Clara, California]
Note the grear equivalent of the hydraulic press being used to transform the force and the displacement. The simpler gear equivalent could replace the hydraulic press in other applications as well, e.g., Item#483.
***
Item#493> A brief look at the steering moments (Item#492) motivates a power steering
[Nov 5,2020, Arya Raychaudhuri, Santa Clara, California]
As mentioned on the above plate, F can be large in some cases, making the steering harder, more difficult. To address those situations a power steering is needed, so that F = Fd + Fp, where the Fd is the force applied by the driver, and Fp is coming from another source of power. In the case of the manual steering shown above, F = Fd, since the force is being applied horizontally, and there is no other source of power helping the Fd. So, the easiest power steering one can think of would get the steering force applied vertically - that will bring in some of the gravitational pull on the leg into play, decreasing Fd significantly.
***
Item#492> Design logistic for the hand-operated stand-up board, including the foot operated steering and brake. The sandwiched half cams (Item#491) are symbolized by the yellow ellipses passing the moment rod through the middle; "green" rickshaw engine
[Oct 20,2020, Arya Raychaudhuri, Santa Clara, California]
Note how the foot-based spring-assisted steering and the brake are incorporated. They involve vertical rectangular pedals that can be pushed by the feet. Obviously, by pushing the left steering pedal with the left foot you can turn the vehicle to the right. The hooks attached to the axle will pull the left spring out, and push the right one in. When the pressure on the left pedal is released, the axle will automatically come back to its straight (perpendicular to the length direction of the vehicle) position by the forces of tension and compression in the springs. Similarly, when the right steering pedal is pushed the vehicle will turn left, etc.
The brake involves radial paddles emerging out of the back axle, possibly made of hard rubber material, such as bicycle tires. The braking requires pushing the corresponding pedal with the back of the foot so that the braking paddle gets into friction with the rotating back paddles, and brings the vehicle to a stop position, or slows it down. Releasing the braking pedal at any time allows the brake spring to pull the braking paddle out of friction. This type of braking will avoid more erosive braking friction between the rubber and the road surface.
All the black dots represent hard connection that bearings, springs, and pipes make with the bottom of the vehicle.
Apart from its potential use for an individual's personal commute, this stand-up board can also act as an engine for hand-pulled rickshaws (invented by Izumi Yosuke in 1869), with a passenger seat on a separate wagon attached to the back of the board. This will also be "green" like the current version of the hand-pulled rickshaws, requring abosolutely no additional source of energy. Moreover, it will be more efficient and speedy - where one foot will not brake some of the efforts of the other foot, and the wheels will carry the increasing momentum. The foot-steering and the foot-brake installed on board allows the user to continuously control the direction and the speed.
***
Item#491> A mechanism to emulate hand-operated leg/foot motion; that can drive a stand-up board (like a skateboard)
[Oct 17,2020, Arya Raychaudhuri, Santa Clara, California]
The purpose of the Half Cams structure is to create an elliptical groove through which the pin attached to a moment rod (leg) can move - giving the moment rod a constrained up/down motion as the handle of the moment rod is moved in backward and forward strokes.
[Oct 17,2020, Arya Raychaudhuri, Santa Clara, California]
The high spring constant (K) spring in the spring shoe helps adjust the friction derived from the ground. Note that when the spring shoe is mounted, the spring remains somewhat pressed, to keep the pin at the lowest position of the groove in the moment rod. There can be multiple pairs of opposite holes on the pipe of the spring shoe to pass the pin through. This will allow height adjustment of the shoe with respect to the wheels (not shown) under the board, as well as friction adjustment.
** proof of concept for this mechanism comes from a Youtube video entitled "How to Ride the Kahuna Big Stick"
***
Item#490> A Revolving trio of circular hydrofoils fitted under a boat can generate major lift without the need to drive the boat at higher speeds. Causing significant reduction in water drag in the boat's foward movement.
Of course, the Lift-Drag measurement scheme of Item#488 can also be used for hydrofoils, except that the hydrofoil will need to be placed in a water tunnel below the measurement system, and the moment groove will be on top.
Circular hydrofoils made from a light material could be added detachably (for example, some shirts come without pockets, you can add a detachable pocket!) to a boat in place of the buoy floaters used in Item#473, 474 shown in connection with the PRP drive scheme. Let's try to get a rough estimation of the Lift and Drag, following the formulas given in the Engineering ToolBox, (2010). Lift and Drag example, https://www.engineeringtoolbox.com/lift-drag-fluid-flow-d_1657.html
Let's assume a circular hydrofoil of area 1 m^2. is attached under the boat that is moving at the rate of 10 knots (= 5.1444 m/s). Knowing that the density of water is 1000 kg/m^3, and assuming the same lift and drag coeffients as used in the link cited above , the lift force can be calculated as
9262.7 N = 944.5 Kgf
The drag is only 794 N = 81 Kgf, that's like a couple of human drivers repeatedly pushing down a PRP pedal. Of course, in a boat that is driven by some other source of energy, a amall part of that energy must be spent to overcome the hydrofoil drag, while gaining on the major lift that is a gift.
The other important formation can be a trio of revolving circular hydrofoils fitted under the boat with the three horizontal blades connected to a rotating shaft (like in an electric fan). In this case, even if the boat is cruising at a low speed, or even remains stationary, if you manage to revolve the hydrofoils at a reasonable speed, you get the lift (sort of like underwater helicopter blades). The waterline moves upwards beyond the equilibrium indicated by the Archemedes' principle.
Why circular hydrofoil? It's symmetrical, whichever direction the fluid flows from it will give the same amount of lift, for a particular relative speed.
***
Item#489> Measurement sequence for the Lift and Drag measurement scheme of Item#488, and the calculation of the Lift and Drag forces.
Step1: No Aerofoil loaded, no wind flow, Clamp brake off. The Lift Rod roller should be close to the 0-moment position on the Moment groove. Adjust the roller to 0-moment position with the 0-moment adjuster screw on the Drag Press. Put Clamp brake on. Note the PlungerD position to be X0. Adjust the 0-lift screw to achieve a suitable PlungerL position Y0.
Step2: Place Aerofoil, start wind flow, turn Clamp brake off. The sleeve moves left to push the RamD in, and the PlungerD up; the Lift Rod rolls on the moment groove to push its left arm down, and the right arm up - this will push the PlungerL up. When movements stop, turn the Clamp brake on. Note the PlungerD position to be Xf, and the PlungerL position to be Yf. Also, the position of the Lift Rod roller to be XmL. Note that the right arm of the moment groove has a fixed length of XmR.
Step3. With the Clamp brake still on (keeping the Roller at XmL), remove the Aerofoil, turn off wind flow. This will push the PlungerL somewhat down from Yf to Yw, just to reflect the pressure due to the Lift Rod, Roller, Aerofoil holder. This step is necessary to subtract their effect from the lift calculation. Once the Yw is noted, release the Clamp brake to let the sleeve containing the Lift Rod return to the 0-moment position, turn the Clamp brake on. The measurement is finished.
Calculation
Let's call the Drag force Fd, and the Lift force Fl. Let's assume that the RamD and the PlungerD have effective areas ArD, and ApD, also, the RamL and PlungerL have effective areas ArL, ApL. The hydraulic fluid has a density of Df, and g denotes the acceleration due to gravity.
So, on the Drag side,
Fd*(ApD/ArD) = Kd * (Xf-X0) + (Xf-X0)*ApD*Df*g, knowing Xf, X0, Kd, ArD, ApD, Df, g it is easy to calculate Fd.
On the lift side,
Fl*(XmL/XmR)*(ApL/ArL) = Kl*(Yf-Yw) + (Yf-Yw)*ApL*Df*g, knowing XmL, XmR, Yf, Yw, Kl, ArL, ApL, Df, g it is easy to calculate Fl.
Note that the Fl also contains the weight of the Aerofoil Wa, so the net drag force is Fl - Wa
***
Item#488> Lift and Drag measurement scheme for circular aerofoils (one side flat and one side convex) with two orthogonal hydraulic presses, as indicated in Item#487
[Aug 21,2020, Arya Raychaudhuri, Santa Clara, California]
When the clamp is on, the horizontal shaft pushing the ram of the Drag Press cannot move, when the clamp is off, it can move. So, when making 0-moment adjustments it should be off, when the vertical rod is adjusted to the 0-moment position, it can be on. Again, when allowing the sleeve to move with the drag force, it should be off, when the drag force has fully pushed the sleeve to the left, it can be on , etc.
The 0-lift adjuster screw is meant to adjust the vertical position of the plunger in the Drag Press, after the 0-moment position of the Lift Rod is achieved.
***
Item#487> Motivation for Lift and Drag measurement for circular aerofoils (one side flat and one side convex) with two orthogonal hydraulic presses (e.g., the Item# 483 shows one that measures the drag only)
As I have discussed on August 1, 2020 in a newsgroup (soc.culture.bengali) under the topic of Consciousness without borders in connection with a flood shelter design, circular aerofoils may have beneficial effects in stabilizing structures under strong wind conditions. Or even lifting them slightly to reduce the gravity load. For example, if a circular aerofoil is allowed to work in a positive lift mode (top side convex, bottom side flat) on a boat, the latter can get slightly lifted to reduce the water drag to a larger extent. Of course, boats equipped with hydrofoils can already do that. But, the boats without hydrofoils can possibly use a circular aerofoil roof.
[Aug 20,2020, Arya Raychaudhuri, Santa Clara, California]
Circular aerofoils are not new. They have been used in frisbees and in flying saucers. But, they can possibly be put to many more applications.
For example, micro aerofoiling - matrix of small small circular aerofoils with some +ve lift, and some -ve lift can be used to control the net lift (direction and magnitude). Also, if the convexity of the top and bottom surfaces can be changed with small energy usage, you are looking at an aerofoil working like a MOSFET.
So, we need a simple scheme to measure their Lift and Drag under various wind speed conditions.
***
Item#486> Revisiting the series-parallel resistance split (Item#137) for AC source and complex impedances
[Sept 12,2019, Arya Raychaudhuri, Santa Clara, California]
Note that the net admittance YP of the parallel branches is a characteristic quantity for these circuits. Knowing YP, one can quickly calculate the Z splits. If there are n prallel branches, one needs n inversions (1/Z1 etc.) and n-1 additions to get YP. If the jX part is 0 for all the impedances, the circuit becomes purely resistive, then the split becomes valid for both dc and ac sources. But, for non-zero jX the split is valid only for ac sources.
***
Item#485> A new MOSFET symbol (Evolved from Item#370) that can show the changing modes of fet conduction during logical transitions
[July 19, 2019, Arya Raychaudhuri, Santa Clara, California]
Note that the box symbol introduced earlier (e.g., Item#370) could be somewhat confusing to readers who might get misled to think that the drain and source got shorted. So, reverting back to the old open symbol, with the new annotations involving the clear (hole) and the dark (electron) circles and the dots (one dot - LVT, two dots - HVT). The hole indicates a PFET, and the electron an NFET. Obviously, in this case, the arrowhead of the substrate bias indicator is not needed.
The special feature of the new symbol is that we can indicate the changing conduction modes of the FETs very clearly, during logical transitions. When a FET is in cutoff mode, the circles are rounds at the center, not touching the source, drain bars. When the FET is conducting, the rounds become elliptical (egg-shaped). If the egg-shape touches both the source and the drain bars, the FET is in linear mode. If it touches only the source bar, and not the drain bar, the FET is in saturation - the pinch-off situation.
The logical transition of a CMOS inverter when the input goes from 0 to Vdd is shown with the new symbol.
I dedicate the dynamic symbol to the memory of Mohamed Atalla and Dawon Kahng who had invented the MOSFET in 1959. Around 1.3X10^22 pieces of the device have already been manufactured!
***
Item#484> Interesting factoid about the size of the code_snippets + code_snippets2 + code_snippets3 + code_snippets4 + spice_codes pages
305176.3 pixels long and 794 pixels wide. The 794 px width roughly equates to 8 inches. And, the length of each page is also close to 8 inches (height of the laptop screen). So, the number of 8X8 sq.inches pages can be computed as 305176.3/794 = 384 pages (approx.), so far, if printed into a book with no augmentation of the font size, etc.
If the size is computed as a simple vertical height, it's about 384*8/12, or 256 feet tall.
***
Item#483> A hydraulic press based speedometer for boats - schematic
[Oct 15, 2018, Arya Raychaudhuri, Santa Clara, California]
The drag force calculation is done using the drag equation as given in wikipedia for 'Drag equation'
A drag coefficient of 1.28 for flat plates is used from https://www.grc.nasa.gov/www/k-12/airplane/shaped.html
Note that a square-law spring is needed to keep the speed markings linear.
***
Item#482> A rudimentary 4-speed transmission using the EM tooth Pawl Gear of Item#481
Compared to Item#222, the following design shows a higher/better level of electroMechanics integration, enabled by deeper teeth control.
[Oct 3, 2018, Arya Raychaudhuri, Santa Clara, California]
Again, the logistics of the gear shifts need to be controlled by a circuit such as the one shown in Item#223. When all the gearX supplies are off, you are in neutral. Since the pawl gears are engaged in electroMagnet repel mode, one can take advantage of the "relative speed meshing" discussed earlier - because the repel mode has some spring action. If depending on the speedometer analog voltage, 4 latches can be set corresponding to speed bands, one can configure automated (auto) gear shifts quite readily. In that case, you basically need two push buttons - neutral, and drive. An automatic transmission at the mechanical (not counting the electronics needed here) complexity of a typical manual transmission [https://en.wikipedia.org/wiki/Manual_transmission], if one uses the EM tooth pawl gears.
Of course, the above diagram shows only the forward gears. For reverse, one needs another three gears, one pawl gear on the input shaft, one fixed teeth rachet gear on the ouput shaft, and a third direction changer. One should not be able to go to 'reverse' unless the speed is 0. From 'reverse' you should be able to go to 'neutral'/'drive', only when the speed is 0.
***
Item#481> Electromagnet enhanced bounce of the spring teeth in the pawl gear of Item#479
The concept of electromagnetic tooth collapse/bounce can also be applied to the Pawl Gear of Item#479 - that will be more for a engage/disengage role. In this case, the electro magnets repel the ledge out, overcoming the pull force by the spring - the teeth bounce. With no current powering the electromagnets, the springs pull the teeth in.
[Oct 2, 2018, Arya Raychaudhuri, Santa Clara, California]
A series of rotating electromagnetic relays that can be dynamically controlled from outside. This creates the possibility of car transmissions that selectively engage/disengage gears by electromagnets switching.
***
Item#480> Electromagnet enhanced collapse of the spring teeth in the pawl rack of Item#478
Although the spring based design (Item#478) is simple and adequate, there will be a small but finite friction between the spring teeth and the teeth of the pinion that the rack drives, during the recovery cycle. While the friction can be minimized by a proper choice of the spring constant, and also by tooth shaping, it may give a slowing resistance to the rotating pinion. For example, a bicycle runs for a long distance in the pedal idle mode even with the slowing resistance in its rachet-pawl hub; but, if the slowing resistance were not there, it would go even further.
In order to totally zero out the friction, one can add little electromagnets to the spring bases pulling down liitle permanent magnets on the spring teeth during the recovery cycle. The electro-magnet pull must overcome the spring push. One good thing about the open design is that one can enter electromagnet wires from the backside. Two switches on the piston located near its lowermost and uppermost positions will turn the electromagnets on or off respectively. The electromagnets can be powered by a dynamo engaged to the pinion.
[Oct 1, 2018, Arya Raychaudhuri, Santa Clara, California]
***
Item#479> Circular assembly of the basic shell of Item#478 to form a Pawl Gear (used in several previous Items)
[Sept 27, 2018, Arya Raychaudhuri, Santa Clara, California]
Drive side application of the Pawl Gear and the Pawl Rack (Item#478) is expected to revolutionize mechanical power transfer - some previous Items indicate that. So, it's a good idea to look at their construction.
***
Item#478> Some construction details of the PawlRack used in Item#472
[Sept 27, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that the bolted metal bridge between the two sidewall metal plates stops the ledge (screwed on to the spring tooth) from going further up when the middle spring pushes up the tooth. The spring base is hard connected to the side plates using three nut-bolt pairs. The spring tooth can freely rotate around the bolt rod near its thin end. There are holes to accommodate the spring on the spring tooth and on the spring base - they will always keep the spring in place.
The basic shell is repeated to create the actual pawlRack shown at the bottom - a logical assembly of the basic shell; in reality, there will be two straight sidewall metals with perforations holding the triangular pieces, bridges, and springs with nuts&bolts. The ease of construction and assembly is obvious.
Please, note that when the basic shells are arranged in a circle, it becomes the pawl gear of the piston-pawl drive discussed earlier.
***
Item#477> Possible position of the windMill-WheelBridge (see Item#474) for a container ship
Since container ships are of high width (10m-50m), the length of the wheel bridge axle would be rather long if placed in the ship. Also, to avoid large diameter for the wheels you would need to make cutouts on the ship's sidewall closer to the water level. To avoid these problems, one can place the windMill wheelBridge on a low and narrow cantilever platform projecting out of the stern side of the ship.
[Sept 25, 2018, Arya Raychaudhuri, Santa Clara, California]
***
Item#476> Hydraulic press enhanced water replenisher for the Aeolipile boiler of Item#469
The problem with the water replenisher of Item#469 could be that the pressure of the replenisher piston driven by the Aeolipile itself could be insufficient to overcome the steam pressure (2-3 times the atmospheric pressure, like in a pressure cooker). So, a force amplification stage is needed.
[Sept 24, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that the play of the replenisher piston needs to be smaller - for example, a play of 6 inches on the right arm of the press produces a play of only 2 inches on the left. Because, the work done (force X distance) is same on both sides. A hydraulic press works on the principle of the Pascal's law.
***
Item#475> Some details on the slowing and elastic braking of the windmill of Item#474
[Sept 21, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that the moment of inertia spring balls prevent excessive rotational speed by pushing out the balls under centrifugal force (see Item#447). The lower ends of the elastic chords tied to the lower bearing hooks allow default rotation. Manually interrupting the chords causes braking. For parking brake, first completely brake the windmill, untie the chords from the lower hooks, tie them up to the upper hooks that are located on the body of the pipe.
Multiple windmill-wheelBridge stages can help reduce fuel costs for engine driven vessels - experiments must be done. According to an estimate, a 8000 nautical mile voyage for a small container ship costs about $702,000/- at today's fuel price:
https://www.quora.com/How-much-does-it-cost-to-fuel-a-cargo-ship
***
Item#474> Matrix PRP drive (see Item#s 472,473) with WindMill assist for large/seafaring boats
[Sept 21, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that there are four wheel bridges. Three of them are equipped with three PRP stages on each, working in parallel. So, a maximum of nine rowers can simultaneously push the boat, three on each bridge. The fourth bridge is getting pushed by a Savonius (vertical axis, high torque) windmill (WM stage transfers power through a pawl gear as in Item#447)- this works as a convenient replacement for a sail. By noting the relative positions of the wheel shafts and the cutouts (see Item#473) one can see that the second bridge from the right is disengaged (wheels taken out of water). That means, at this time, six rowers may be working, plus the windmill bridge.
The Savonius (discussed in Wikipedia, under 'windmill ship') is a pair of ellipsoidal cups that works on the basis of the difference in air drag coefficients between the open side of the cup and the ellipsoidal side.
What is the the WM transmission going to be like? It will be like a manually clutched engage/disengage as in a manual transmission car - except that the clutched position needs to be held, so that you can adjust the height of the bridge as needed. For stronger wind speeds, a lower bridge position will push the boat harder. It will also ease the load on the matrix galley rowers. The result is an increased speed of the matrix PRP boat over the ancient galley vessels - 3-4 knots to 10-15 knots, and with reduced effort.
** This matrix design motivated by
Ben-Hur (1959) - Rowing of the Galley Slaves HD - YouTube
***
Item#473> A scheme for allowing variable loading on a PawlRack-Pinion (PRP) paddle-wheel boat - See Item#472
The PRP paddle-wheel boat design shown in Item#472 is good for constant loading as with boat racing. But, for variable loading situations such as with carrying cargo or passengers, the wheel paddles can get excessively submerged, or, can come out of water. So, there needs to be a scheme that makes sure the centers of the wheels stay at the same height above the water under variable loading. The following diagram shows a scheme that allows the wheels and the connecting shaft to freely float with the help of buoy floaters, before engaging the pinion for action.
[Sept 19, 2018, Arya Raychaudhuri, Santa Clara, California]
Please, note that the paddle-wheels and the shaft need to be made of light but strong material such as special plastic. This will have two benefits. One, that you need to spend less energy moving them (so, all the energy goes into slicing the water), and, two, that small floaters on the two sides can balance the weight. To note is that only 1/4 cubic ft of water displaced on each side can balance a weight of 30lbs.
***
Item#472> A multi-Rower PawlRack-Pinion (PRP) paddle-wheel boat design - a variant of the Piston-Pawl boat of Item#391
[Sept 15, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that the spring-teeth are on the Rack, and the pinion is a simple spur gear. This design will have higher power due to the use of paddle wheels, as opposed to the propeller (Item#391) which is more suitable for engine driven boats. The desgn is meant for boat racing, where many PRP stages can be used. Also, this can be used for carrying cargo with multiple rowers pushing the boat. If there are even number of stages, half of the rowers can be in the drive cycle (push down) while the other half in the recovery cycle (pull up) of the piston. The splashguards prevent water from splashing into the boat. Note that there are two passenger seats where the rowers can take rest from time to time.
***
Item#471> Aeolipile driven multi-AC drive (Item#s 468,469) under fluctuating power usage situations
One of the problems of power supply grids is that you need to store energy during non-peak usage times - which will be released at peak usage times. This process is inherently lossy.
But, the Aeolipile driven multi-AC allows for adjusting the production parameters by sensing the power usage. Let's say, the power plant is supplying to multiple households in a community that uses electric ovens for cooking. So, at times when people cook their food, the peak usage happens. This is sensed by a voltage sensor at the power plant - a peaking usage draws more current, tends to reduce the output voltage. The sensor operates electronic circuitry that would augment the number of turns on each coil, put higher number of coils in parallel, increase the heat to the boiler. Again, when the power usage goes down, the reverse adjustments happen. So, no need to store energy.
The scheme would look like the square wave to sine wave filter of Item#s 458,459 - only draws the fundamental sine out, and nothing else, wastes nothing, conserves energy at source!
***
Item#470> How can the multi-AC designs and their compatibility with "green" energy (Item#451, 461-468) help
Even now, more than 1 billion people (out of 7.6 billion) don't have access to electricity [https://data.worldbank.org/indicator/EG.ELC.ACCS.ZS]. Many countries haven't yet reached the goal of 100% access. Also, note the huge dependence on oil, gas, coal sources (66% in 2014, polluting the environment) - we all want to reduce this dependence. The multi-AC designs and their compatibility to "green" energy will help in addressing these areas - ability to generate electricity with slow speeds (at the speed of nature) on multiple simultaneous coils is the key. Even when working with heat engines, a slow moving heat engine such as the refitted Aeolipile (Item#468) will suffice
***
Item#469> A manually adjustable water replenisher for the Aeolipile boiler of Item#468
[July 23, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that the worm screw can be manually pushed in with the Worm drive adjustor bolt - this will reduce the notch volume, so less water will be carried into the boiler in each cycle of the pump. Since the one-toothed gear is tied to the aeolipile shaft, water is replenished faster as the aeolipile rotates faster, i.e., more steam is generated in the boiler. While the one-toothed gear pushes the piston down, carrying the water-filled notch to the boiler, the spring at the top of the piston immediately pulls the piston up, to the replenish position of the notch.
***
Item#468> A rudimentary heat engine, the ancient Aeolipile of Alexandria (1st century AD) refitted to work with the multi-AC (Item#462)
[July 20, 2018, Arya Raychaudhuri, Santa Clara, California]
The fire could come from any other source - but, a gas burning fire is cleaner. Note how the steam jets emerging from the nozzles create the torque. The water input could be automated with a level sensed/timed valve system.
***
Item#467> Windmill farm to Water wheel Farm with multi-AC (Item#462)
Particularly enthusing should be how the multi-AC wheels (e.g., Item#462) will make power generation out of small windmill farms simpler. Goodbye expensive nacelles, and simply connect the rotors of a high-torque *vertical-axis* windmill directly to the multi-AC wheel, probably through a pawl gear (see Item#447), and get the ACs out. Rectify the ACs and diode dump the currents into a low voltage line running through the farm - should be good for farms that are 1000 feet square [0000 AWG carrying 100 Amps will produce a voltage drop of about 5V over 1000 feet]. You can then use my depletion MOS charger (see Item#s 438-446) to fill up battery banks out of the DC line. Also, you can use a multi-brush version (to multiply the current) of the wheel based DCtoAC (Item#454) which can convert the battery watt-hours into AC for supply.
A good thing about the multi-AC wheels is that they would go with high torque and low angular speed, which is a characteristic of some vertical axis windmills. In fact, even water wheels suspended into a flowing river would also produce high torque and low speed. So, they can become a popular source of green power with the multi-AC crunching the rotational kinetic energy of the wheels. Below is a rough schematic of how a water wheels farm will look like
[July 06, 2018, Arya Raychaudhuri, Santa Clara, California]
Note the tapered shape of the connected floating decks that are anchored to the steel crossbar. It helps create a funneling effect to increase the speed of water just below the wheels. Since the decks are floating, you will never have to adjust the height of the wheels for optimum speed - their centers will always maintain the same height above water. Only 4 wheels shown in this example - but, there could be 100s in the middle of the river to generate serious power. Also, any processing of the power output out of the multi-ACs is not shown here, should be similar to the processing discussed above, for a windmill farm.
***
Item#466> On generating electricity from train wheels using the twin-wheel (Item#462), or the belt-type generator (Item#465)
Some interesting features of these generators include the possibility of running them with DC electromagnets, instead of with permanent magnets. Now, if the electromagnets are switched off, nothing happens. When the electromagnets are on, but no current is being drawn from the generator coils (open circuit), there is braking action because magnetic flux opposes change induced by the moving ferro pieces. The braking action has good moment because the ferro pieces are on the periphery. When current is being drawn from the generation coils, the device works as a generator, and the braking action reduces since the current itself opposes the change in flux. So, the device can work as, a) a non-entity, b) a braking device, c) a generator with mild braking [somewhat like regenerative braking].
So, when you are running the train on a flat surface, you may want to switch off the electromagnets to turn the devices ineffective, and switch the electromagnets on to help in braking (rarely). While going uphill on a slope, let's say, to a hill station, the wheel-fitted devices need not be used at all, so, the electromagnets can be kept off all the time. While going downhill, maybe returning from a hill station, use the devices in the generator mode with mild braking. Basically converting gravitational potential energy into electricity.
The best way to get energy out is to carry rechargeable battery banks on a dedicated wagon, and charge it up on the downhill ride. The charging process can use a low voltage line (12V or 24V) that is fed by the multi-AC devices through rectifiers. A low voltage line cannot be used for power transmission outside the train due to heavy voltage drops over longer distances, and generating high voltages inside the train is not safe. A wagon that can carry a load of 6000 Kg, can carry Li-ion battery banks to hold 1.2MWh (as per the table under "Comparison of commercial battery types" in wikipedia)
But, how would you carry the battery banks uphill to the elevated location, when they are used up? Put them on a wagon, and add it to the train going up, when it is lightly loaded. But, a greener solution would be to use a windmill power driven ropeway.
***
Item#465> multi-AC from a circulating belt - another configuraton for generation
[June 29, 2018, Arya Raychaudhuri, Santa Clara, California]
If each ferro piece is 2 inch dia, the belt needs to move at 20 feet/sec to generate 60Hz AC. That is less than 15 miles/hour. Note the staggered (by design) positions of the ferro pieces in the top and bottom segments of the circulating belt.
The belt configuration is particularly useful in generating electricity out of rotating parallel axles of moving vehicles, a train car for example. In principle, there is no difference between conventional generators, and the wheel/belt based generators - except that in the latter you achieve the same level of d(flux)/dt with a much gentler speed, also, you get the feature of incrementally adding/removing batteries, in addition to be able to stabilize the voltage output more easily.
Sizes of wheels used in Item#s 462,463
If there were to be 60 magnets and 60 demagnets, each with 2 inch dia, on a wheel like that in Item#463, the wheel would be 20 feet in circumference - which is roughly 6.4' in dia. This wheel would require to rotate at 60 RPM to generate 60 Hz AC.
The same would be the size of each wheel in the Item#462, with 60 ferro pieces (staggered) in each, rotating at 60 RPM.
But, probably, it's a better idea to use smaller wheels with 10 pieces of ferro, or 10 magnet-demagnet pairs, running at 360 RPM split with 36 to 6 gear-tooth ratio - the 36 tooth gear running at 60 RPM. One can have a number of such 10 piece wheels running out of the 36 tooth gear. Each 10 piece wheel in that case needs to be about 13 inches in dia
***
Item#464> New paradigm of community based power generation and distribution around the multi-AC generators of Item#462, 463
Since a large number of AC batteries are energized from a single wheel (Item#463) or twin wheels (Item#462), one can think of renting a coil or more on a monthly basis, rather than paying for units consumed.
One multi-AC generator can probably be used to supply to 25 or more households. Each coil is independent of all others, yet in phase. So, one can connect multiple coils in parallel for more current. Any user renting coil(s) can use or save (probably in DC batteries for later use) all the electricity as is supplied through the rented coil(s), and no more.
One advantage of the twin wheel scheme is that if a particular coil burns or gets damaged, it can be more easily replaced without stopping the wheels, disturbing supply to the other coils. Also, with the twin wheel scheme electromagnets could be used in place of permanent magnets.
***
Item#463> Mag-Demag edits to the multi-AC generator of Item#461 - similar to the edits in Item#462
The multi-AC generator of Item#461 can also incorporate a demagnetization cycle, as was done for the generator of Item#451 in Item#462.
[June 26, 2018, Arya Raychaudhuri, Santa Clara, California]
To avoid complexity in drawing, only some of the top coils/cores are shown in the above figure. Obviously, an inner circle of opposite polarity magnets (demagnets) have been added in staggered positions on the wheel. The additional pieces of ferro terminals added to the source ends of the coil-cores face the inner demagnets' magnetic terminals during the demag half-cycle. At that time, the magnets on the outer circle stay within flux keepers - the flux keepers added to the stator side help keep the flux environment clean.
During the magnetization half-cycle, the outer circle magnets face the bottom/top ends of the coil-cores like in Item#461. At that time, the flux keeper terminals face the demagnet terminals.
We zoom into the details in the following diagram.
[June 26, 2018, Arya Raychaudhuri, Santa Clara, California]
In fact, if needed, one can draw power out of the flux keepers also, by placing coils around them.
***
Item#462> Two-wheeler multi-AC design to boost d(flux) in the coil-core, through alternate magnetization and demagnetization cycles (a variant of the Item#451)
[June 25, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that the lines of flux through the coil core are pointing upwards during the magnetization cycle, when the left loop magnetic circuit closes through the ferro cylinder on the mag wheel, now the right loop is open. Next, the right loop will close, and the lines of flux will point downwards through the core - that's the demag cycle. When the right loop closes, the left loop will open, due to the staggered positions of the ferro cylinders.
This is more like an electric transformer where flux changes direction in every cycle. Also, in a single phase generator (indicated in Item#452), flux changes from mu0*Hmax to -mu0*Hmax in each cycle.
***
Item#461> A variant of the multi-AC wheel of Item#451, with permanent magnets on the wheel
[June 23, 2018, Arya Raychaudhuri, Santa Clara, California]
With 10 magnets on the wheel, one can accommodate 20 such generation coils, all working simultaneously. Please note the vertical ferromagnetic bar on the side - this will complete the magnetic circuit. The rotating shaft (360 RPM, equivalent to 6 revolutions per second) rolls inside ball-bearings at the center of the stator discs, but, it is hard-connected to the rotor. A larger rotor with 60 magnets on the periphery would require only 60 RPM (for 60 Hz AC) , and could accommodate a maximum of 120 generator coils. One thing to note is that there should always be an even number of generator coils/cores present - if there is one on top of a magnet, there must be one below it. Unneeded generator coils/cores can be easily unscrewed off of the stators. The permanent magnets can also be unscrewed off if needed to be replaced.
If the rotor is rotated faster, higher frequency AC with larger RMS will be generated. Now, if the AC is to be rectified to charge up batteries, that should not be a problem.
***
Item#460> Key differences between the multi-AC emf generation of Item#451 and the Faraday's wheel (invented in 1831 by Michael Faraday)
Although both methods of generation involve a rotating disc inside a ferromagnetic loop, there are important differences.
1. Faraday's wheel (e.g., see description in https://en.wikipedia.org/wiki/Homopolar_generator) produced DC, Item#451 is designed to produce AC
2. Faraday's wheel set the stage for all later generators that involve a relative movement between a conductor and a magnetic field, where the Lorentz emf come into play, and the Fleming's right hand rule is used to determine the direction of the induced current. In the multi-AC generator, no conductor is moved in a magnetic field, here the principle is different.
3. The structure of the multi-AC generator is completely different, and the wheel is not used as an electrical conductor, unlike in the case with the Faraday wheel.
4. No electrical brush contact is needed for the multi-AC generator.
5. With the multi-AC generator, multiple AC generators can share a single wheel.
***
Item#459> Looking at the theoretical limits with the circuit of Item#458 - using AC circuit analysis
[June 17,18, 2018, Arya Raychaudhuri, Santa Clara, California]
The above circuit analysis shows that the minimum DC watts drawn would not go below 278.46W - the simulation of Item#458 shows a value of 280W. The theoretical limit of conversion efficiency would not go above 87.7% - the simulation got 85.35%. The dB separation between the fundamental (f1) and the third harmonic (f3) in the output across the resistive load (Rout) is computed above as 31.44dB - compares reasonably well with ~33dB from simulation, see FFT plot below.
[June 17, 2018, Arya Raychaudhuri, Santa Clara, California]
The discussion in Item#s458, 459 goes to show that a good filter can go a long way in saving DC power drain from the batteries. With the series LC filtering shown, the conversion efficiency is limited only by the small resistance of the input circuit - batteries plus wheel.
***
Item#458> A simple series LC filter reduces the DC power drawn even further (compared to Item#456) - close to theoretical limit
AC power delivered to DC power drawn efficiency >85%, with DC power drawn reduced from 476W in Item#456 to 280W here.
[June 17, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that L*C= 1/(2*pi*60)^2, so that the reactance of the LC series circuit is 0 at 60Hz (f1). The f3, f5, ... components are highly attenuated, and they have no parallel path to ground. Also, the series Cx blocks DC. So, the power output and the conversion efficiency are unaffected by the DC mean of the square wave - that is, the outcome would be the same if the input were a -140V to +140V square wave.
***
Item#457> Another method to verify the Iav values as computed in Item#s 456, 455
One can define an independent current source in LTspice, where the expression of the current involves the integral (function 'idt') of the I(Vvin). This can be accomplished by adding two additional lines to the spice code of Item#456, as shown below.
[June 17, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that the integral function I(Bidt) changes by -28.25 mA-s during the 8.32ms when Vin=Vdc (280V). Hence the Iav from this method is -28.25/8.32 = -3.395 A, that matches closely with the -3.401 A value computed in Item#456.
A similar approach taken for the case of Item#455 yields an Iav of -6.501 A, while the value computed in Item#455 was -6.72 A - within around 3.3% error
***
Item#456> Edited filter reduces DC power drawn (see Item#455) by a large margin
[June 15,15, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that the Lin (6mH) considerably dampens the charging/discharging currents to the filter caps - as is known inductors oppose current changes, and capacitors oppose voltage changes. In fact, the fundamental output beyond Cx is also better (at 160V peak) - giving an output power of 256W, for a DC power drawn of 476W. This means an AC to DC efficiency of 53.8%, and a fundamental extraction efficiency of 80.5%
***
Item#455> Accurate calculation of the DC power drawn from the battery with the filter used in Item#454
The screen zoom based Iav (~-5.25A) estimation in Item#454 was inaccurate due to a bit of the sides of the appropriate zone coming into the zoomed-in display. So, I exported the I(Vvin) data into a file and deleted everything except the appropriate portion of the file that corresponds to a positive (280V) half-cycle of the square wave Vin. This truncated file was used for plotting and computing the Iav, using a scilab routine.
[June 15, 2018, Arya Raychaudhuri, Santa Clara, California]
Please, note that this more accurate estimation leads to a DC power drawn value of 940.8W from the battery (the earlier estimation of 735W was inaccurate). This means that about 700W power is being wasted - this is happening because the fourier components other than the fundamental and the DC are seeing a very small impedance to the ground, a lot of power is getting wasted in the charging/discharging of the filter caps.
We will see next if we can reduce this wasted power.
** The scilab code used to do the above plot is pasted in spice_codes page
***
Item#454> DC to AC conversion using a mechanical rotary switch
Although the DC to AC conversion shown in Item#s 449,450 is a workable solution, its conversion efficiency (AC power produced/DC power drawn) is low, mainly due to the losses in the transformer primaries. Here is another possible scheme that avoids the transformer, and should look rather direct.
[June 02, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that the square wave is generated by the rotating wheel with slightly raised trapezium shaped Vdc, Gnd, and insulating connectors that are scanned by a fixed spring brush giving the output. The Vdc and the Gnd potentials are also being fed in through brushes to circular strips. For a 60 RPM disc, one needs 60 Vdc, and 60 Gnd trapeziums, in order to generate 60 Hz. For a 600 RPM disc, one would need only 6 of each potential.
The filter can be a simple traditional LC tank circuit (https://www.allaboutcircuits.com/textbook/alternating-current/chpt-6/parallel-tank-circuit-resonance/), a series-parallel version is used - see a simulation below.
[June 15, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that at 60Hz, the parallel L1-C1 has infinite impedance - so it passes the 60Hz (fundamental) sine wave unattenuated. The series L3-C3 addresses the nearest 3rd harmonic - its impedance is 0 at 180 Hz. It also blocks any DC from shorting to ground. For 280V pulse (coming from 280V dc), one gets ~155V peak AC @60Hz - which is the regular supply voltage, 110V AC (rms). The 7 ohms input resistance to the filter could be an overestimation - it approximates the dc battery resistance, plus the wheel resistance. A lesser input resistance would decrease the output impedance of the filter even further. The Cx is a dc blocker to the output circuit.
The power delivered to the Rout (50 ohms) is 110^2/50 = 242W. The power sourced from the dc battery, (280*5.25)/2 = 735W. Hence, the power efficiency (ACout/DCin) is about 33% at this loading. But, since the square wave can be decomposed into its Fourier components (e.g., see under 'square wave' in Wikipedia) such as:
140 + (140*4/pi)*[sin(2*pi*60*t) + (1/3)*sin(2*pi*180*t) + (1/5)*sin(2*pi*300*t) + .....]
The fundamental component would only deliver about 317.74 W to the 50 Ohms load. So, the effective power efficiency is 242/317.74, or 76.1 %.
***
Item#453> On the output impedance of the AC generator of Item#451
As is known, magnetic flux always tries to maintain itself and resists change. That's the basis of the retardation (as mentioned in Item#452) exerted on the rotating disc. When a particular ferro strip is trying to enter the gap, the exising field will try to oppose the entry, and when the strip is trying to leave the gap, it will try to pull it back. The disc needs to have sufficient energy to break through this barrier in order to create the delta(flux) in the core. But, it loses a bit of that energy in each traversal, that will subsequently be converted into the electrical power delivered by the generator.
The same tendency of the magnetic flux is also responsible for the induced emf in the coil, as per the Lenz's law. But, the induced emf by itself cannot oppose the delta(flux) - a current needs to flow. As the current increases, the delta(flux) decreases, so does the d(flux)/dt and Vac. This decrease in Vac with increasing current is equivalent to a finite output impedance of the generator. If the output impedance is too high, the generator output voltage Vac will drop too quickly with the increasing current. That is not desirable, because any appliance run by the generator will be dissipating much less power (Vac^2/(2*R)) than it needs to - e.g., a filament lamp will glow very dimly, etc. In that case, one remedy can be connecting a number of the AC batteries in parallel.
***
Item#452> Advantages of the AC generation scheme of Item#451
First of all, one can create multiple AC batteries around a single rotating disc. Also, the disc is moving freely (except for the power transfer related retardation exerted by the magnetic field in the air gap region), and not touching any part of the magnetic loops, unlike the brush-slipring contact in generators (e.g., the schematic in https://en.wikipedia.org/wiki/Single-phase_generator).
Another very important advantage relates to the fact that multiple ferromagnetic strips placed on the periphery of the disc give an effective speed gain over conventional generators. In a single phase conventional generator, one revolution of the armature gives rise to one AC cycle, so, in order to produce 60 Hz AC, one needs 3600 RPM of the shaft/armature. But, in the case of a disc with 60 strips on the periphery, only 60 RPM is needed. So, the disc is very well suited for a Windmill, that can avoid much of the speed augmentation through gear ratios.
Another interesting advantage is that when the speed of the disc falls (in spite of the pawl based power transfer, and a VMI flywheel as indicated in Item#447), one can electronically sense the falling Vac, and automatically select a higher number of turns (N), so that the Vac is stabilized to some extent. It's like the auto transmission in a motor vehicle.
Obviously, in its simplest form, the generator is rather cheap to build - it's like a transformer with only the secondary coil, and the disc that is shared by a number of such loops has a bunch of small ferromagnetic cylinders on its periphery.
***
Item#451> Lenz's law based simple AC emf generation using a rotary disc with alternate ferromagnetic and nonmagnetic strips - could even be activated by reciprocatory motion if it were available
[May 27, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that as the disc (could be powered by a windmill) rotates, the reluctance of the airgap is alternately high and low - this modulates the flux in the core, giving rise to Ac emf. As per Lenz's law, Vac = - N * d(flux)/dt, where N is number of turns in the coil. Obviously, a number of such generators can simultaneously work out of a single disc.
An interesting thing to note is that Vac depends on d(flux)/dt, so a smaller flux with higher speed disc can give reasonable output voltage. That means, a weaker permanent magnet or electromagnet can suffice if the speed of the disc is high.
If a ferro strip thickness of 2cm is moving through an air gap of 2.2cm, with 1mm gaps above and below the strip, one gets a maximum reluctance ratio of roughly 11, between when the ferro strip completely covers the gap and when it is completely off. Since the air gap reluctance dominates the overall loop reluctance (due to high relative permeability of the ferro core), the max flux ratio between the ferro strip and nonmagnetic strip is roughly 11 too (probably less due to losses). That's the delta(flux).
If the delta(flux) is a linear function of time (ramp up and down), one expects a square wave output as the Vac, if the delta(flux) varies as the square of time, one expects triangular Vac waveform. If the delta(flux) can be made to vary as cosine of time by properly shaping the magnetic terminals of the air gap, one expects a sine wave as Vac.
** the basic idea is explained in slide#79 of http://slideplayer.com/slide/6419496/. It shows how a voltage is induced in the coil as a plunger moves into the air gap
***
Item#450> Simulation results for the DC to AC converter of Item#449
Please, note the crucial waveforms in the top panel. Note how the 30 Hz clkoutinv1 and the clkoutbarinv1 cross each other at around the |Vth0| of the PMOSes. Because of the coupling between the primary coils, the v(p1) and v(p2) both go up and down together at 60 Hz, although one of the two PMOSes is off depending on the input levels of clkoutinv1 and the clkoutbarinv1.
[May 23, 2018, Arya Raychaudhuri, Santa Clara, California]
The quality of the AC produced is seen to good with >25dB separation between the signal peak and the nearest harmonic peak.
The spice code for the simulated circuit is given below
[May 24, 2018, Arya Raychaudhuri, Santa Clara, California]
***
Item#449> A DC to AC converter circuit based on a variant of the RC coupled NOR latch oscillator of Item#240
[May 24, 2018, Arya Raychaudhuri, Santa Clara, California]
Please, note that the circuit works on a 2V dc supply, and produces a 2.8V AC at 60 Hz. But, in reality, probably a 12V (or more) dc supply would be converted to 110V AC. In order to do that, the output PMOS fets (connected to the transformer) would have to be 12V (or more) tolerant with higher Vth0 - and, their inputs clkoutinv1 and clkoutbarinv1 have to be first adequately transformed up before feeding to the gates. So, the good thing about the circuit is that while output circuit works on a 12V (or more) dc supply, the input control circuit can still work on a low voltage - drawing less power.
The simulation results will be shown in the next Item.
***
Item#448> Nacelle and shaft edits for the windmill of Item#447 for stronger bevels meshing
Typically the windmill gear boxes use the planetary gears for stronger meshing with the rotor input (10-60 rpm). But, the minimal design shown in Item#447 uses just a bevel gears meshing. The following diagram shows how to improve the quality of meshing, and avoid increasing backlash/disengagement over time.
[May 14, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that the spring loaded shaft section presses the horizontal bevel against the vertical one at all times. It also works as a shock absorber. The rotor shaft extending to another bearing at the back of the Nacelle helps transfer all the load fluctuations to the Nacelle which is now kept in place by the counter moment of the longer and heavier vane shaft.
One interesting aspect of introducing the pawl gear as in Item#447 is that it divides the windmill transmission into two parts - the driver side (rotor to pawl) and the driven side (beyond the pawl). So, one can have various driven sides depending on the needs. The driven side could be a generator with varying rotor speed requirements, the flywheel of a boat as in Item#394 looking for wind assist, or even a water pump, etc.
A very informative article on windmill based power is here:
http://www.omafra.gov.on.ca/english/engineer/facts/03-047.htm
***
Item#447> A minimal windmill for power generation - incorporating pawl based power transfer and generator rotor speed stbilization
The low cost charger design shown in Item#445 can make power generation with Windmills more appealing - creating new interst in windmills. Of course, the charger can also go with the PP drive, but, that's mainly for emergency charging, or the charging of smaller batteries. But, with windmills one can generate serious power. So, we discuss a minimal windmill design that incorporates pawl based power transfer (see Item#392) and generator rotor speed stabilization using a variable moment of inertia (VMI) flywheel. The latter works with the centrifugal force to increase the moment of inertia (I) as the rotational speed of the flywheel tends to increase, thus preventing excessive speed. Again, when the kinetic energy (0.5*I*omega^2) of the flywheel decreases, the I reduces to prevent the angular speed from falling too quickly. This way the flywheel helps keep the angular speed in a narrow range.
[May 14, 2018, Arya Raychaudhuri, Santa Clara, California]
So, the flywheel tends to store the kinetic rotational energy as if like a "green" battery that delivers a near constant speed. Also, it must be placed in a horizontal plane when applied to the WindMill's power transmission - otherwise gravity will make its motion wobbly.
[May 14, 2018, Arya Raychaudhuri, Santa Clara, California]
The important advantage of the pawl based power transfer is that it prevents a slow moving (lower energy) or stationary windmill from becoming a load to the portion of the transmission beyond the pawl. Also, that the windmill can be applied in an assist mode as with the boat of the Item#394. The other important feature of this minimal design is that the Nacelle does not include the transmission and generator, unlike as in the typical windmills. Since the windmill is not head-heavy, the vane can respond more efficiently.
***
Item#446> Another simulation of the circuit of Item#445 with a different value of the rechargeable cap
a 400mF cap is chosen this time in place of the 140mF cap used in Item#445. Should take longer to charge up.
[May 12, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that there is a short time interval where the windmill speed/PP effort goes to zero. During that time, the "green" battery discharges somewhat, because there is no supply current coming in. Had the time interval been longer, it would completely discharge - but, that doesn't impact the recharge once the effort resumes
***
Item#445> Max recharge voltage control added to the circuit of Item#442
[May 12, 2018, Arya Raychaudhuri, Santa Clara, California]
Please note the potential divider and an NMOS added at the bottom to prevent the battery voltage from going above 1.55V or so. Again, the circuit is simulated with the battery replaced with a 140mF Capacitor as in Item#444.
[May 12, 2018, Arya Raychaudhuri, Santa Clara, California]
The max power consumed by the charger circuit is <1.7W. So, a number of such circuits can work in parallel with the help of a single "green" battery. which consumes <4mA in this circuit. Charging current can be increased further by reducing the Vth0 of the depletion MOS. A Vth0 of -0.65V can give 100mA etc.
***
Item#444> A 140mF Cap (mimicking rechargeable battery) charging up from 0.7V towards 1.5V with voltage plateau sense (Item#s 442, 443)
[May 10, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that at around 3.23s, the battery reaches a voltage level of 1.5V. Beyond that is overcharge. So, a circuit similar to the one for plateau sense (Item#442) is needed to cut off charging as the vbatg level reaches 1.55V or so (slightly above 1.5V). This circuit should sense the "vbatg" rather than the "vdio" as was done for plaeau sense. The 140mF cap is just a convenient number that enables chargeup in a short simulation time interval. In reality, charging times will be much longer.
The spice code for the above simulation is given below
[May 10, 2018, Arya Raychaudhuri, Santa Clara, California]
***
Item#443> Simulation result for the circuit of Item#442, with the rechargeable voltage stepping from 0.7V through 1.5V at the rate of 0.1V
[May 08, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that when the charger is not charging the rechargeable battery, the V(vzen) [third pane from the top] simply reflects the current potential state of the battery (0.7V, 0.8V ... 1.5V). At that time, D1 is off - preventing any leakage from the battery receiving the charge.
***
Item#442> "Green" logic for voltage plateau sense added to the CVCC charger of Item#441 - cuts off charging when dynamo moves at lower speeds
As indidated in Item#441 some "green" logic has been added to make sure that the CVCC charger charges the battery only when the dynamo produces reasonable (above a threshold) voltage. The dynamo is assumed to produce dc voltage in the range of 0 to 12V.
[May 08, 2018, Arya Raychaudhuri, Santa Clara, California]
The trio of series regulator zener diodes (Dreg1, Dreg2, Dreg3) help limit the charger input voltage (vdyn) to 7.5V max. The "green" battery consists of a diode and a resistor for charge supply, and a gate-drain connected enhancement NMOS for charge drainage - the 2mF cap stores the charge. The supply and the drainage rates are equated to get a plateau battery voltage level of ~2V (Vcdb). The dynamic battery drives the resistive loaded NMOS inverter to invert the potential divided vdio. When the vdiosense goes above 1V (Vth0 of the NMOS), it means the vdio has now been regulated (plateau) for charging - a "0" on vdioinv cuts off the low Vth0 (0.25V) bottom NMOS to enable charging through vdio1. For lower (unregulated) vdio potentials, the vdioinv is a "1", although its voltage level may be a bit lower depending on the current weaker Vcdb level. That's why a lower Vth0 is chosen for the bottom NMOS, to make sure that even for a weaker "1" the fet remains shorted, and the vdio1 leaks through it, disabling charging.
Note the introduction of an addtional voltage drop through D3 to account for the small Rdio drop that was needed to leak away vdio1 under logic control. The D3 addition needs the top resistor of the potential divider getting raised to 1.4Meg. Without the D3, there would be a spread in the charging current and voltage [Id(MNCh), V(vzen)], with the rechargeable battery voltage going from 0.7V through 1.5V.
The simulation is shown in the next Item.
***
Item#441> CVCC charger circuit for 50mA charging from <12V dynamo output, and simultaneous 250mW LED power - edits to the circuit of Item#440
As indicated in the last section of Item#440, the aim is to bring down the dynamo output voltage requirement for ~50mA charging current. Preferably under 12V so that the charger could even work from a car battery. This can be accomplished with the following edited circuit - which basically involves moving the left zener up from the cathode to the anode of the top zener, and adding a shunt resistance (25 Ohms) to it. Also, the Rlimit is reduced from 500 to 30. These edits have beneficial attributes as we discuss below.
[May 06, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that the various currents and voltages are indicated on the simulation panes for charging at a dynamo output of 8V.
[May 06, 2018, Arya Raychaudhuri, Santa Clara, California]
The shunt resistance Rzen dissipates about 250mW (2.5Vx100mA) that could alternatively be used to power an LED lamp while the charging is in progress, or even without charging. A half watt zener can take up to 200mA at 2.5V, so 32mA is safe. In fact, the shunt resistance can be further reduced to protect the zener if needed to handle a higher dynamo output. The Rsx is set to 1 milliOhm to enable maximum charge current (50mA) for this config. Please note that the numbers used in this example are not to be thought of as etched in stone - they just exemplify the charger principle.
One needs to ensure that the charging takes place only during the plateau region (>~6.7V of the dynamo output) of the Id(MNCh) so that proper CVCC takes place. Also, to switch off charging when the battery gets fully charged - otherwise overcharging damage can occur. In order to achieve that, some 'green' (powered by the dynamo output only) logic is needed.
***
Item#440> Charger circuit of Item#438 simulated with a depletion NMOS as indicated in Item#439
Note that the depletion NMOS's current can be controlled by varying the small resistor Rsx. This type of depletion NMOS biasing has been discussed earlier - see for example, https://www.physicsforums.com/threads/high-voltage-voltage-controlled-linear-variable-resistor.857109/
[May 06, 2018, Arya Raychaudhuri, Santa Clara, California]
The circuit is simulated for Rsx = 1 ohm and Rsx = 15 ohms. Higher Rsx gives lower charging current.
[May 05, 2018, Arya Raychaudhuri, Santa Clara, California]
The good thing about this charger is that it can always remain connected to the dynamo run by a PP drive or a WindMill, with the battery in place - because there is no leakage through the charging NMOS even if no charging is taking place.
We can see that for a higher charging current, the dynamo output needs to be above 25V. Of course, it is possible to apply an appropriate transformer to an alternator output, before rectification, but it is desirable to be able to charge from a lower dynamo output. So that the active charging voltage range starts low. This will be discussed in the next Item.
***
Item#439> On the speed of charging and the energy consumed in charging, as with the charger shown in Item#438
Please, note that the Item#438 only introduces a simple principle for constant voltage constant current (CVCC) charging. The small charging current of ~1mA is often too little for practical rechargeable 1.5V batteries with a capacity of >2000mAh (see under "AA battery" in wikipedia). The charging current can be increased by using a depletion NMOS (-ve Vth0) instead of the 0 Vth0 NMOS used. For example, using a Vth0 of -0.2V, one can get a charging current of 15mA. But, this will need higher dynamo output voltage, >10V.
Is that reasonable to expect from the dynamo? Dynamos often come with a conversion (mechanical to electrical) efficiency between 50% and 95% (see for example, https://www.quora.com/Whats-the-reasonable-electrical-efficiency-that-can-be-expected-from-a-dynamo). Since the foot-pushed PP drive can deliver more mechanical power than a traditional bike (Item#s 435, 436), one can expect to get >100W of mechanical power from the PP drive driven with strength. But, if we assume a very conservative number of 30 ft-lbs/sec (see the scooter example of Item#396) - that amounts to roughly 40 Watts of mechanical power, and assuming a 50% efficiency of the dynamo, one gets about 20W of electrical power out of the dynamo.
Now, let's assume that we are using the depletion NMOS with a Vth0 of -0.2V, as indicated above, and the dynamo is giving out 12V. So, the net power consumed in the 15mA charging is only about 12*20 = 240 mW. [20mA net current is a sum of the charging current and the left zener current at 12V]. That's an extremely small fraction of the dynamo Watts being consumed by the charger circuit. This indicates that one can go for faster charging with even higher currents.
***
Item#438> A battery charger driven by variable voltage out of a PP drive/WindMill + Dynamo - works with a 0 Vth NMOS
As indicated in the Item#433, the PP drive can be configured into a standalone power generator by adding a dynamo to it. While it can be used as a short duration surge generator, as with a jump starter, it can also be used to charge up rechargeable batteries. Typically battery chargers work out of a steady voltage source (such as a power outlet), but, a charger to go with a PP drive or with a WindMill will need to work with a variable voltage source
[May 03, 2018, Arya Raychaudhuri, Santa Clara, California]
Let's assume (somewhat hypothetically) that the dynamo output voltage can vary from 0 to 5V. The following circuit tries to maintain a relatively constant charging current over the active (above a certain threshold) voltage range, as well as with growing (charging up) battery potential. The circuit takes advantage of the 0 Vth NMOS's (frequently used with the earlier analog circuits) saturation current with its gate and source shorted - to supply a ~1mA charging current.
[May 03, 2018, Arya Raychaudhuri, Santa Clara, California]
Please, note that the channel length of the NMOS is chosen to be much higher than the minimum possible (0.045um) to avoid short channel effects, and get a flatter saturation current. We are looking at the charging currents at three states of the battery voltage (0.7V, 1.1V, and 1.5V) - note the constancy of the current in the third pane below
[May 03, 2018, Arya Raychaudhuri, Santa Clara, California]
The Zener regulation starts around 2.7V. Had the NMOS been replaced with a resistor, the charging current would change widely with the battery voltage build-up. The same would be the case if the NMOS had its gate shorted to the drain, instead of to its source - this motivates the 0 Vth0 NMOS. Obviously, a slow moving dynamo will not contribute to the charging - corresponds to a vvdyn range where the Id(MNCh)=0. While the left zener diode is used for voltage regulation, both diodes help prevent the NMOS from leaking any current (current flowing upwards).
***
Item#437> Can the PP drive be operated by a person with a physical handicap?
Yes, because one can push/pull the PP drive in various ways. With one hand, or with one leg, or even with the torso (sitting on a chair that can roll back and forth on rails).
***
Item#436> How and how much the gravity comes into play (see discussion in Item#435) with the PP drive
The following force diagram explains the Force (F) components. Please note that the energy transmitted per push is simply the Fx(active piston play length), as indicated earlier in Item#396
[Apr 26, 2018, Arya Raychaudhuri, Santa Clara, California]
Obviously, in the horizontal position you lose the gravity advantage. But, the force diagram motivates the thought - if we could increase the FW, we would be able to inject more energy per push! Yes, we can - if the PP drive is made to hang from a ceiling, and we pull it in the active mode, instead of pushing. A much larger FW is possible that way.
***
Item#435> How the piston-pawl (PP) drive (Item#377) beats the traditional bicycle - by adapting to gravity
[Apr 24, 2018, Arya Raychaudhuri, Santa Clara, California]
Please note that the effort comparison is similar to that between walking/running versus skateboarding, both of which depend on "indirect" reaction force of friction with the ground. Ground friction is a much weaker force compared to the direct pushes involved in bicycles or in piston-pawl drives.
While walking there is an inherent braking effect at every step due to the rear end of the foot. The friction due to the front edge of the foot gives the forward drive. It is nature's design for a stable movement - integrating the braking with the forward drive - making the speed slower. Sort of like a negative feedback amplifier that gives a more stable, but lower gain. In bicyles, however, there is an unintended braking effect due to an weight component of the rear leg - it counteracts the forward moment - there is no such braking effect in a skateboard. In the PP drive, there is an unavoidable impedance due to the spring - but, this impedance is low since the spring needs to have a low spring constant to lift the piston in the no-load direction (upwards).
In a sense, the piston-pawl drive adapts to a planet with gravity - like the solar cell adapting to sunshine.
***
Item#434> A flexible circular motion flow "pipe" - in the context of a portable circular motion generator with a piston-pawl drive (Item#433)
If there can be a flexible rubber tube for water flow, a flexible wire for electricity flow, can there be a flexible pipe for circular motion flow?
[Apr 17, 2018, Arya Raychaudhuri, Santa Clara, California]
The small play joint can be tightened with a nut and a bolt to keep the adjacent axle pins close to perpendicular to one another, but making sure that the corresponding bevels are in mesh. Note that the bevel dumbbells can be rotated to stay at a different plane with respect to adjacent sections - giving the structure its flexibility.
Another interesting feature is that one can take out sections of the "pipe" quite easily by unscrewing off the nuts and bolts - making the "pipe" shorter. Or, even add sections to make it longer. Also, bifurcation is possible by adding a third axle pin to a joint, and then adding a sub-section to the bifurcated dumbbell, like in the case of the shift register maze of Item#257. Each bevel dumbbell is like a shift stage - drawing a parallel with digital electronics.
***
Item#433> Manually operated Reciprocatory motion to Circular motion (Item#389)
The piston-pawl drive discussed earlier represents a leap in the conversion of reciprocatory motion to circular motion in a compact framework. It can easily be seen that the rotary motion could also be genenerated by spring-toothing the piston rack (front and back) instead of using the pawl gears, which then could be replaced by regular pinions. The basic innovation involves bringing the pawl action from the load side (like in a bicycle rear wheel hub, where it has just a go/no-go role) to the drive side where its logical meaning can be more effectively utilized.
Whenever a new gear mechanism is unearthed, many new applications come up, as we have discussed in some items between Item#372 and Item#396. They will revolutionize manually driven "green" transport - typically dominated by the bicycle, the oars driven boat, the cycle/hand-pulled rickshaw, etc. The push operation can take advantage of gravity. Also, due to ease of operation and much cheaper price, many users of motorized vehicles will switch to piston-pawl driven "green" vehicles.
Because of its compact framework, the device can be used as a standalone rotary motion generator, sort of like a bicycle pump. Now, if an alternator and a rectifier are integrated into it, it can serve as a standalone power generator. A potential use can be that of a portable battery boost for your automobile. The foot operated piston-pawl battery booster can be stored in the back compartment of a car equipped with an electromech port (hole) near the accelerator pedal. When needed, push it into the port and work it with your foot while turning the car starting key.
***
Item#432> On the adaptive analog circuit design as shown in Item#s 410-431
The method of CMOS analog design shown in this page is somewhat different from the published methods that typically work on the ideal nature of the MOSFETs used. Here, in contrast, the design adapts to the non-ideal nature of very short channel Fets. We recognize that the channel length modulation (Early effect), drain-induced barrier lowering (DIBL), punchthrough, etc. can lead to the linearity discussed in Item#415. In fact, some short channel effects are welcome - if they do not impact the digital functioning of the devices.
Now, one needs to also point out that there is no guarantee that in another short channel process node the same linearity will be found by default, as is found with these PTM 45nm fets. So, this indicates the need for characterization (measurements) and some R&D to make sure that the linearity is available. Process parameters such as source/drain junction depths, substrate concentration, and oxide thickness can be varied in short-loop runs to investigate the best combination for linearity.
The other interesting aspect of these designs relates to exercising the various process options available in the modern low feature size CMOS processes. Frequent use of the deep Nwell, the feature of threshold voltage tailoring to 0/1V for NMOS, and -1/0V for PMOS represent a methodology that also adapts to the process options.
***
Item#431> Spice code for the temperature corrected output buffer stage of Item#429, with a couple of edits
The W values of the split load NMOSes were edited to get a more reasonable set of temperature response curves. Note that the model name NMOSll uses the PTM 45nm LP NMOS with Vth0 parameterized to 0.48V
[Apr 12, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that the above circuit replaces the 'anabuff' subcircuit and its instance (Xanabuff1 vout1 vout2 vddvss anabuff) in the spice code of Item#427, in order to simulate the temperature corrected DC errors amplifier. Of course, the .params and .STEP commands are also needed, along with the NMOSll model as mentioned earlier. The resulting simulation looks like this
[Apr 12, 2018, Arya Raychaudhuri, Santa Clara, California]
***
Item#430> Temperature response (0C-80C) simulation results for the DC errors amplifier (Item#426) with temperature correction circuit of Item#428 included
Note the temperature sensed voltage vpp from the Temp Sensor in the top panel below.
[Apr 11, 2018, Arya Raychaudhuri, Santa Clara, California]
Obviously, the temperature compensation is not perfect. But, considerable improvement occurs after including the temperature correction circuit in the simulation.
The large W values for the temperature control fets (Vth0=0.48V) are needed to account for the fact that these two fets are being operated near their cutoff. The 200mV spread in the sensor output indicates sizeable temperature sensitivity of these fets - does that mean that most published MOS analog circuits are some kind of temp sensors! Circuits designed with FinFETs can get worse with the self-heating issues of the latter - planar MOSFETs are cooler with the substrate more efficiently absorbing the heat.
***
Item#429> A temperature correction circuit for the DC errors amplifier of Item#426
In Item#428 it was shown that by increasing the W values of the PMOSes (gain) in the output stage, one can get back the features in the output voltage profile. Instead, it is easier to effectively reduce the W values of the NMOS loads in the output buffer stage, in response to the increasing temperatures.
[Apr 11, 2018, Arya Raychaudhuri, Santa Clara, California]
Note how the load NMOSes have been split into two fets each - one part working as before, equally at all temperatures, and the other goes from ON to OFF as the temps rise. The Temp sensor delivers a progressively lower vpp with increasing temps - this will take the split load control NMOSes (Vth0=0.48V) from ON towards OFF, increasing its resistance along the way.
***
Item#428> Rough indications on temperature dependence of the amplified dc errors waveform of Item#426, and its remedy
As indicated in Item#426, there is considerable melting of the features of the DC errors output wafeform at 80C and 125C if we stick to the aspect ratios in the output stage. as used for the room temperature simulation (Item#427)
[Apr 07, 2018, Arya Raychaudhuri, Santa Clara, California]
As is seen, the vout2 waveforms get progressively flatter at higher temps. However, if we increase the gains (currents) of the stages of the analog buffer at higher temps by augmenting the input PMOS W values, we can retrieve some of the features
[Apr 07, 2018, Arya Raychaudhuri, Santa Clara, California]
Please, note that in the above simulations nothing else in the circuit was moved/changed - only the W values of the PMOSes in the output stage. So, a temperature compensate scheme could involve increasing these W's progressively (or in steps) with temperature. Again, the accuracy of the above results is dependent on the accuracy of the temperature sensitivity of the PTM model used.
***
Item#427> Spice code used to simulate the DC errors amplification circuit of Item#426
[Apr 04, 2018, Arya Raychaudhuri, Santa Clara, California]
***
Item#426> DC errors amplification for a staircase sweep as in Item#273 - this one uses the DiffAmp of Item#s 423, 425 and the Analog Buffer of Item#410, and gives a gain of 10
Please note that unlike with the traditional diffamp used in Item#273, no negative bias nor current mirroring is used in the following implementation.
[Apr 04, 04 , 2018, Arya Raychaudhuri, Santa Clara, California]
In Item#273, the gain achieved was <10. In the current implementation a gain of 10 is achieved, and the ideal 10-gain step waveform (see top pane) matches the output reasonably well.
The reference voltage vref1 (1.5V) used in the simulation can be easily obtained using a simple potential divider consisting of two series connected resistors across vdd (2V), or even two series connected MOSfets. Since the vref1 drives the gate of a PMOS, the potential divider resistances can be high. But, the other reference voltage Vlohi (0.4V) dives the source of an NMOS - so, it needs to have a low output impedance, must come from a stable voltage reference circuit.
The circuit is designed for optimum operation at room temperature (27C), like any other circuits. For accurate predictions at other temperatures, more accurate temperature sensitive models are needed. One thing to note is that each stage is operating as a potential divider, so the temperature dependence of the top fet is expected to cancel the temperature dependence of the bottom fet, to some extent. This will leave the nature of the intermediate outputs unaltered. But, their spreads will be impacted by temperature.
***
Item#425> Linearity by process and design - looking at the linearity of the gate controlled potential divider (see the output stage of the diffAmp in Item#423)
Although the diffAmp in Item#423 uses an output stage that has two NMOS fets operating in the linear region of operation, and the "vout" looks reasonable, deeper inspection can reveal that the vout versus vpx3/vpx4 is somewhat nonlinear. Also, the "vout" amplitude is rather small - which is, of course, not any big problem.
Here, another more linear version of the output stage is being shown, that also exhibits much larger output swing.
[March 31, 2018, Arya Raychaudhuri, Santa Clara, California]
In this case, both fets operate in saturation, so the supply potential has been moved up to 1.8V. But, the lower Nfet needs to have a Vth0=1V. Also, its source is tied to 0.4V to give adequate play on Vpx3/Vpx4 from 1.8V to1.4V, while reducing gate drive asymmetry at vout midpoint.
The top case (green curve) represents the situation when Vin2>Vin1 - hence the Vpx3 ramps down from 1.8V to 1.3V on the gate of the lower Nfet, with Vpx4=1.8V applied to the upper Nfet's gate. The bottom case represents Vin1>Vin2 - and the Vpx4 down ramp is on the top Nfet's gate.
As is seen, the slopes for both cases match, and the linearity exists for a Vpx3/Vpx4 range of 1.8V through 1.45V (X-axis). Also, an output swing of >500mV (Y-axis) is available.
Hence, while using this output stage with the diffAmp it is good to restrict the down swings on Vpx3/Vpx4 to above 1.45V. This can be achieved by lowering the gains on the input stage - e.g., reducing the W values of the input PMOS fets to 12um from 24um does it.
***
Item#424> Spice code used for simulation of the DiffAmp of Item#423, two more Vin1/Vin2 sets simulated
[March 29, 2018, Arya Raychaudhuri, Santa Clara, California]
[March 29, 2018, Arya Raychaudhuri, Santa Clara, California]
Please, note that the goal of the current circuit and its simulation is to demonstrate differenced output. In order to achieve reasonable (low) output impedance and amplitude level (higher), gain buffer stages need to be added to the output.
***
Item#423> A differential amplifier with an analog buffer stage from Item#410
[March 29/31, 2018, Arya Raychaudhuri, Santa Clara, California]
The input stages (left) are the same as the inverting buffer stages of Item#410. So,
Vpx1 = -K1*Vin1 + offset
Vpx2 = -K1*Vin2 + offset
The two stages in the middle are the difference stages, where both NMOS fets work in saturation in each stage. But, as explained in Item#415, the current should linearly follow the instantaneous gate drives in each stage (see also in the simulation below). Ipx3 flows through the MNTX03, and the Ipx4 through the MNTX04
Ipx3 = K2*(Vpx1 - Vpx2) = K2*K1*(Vin2-Vin1)
[when Vpx1>Vpx2]
= 0 [when Vpx2>Vpx1]
Ipx4 = K2*(Vpx2 - Vpx1) = K2*K1*(Vin1-Vin2)
[when Vpx2>Vpx1]
= 0 [when Vpx1>Vpx2]
When Ipx3/Ipx4 is 0, the Vpx3/Vpx4 must be 1.8V, because, otherwise there would be currents through the top saturation connected NMOS fets. When the Ipx3/Ipx4 are non-0, the Vpx3/Vpx4 must linearly follow the Ipx3/Ipx4 as discussed in Item#415. Hence,
Vpx3 = 1.8 - K3*Ipx3 = 1.8 - K1*K2*K3*(Vin2-Vin1)
[when Vpx1>Vpx2]
= 1.8 [when Vpx2>Vpx1]
Vpx4 = 1.8 - K3*Ipx4 = 1.8 - K1*K2*K3*(Vin1-Vin2)
[when Vpx2>Vpx1]
= 1.8 [when Vpx1>Vpx2]
Since Vpx4 is getting applied to the top linear NMOS of the output stage, when Vin2>Vin1, the midpoint voltage "vout" is getting pulled towards the higher potential 1.3V. Similarly, the Vpx3 (when Vin1>Vin2) pulls the "vout" towards 0 using the lower NMOS's linear resistance. This gives rise to the differentiated output in synch with the Vin2-Vin1. The output stage is basically a gate controlled potential divider.
[March 29, 2018, Arya Raychaudhuri, Santa Clara, California]
Please, note that the power consumption (see top pane) is about 18mW.
***
Item#422> Amplitude modulation (AM) circuit (Item#420) applied to a PWL waveform
[March 27, 2018, Arya Raychaudhuri, Santa Clara, California]
The above simulation indicates that the AM circuit can be applied to random input waveforms
***
Item#421> Amplitude modulation (AM) circuit (Item#420) simulated
[March 19, 2018, Arya Raychaudhuri, Santa Clara, California]
The circuit would still function, and at a much lower power consumption, if the W values for the fets in the output stage of the audio buffer are reduced proportionately, e.g., 60u for the Pfet, and 15u for the Nfet. The circuit has been simulated with W values of 240u and 60u respectively.
The FFTs of the input Audio tone and the extracted Audio tone shown below - the extracted showing reasonable SNR
[March 27, 2018, Arya Raychaudhuri, Santa Clara, California]
***
Item#420> An amplitude modulation (AM) circuit using two CMOS analog buffers of Item#410
[March 19, 2018, Arya Raychaudhuri, Santa Clara, California]
The idea is to apply the level shifted and buffered Audio signal as the power suply to the second stage of the carrier freq buffer. The top buffer is the Audio buffer, and the bottom buffer is the carrier frequency buffer. The 1K resistance at the output is just a place holder for power amplifiers, the antennas and the space between the transmitter and the receiver - just to indicate the basic scheme.
***
Item#419> AC equivalent circuit of the output stage in the analog buffer of Item#410
Considering the high frequency bandwidth of 10Hz to 1 GHz, ignoring the capacitances in the structure
[March 24, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that the Gm of 0.0065 A/V is calculated from Ipx=4.733mA for Vpx1=728.67 mV (see Item#418).
The equivalent circuit is valid for Vpx1 between 0 and 800mV.
The following plot shows the measurements of Vpx2 versus calculations at various Rload points for three Vin swing values of 800mv, 400mV, and 200mV.
VVin vin 0 SINE(0.4 0.4 1000 0 0 0)
VVin vin 0 SINE(0.4 0.2 1000 0 0 0)
VVin vin 0 SINE(0.4 0.1 1000 0 0 0)
[March 25, 2018, Arya Raychaudhuri, Santa Clara, California]
While the trends are matching, there is some noticeable underestimation (~20mV), particularly at Vin=400mV. This can be reduced for a particular load value by choosing an appropriate (higher) Gm, in place of the 0.0065 A/V used in the calculations.
***
Item#418> Linear regression to get more accurate Output Resistance Ro than in Item#417
Both in Item#410 and in Item#417, the Ro was found using only two data points, and solving the following equations algeraically:
Vpx2= Voc* Rload/(Rload+Ro) [Item#410]
(Vpx - Vpx2)/Rp = Ip [Item#417]
A better ways is to get the Ro through linear regressioon using multiple points, as shown below
[March 24, 2018, Arya Raychaudhuri, Santa Clara, California]
Please, note that this approach (using the top equation above) overestimates Voc by 5mV (from simulation measured 929 mV).
[March 24, 2018, Arya Raychaudhuri, Santa Clara, California]
This approach (using the Thevenin equivalent) gives a closer match on Voc.
One interesting point to note is that the Thevenin voltage source (Vpx in Item#417) value of 4291.9 mV has no physical meaning - just a transformational entity. So is also the current through the parallel Rp in the Norton's equivalent.
The Ipx current source (4.733 mA) corresponds to the Gm*Vpx1, for the PMOS where Vpx1 is the ac swing input to the stage2 PMOS (see Item#410). If I measure the current swing through the stage2 PMOS
MPTX02 voffset vpx1 vdd vdd PMOS L=0.045um W=12um
with its input (vpx1) coming from the first stage, source tied to Vdd, and drain tied to Voffset, I get a current swing of 4.8mA, this is close 4.733mA computed above. The Voffset is the lowest voltage the PMOS swings to (~110mV), and it comes from the Vpx2 curve in Item#410. Why does the offset happen? All the voltage points on the Vpx2 curve are obtained by intersecting the Ids-Vds curves of the NMOS and the PMOS at various Vpx1 points. Since the same current must flow through both fets. And, the current through the PMOS is not exactly 0 when the Vpx1 is 800mV. This non0 current when flowing through the NMOS creates the offset at Vpx2.
One should not be too worried about the output impedance, because it can be easily controlled (brought down) through the relative aspect ratios in the output stage - as we see in Item#s 420,421.
***
Item#417> Looking at the Output Resistance of the Analog Buffer of Item#410
[March 24, 2018, Arya Raychaudhuri, Santa Clara, California]
Please, note that the AC resistance is found by measuring from the simulation the instantaneous currents through and voltages across the output NMOS, and plotting them as shown above.
In order to find the Thevenin equiv voltage Vpx, and the Rp, I measure from the simulation the values of Vpx2, Ip, In, IL for two load R values - 2000 Ohms and 500 Ohms.
[March 22, 2018, Arya Raychaudhuri, Santa Clara, California]
All the voltages and currents measured indicate the ac swing (max to min) values, ignoring any dc components from superposition considerations. Rough checks: for Rload of 500, IL=682/500 =1.364 mA from Vpx2, In=682/250 =2.728 mA, etc. The match is not perfect but close.
Now, noting from the Thevenin transformed equivalent circuit above, (Vpx - Vpx2)/Rp = Ip
Hence, (Vpx-853)/(Vpx-682) = 3.791/3.980
--> Vpx = 4283 mV, Rp= 905 Ohms
Untransforming the Vpx/Rp to the original Norton's equivalent, Ipx = 4.733mA
The output resistance Ro is a parallel combination of Rp and Rn, Ro = 196 Ohms
This value is somewhat higher than the 179 Ohms derived in Item#410, using Vpx2= Voc* Rload/(Rload+Ro), but, close.
Can we get the values of Rp=~ 905 Rn=~250 from the dc Id-Vds measurements? Yes.
[March 22, 2018, Arya Raychaudhuri, Santa Clara, California]
Note that for the PMOS, when Vpx2 changes for a particular Vgs, the current can only change along the nonIdeal saturation Ids rise line, but, the case with the load NMOS is different, due to its different connection. Rp is basically delta(VPX2)/delta(IP), and Rn is delta(VPX2)/delta(IN)
Can we retrieve the Voc (no Rload) and In using the Ipx, Ro, Rn as above? Let's see. From voltage swing measurements, Voc=929mV, In=3.696mA. Using, Ipx and Ro, Voc= Ipx*Ro = 4.733*196 = 927.67 mV, In = 927.67/250 = 3.71mA; quite close.
***
Item#416> Revised (from Item#410) equation of the buffer for with resistive load situation
With this linearity (Item#415) in mind, the no-load equation of Item#410 can be revised to a with-load case
k1*((VDD-Vin) - Vth1) = k2*(Vpx1 - Vth2) + Vpx1/R
--> (k1/k2)*((VDD-Vin) - Vth1) = Vpx1(1+1/(k2*R)) [since Vth2=0]
--> Vpx1 = ((k1/k2)/(1+1/(k2*R)))*(0.8 - Vin) [since VDD=1.8, Vth1=-1]
Considering a k2 value of >0.01, the term 1/(k2*R) is less significant with respect to 1 for values of R as low as 1KOhms. In order to reduce the output resistance of the buffer, while maintaining Vpx1 level, both k1 and k2 have to be scaled up by a factor. Output resistance will reduce by the same factor. But, the power consumption will go up by the same factor as well.
A graphical representation of the above equation is shown below
[March 21, 2018, Arya Raychaudhuri, Santa Clara, California]
Since it is not easy to compute accurate k1 (actually, linear K1/2) and k2 (actually linear K2/2) in saturation for the short channel Fets used, the k1/k2 value is used from simulation measurement of (output swing/input swing). The k2 (actually, K2/2) value is used from Item#415's linear extraction. The discrepancy between the computed and the measured curves for lower R values would lessen if a more realistic saturation k2 was used, probably around 6e-3.
***
Item#415> How the linearity of the buffer with loading (see Item#412) is a result of the channel length modulation (Early voltage effect) on the saturation currents
[March 17, 2018, Arya Raychaudhuri, Santa Clara, California]
Please, note the linearity of the NMOS indicated by the red straight line superimposed on the Id-vpx1 curve (green) for the gate-drain tied NMOS. In contrast, the squareroot law curve (light blue) represents the ideal (no channel length modulation) Id-vpx1 dependence. The ideal curve is computed just for reference. The following panel shows similar linearity for the PMOS
[March 19, 2018, Arya Raychaudhuri, Santa Clara, California]
So, this is an amplifier that takes advantage of the channel length modulation effect in short channel MOSFETs to achieve linearity over a large input signal span (compared to supply voltage) - small to large signal range. The ideal square law curve gets stretched like a rubber band to make it linear under the impact of short channel length modulaton - making the latter effect welcome in this case.
In computing the ideal square law curve (NMOS), a K2/2 value of 11e-3 was used. This is just a rough number - used only to get a physical picture of the square law dependence that helps explain the "stretching". For example, if the K2 is extracted from the linear region of a 3um/0.045um NMOS, a value of 21.69e-3 (~22e-3) is found (see below). So, for a 4um/0.045um NMOS, K2/2 should be around 14.45e-3, to be more accurate. But, then the linear region K2 definitely falls due to mobility degradation into the saturation - and this can happen differently for NMOS and PMOS.
[March 21, 2018, Arya Raychaudhuri, Santa Clara, California]
In reality, the square law curve has no value for a sub-100nm fet. Only thing that needs to be checked is if the gate-drain tied NMOS has its drain current sufficiently linear with respect to the drain bias (see the red line suerimposed on the green curve). If so, the buffer can work as a linear amplifier.
***
Item#414> Extending the unity gain buffer of Item#410 to get higher small signal gain
[March 15, 2018, Arya Raychaudhuri, Santa Clara, California]
Please note the larger W for the PMOS of the second stage needed - still within reasonable power consumption of 12mW. No biasing currents needed. Only need to make sure the PMOSes work in saturation, and none get into cutoff. The input and output waveforms are redrawn below on the same scale for better visual appreciation
[March 15, 2018, Arya Raychaudhuri, Santa Clara, California]
***
Item#413> Ramp and DC inputs to the unity gain buffer of Item#410
[March 15, 2018, Arya Raychaudhuri, Santa Clara, California]
There is some dc offset at the output - that needs to be addressed. But, the structure works for Ramp and DC wafeforms as good as it works for sinusoids
***
Item#412> Voltage Gain versus Frequency on the unity gain buffer of Item#410, and also Linearity check with a load of 1K Ohms
[March 16, 2018, Arya Raychaudhuri, Santa Clara, California]
Good till 1GHz.
The following graph shows a linearilty check such as in Item#412, but, this time with a load of 1K Ohms. Input frequency 1KHz.
[March 16, 2018, Arya Raychaudhuri, Santa Clara, California]
Again, very linear. Slight non-linearity is due to the linear nature of the load R, and the non-linear nature of the output NMOS. It is interesting to note that the short channel effects in the sub-100nm FETs, as well as a smaller load current helps the linearity.
***
Item# 411> Linearity check on the unity gain buffer of Item#410
[March 14, 2018, Arya Raychaudhuri, Santa Clara, California]
Vout is seen to follow Vin in a linear fashion till the input swing of 800 mV as targeted.
More complex input than a single 1KHz tone:
[March 14, 2018, Arya Raychaudhuri, Santa Clara, California]
Works smoothly.
***
Item#410> Unity gain CMOS buffer to rebuild attenuated analog audio signal after it passes through transmission gates (see Item#405)
[March 13/21, 2018, Arya Raychaudhuri, Santa Clara, California]
Two inverting stages in series, to rebuild a 800mV swing 1KHz sine to 929mV swing 1KHz sine. Loking at a stage (e.g., 1st stage), if the PMOS threshold *magnitude* (1V) is denoted by Vth1, and the bottom NMOS threshold by Vth2, we can equate
k1*((VDD-Vin) - Vth1)^2 = k2*(Vpx1 - Vth2)^2 [same current]
--> Vpx1 = sqrt(k1/k2)* (VDD-Vin -Vth1) + Vth2
--> Vpx1 = sqrt(k1/k2)* (0.8 - Vin) [substituting values of VDD, Vth1, Vth2]
More realistically, if
I = f((VDD-Vin) - Vth1)
Vpx1 = f^-1 (I)
The above equation represents an inverting linear relationship between vpx1 and Vin, and is valid only if both fets are in saturation for the entirely of the input swing. Similar analysis for stage 2. Please, note that the above equation is meant for instantaneous voltages, and ignores any dc offsets.
Vth1 of 1V for VDD=1.8V to ensure no PMOS cutoff at max input swing of 800mV; and Vth2=0V to bring the floor of the output swing close to 0, and vpx1 lower so that PMOS remains in just saturation at the min of input swing (0V). W,L values are adjused to get a reasonable output impedance, and to control the Vpx1, Vpx2 points so that the PMOS always remains in saturation. The NMOSes are always in saturation by connection. This way, the PMOSes are being used as square law devices (squaring the input Vin), and NMOSes as squareroot law devices (squarerooting the current) - yielding a linear gain on Vin.
*PTM LP 45nm model used, with the Vth0s of NMOS, PMOS used as chosen above
***
All snippets presented here are strictly proprietary to LVS DEBUG SOLUTIONS LLC, any commercial use of these is prohibited, without proper distribution agreement with the owner
Arya Raychaudhuri
[the dates added to the drawings and plates indicate last edit dates]
This "code_snippets4" page is a continuation of the"code_snippets3" page.
- Naturally Recursive (YoYo) and Non-recursive Shell algorithms to find simple paths between specifiable vertices in mixed-multi graphs, including initial graph reduction
- Shell-based netlist flattener (edited), Tree extraction algorithms; finding specifiable nets impacted sub-Trees
- Rickshaw engine design, Braking equation
- Circular Aerofoil, Hydrofoil considerations, Simpler hydraulic press based Lift, Drag measurement scheme
- Series-parallel split with complex impedances
- Dynamic MOSFET symbol exemplified with digital state transition
- Hydraulic press boat speedometer
- ElectroMagnetic teeth for Pawl Rack/Gear
- Pawl Rack and Pawl Gear construction
- WindMill assist for PRP and Engine driven boats
- PawlRack-Pinion (PRP) boats with adjustable paddle-wheel bridges
**Without electricity there would be no electrical engineering**
- Multi-AC from train wheels, wind, river flow, Aeolipile based heat engine
- Multiple multi-AC generator configs - twin wheel, belt, single wheel
- Magnetization-Demagnetization cycles in multi-AC generators
- Lenz's law based multi AC generation from a single rotating disc
- DC to AC converter
- Windmill with Pawl and edited Nacelle/Shaft
- CVCC charger with depletion NMOS, and "green" battery, logic
- Circular motion "pipe"
- Piston-Pawl battery boost
- DC errors amplification
- Differential Amplifier utilizing the analog buffer
- An Amplitude modulation (AM) circuit with CMOS analog buffer
- Unity gain CMOS analog buffer
Copyright 2011 LVS DEBUG SOLUTIONS & 2012 LVS DEBUG SOLUTIONS LLC All rights reserved.
LVS DEBUG SOLUTIONS LLC
980 Kiely Blvd, Unit 308
Santa Clara, CA 95051
United States
ph: 1-408-480-1936
arya