![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
LIGHT2
Diff: main.cpp
- Revision:
- 180:02be1711ee0b
- Parent:
- 179:d5377766d7ea
- Child:
- 181:2a8b5f3274be
diff -r d5377766d7ea -r 02be1711ee0b main.cpp --- a/main.cpp Mon Dec 14 05:27:22 2020 +0000 +++ b/main.cpp Tue Dec 15 00:19:25 2020 +0000 @@ -1,4 +1,4 @@ -//201214-1 +//201215-1 #include "mbed.h" #include "FastPWM.h" #include "INIT_HW.h" @@ -198,72 +198,72 @@ float input_NN[num_input] = { 0.0f }; const float h1[num_input][16] = { - {-0.6526780724525452f,0.7266743183135986f,0.12903714179992676f,-0.23237967491149902f,-0.9990780353546143f,0.7280523777008057f,-0.17472904920578003f,-0.3780243396759033f,-0.5318458676338196f,-0.6824988722801208f,-0.24376395344734192f,-1.2289026975631714f,-0.259793758392334f,-0.5339483022689819f,-0.2571594715118408f,-0.9135630130767822f}, -{-0.6027737259864807f,0.5964298844337463f,-0.3927857577800751f,-0.40050771832466125f,-0.8369812965393066f,0.3892684876918793f,-0.4054011106491089f,-0.3723553717136383f,-0.264297217130661f,-0.22327673435211182f,-0.2805407643318176f,-0.9518417716026306f,0.24001067876815796f,-0.9143947958946228f,-0.20967772603034973f,-0.5016147494316101f}, -{-0.5003423094749451f,0.3953498303890228f,0.36391180753707886f,-0.6117674708366394f,-0.35621193051338196f,0.361548513174057f,0.2872133255004883f,-0.059537652879953384f,-0.28272250294685364f,-0.01068309135735035f,-0.3544096052646637f,-0.7833338975906372f,0.0019771659281104803f,-0.2590618431568146f,0.05590221285820007f,-0.6216552257537842f}, -{-0.1946873813867569f,-0.1142597571015358f,0.39742106199264526f,0.20069332420825958f,-0.016939876601099968f,-0.28546977043151855f,-0.11584559082984924f,0.3479021489620209f,-0.01779201813042164f,0.38596200942993164f,0.08943979442119598f,-0.122506283223629f,-0.15994226932525635f,-0.14522784948349f,-0.2961459457874298f,-0.11170782893896103f}, -{0.6847711205482483f,-0.3565831780433655f,-0.0051451027393341064f,0.39627134799957275f,0.45064908266067505f,-0.4076618254184723f,0.1294034719467163f,0.16528914868831635f,0.07129872590303421f,0.6038545370101929f,0.34140077233314514f,-0.026348024606704712f,-0.06323867291212082f,0.27155500650405884f,-0.3865056037902832f,-0.07509569823741913f}, -{1.483199954032898f,-1.5428612232208252f,0.21773302555084229f,0.7692314386367798f,1.2946882247924805f,-1.288189172744751f,0.16514194011688232f,0.11058115214109421f,0.17132356762886047f,1.1954634189605713f,-0.25413116812705994f,0.6743490695953369f,-0.25959381461143494f,0.8003392219543457f,-0.4132833778858185f,0.46136754751205444f}, -{-0.8217329382896423f,0.7089616060256958f,-0.2501986622810364f,-0.875395655632019f,-1.1229442358016968f,0.9968200922012329f,0.06014183163642883f,-0.8439451456069946f,-0.05617062747478485f,-0.4700510501861572f,0.14294663071632385f,0.6414217352867126f,-0.1638868898153305f,-0.2370987981557846f,-0.15618428587913513f,-0.625933825969696f}, -{-0.463580846786499f,0.05003904551267624f,-0.26619744300842285f,-0.08971554040908813f,-0.7169193625450134f,0.23099951446056366f,-0.17925891280174255f,-0.6943695545196533f,-0.25526830554008484f,-0.034314900636672974f,0.09723648428916931f,0.6139658093452454f,0.38060376048088074f,-0.1769549399614334f,0.04303058981895447f,-0.12070699036121368f}, -{0.1414080113172531f,0.1877378225326538f,0.10248100757598877f,-0.30372604727745056f,-0.12201636284589767f,0.022746695205569267f,-0.07246989011764526f,-0.6118704676628113f,-0.42743170261383057f,0.6341602206230164f,-0.30540645122528076f,1.4260834455490112f,0.23858578503131866f,0.21455851197242737f,-0.30555272102355957f,0.25425052642822266f}, -{0.10944874584674835f,-0.5504550337791443f,0.18462657928466797f,0.05500239133834839f,0.38295459747314453f,-0.040897730737924576f,-0.2990540862083435f,-0.22474081814289093f,-0.1015893891453743f,0.014746497385203838f,-0.016399379819631577f,0.7377010583877563f,0.38201630115509033f,-0.09081173688173294f,0.3484981060028076f,0.18850760161876678f}, -{0.6069241166114807f,-0.18160517513751984f,0.37182438373565674f,0.39484986662864685f,0.2415466606616974f,-0.2599449157714844f,-0.20339298248291016f,-0.14145439863204956f,-0.5059540271759033f,0.4776276648044586f,0.34025880694389343f,0.7560402154922485f,-0.05657690018415451f,0.09265313297510147f,0.26688337326049805f,-0.17793112993240356f}, -{-0.23725034296512604f,-0.5791488885879517f,-0.40320003032684326f,0.0452105812728405f,0.27909013628959656f,-0.27708446979522705f,0.1533789038658142f,0.1997886300086975f,-0.24218705296516418f,0.5504290461540222f,-0.42232224345207214f,0.8678635358810425f,0.15488487482070923f,-0.013335001654922962f,0.10493969917297363f,0.015422948636114597f}, -{-0.0060953362844884396f,-0.2789563536643982f,0.19847965240478516f,0.0860355794429779f,0.38908523321151733f,-0.01648942194879055f,-0.2404318004846573f,-0.07731665670871735f,-0.2765587270259857f,0.02809620089828968f,-0.11712735891342163f,0.11512216180562973f,0.10241620987653732f,-0.06552530825138092f,-0.22268100082874298f,-0.31739288568496704f}, -{-0.17114806175231934f,-0.10933959484100342f,0.4127817749977112f,-0.2523573637008667f,-0.24868325889110565f,-0.3818814158439636f,-0.32001304626464844f,-0.5396589040756226f,-0.21919101476669312f,-0.10611488670110703f,-0.20302052795886993f,-0.15492098033428192f,-0.3021690249443054f,-0.19007131457328796f,0.0479682981967926f,0.15465888381004333f}, -{0.04039499908685684f,0.07923353463411331f,0.20282304286956787f,-0.21126452088356018f,0.2369239777326584f,-0.20800116658210754f,0.04202890396118164f,0.06752092391252518f,0.25217023491859436f,0.06576687842607498f,-0.2873592674732208f,-0.705759584903717f,0.11435109376907349f,-0.2376958578824997f,0.0668090283870697f,0.16948974132537842f}, -{-0.1650223582983017f,-0.30675071477890015f,-0.40439701080322266f,-0.3783135414123535f,-0.27307847142219543f,-0.09857283532619476f,-0.15568238496780396f,-0.08766567707061768f,0.21709603071212769f,-0.02477334812283516f,-0.4817592203617096f,-0.5585556030273438f,-0.2601439654827118f,-0.1273980438709259f,-0.08245879411697388f,0.2804436981678009f}, -{-0.0361105240881443f,-0.32941773533821106f,0.16706281900405884f,-0.1172998696565628f,0.01294353324919939f,-0.5389335751533508f,-0.041414469480514526f,0.1465616226196289f,0.04248951002955437f,0.21840494871139526f,-0.3614332377910614f,-0.21242284774780273f,0.12316523492336273f,0.3939219117164612f,0.29427415132522583f,0.3293007016181946f}, + {-1.2747926712036133f,0.8866214156150818f,0.12903714179992676f,0.1954565942287445f,-1.0775936841964722f,1.0385150909423828f,-0.17472904920578003f,1.2043118476867676f,-1.0528837442398071f,0.16233131289482117f,-0.23384490609169006f,-0.9654906988143921f,-0.26406702399253845f,0.45232266187667847f,-0.2571594715118408f,-1.4159953594207764f}, +{-0.9898881912231445f,0.5978912115097046f,-0.3927857577800751f,-0.10504250973463058f,-0.7563983798027039f,0.5094512104988098f,-0.4054011106491089f,1.1116833686828613f,-0.4969346523284912f,0.41541942954063416f,-0.2706531882286072f,-0.5124550461769104f,0.23551900684833527f,-0.0996662825345993f,-0.20967772603034973f,-0.7428423166275024f}, +{-0.6586143970489502f,0.2526506185531616f,0.36391180753707886f,-0.44479653239250183f,-0.12272748351097107f,0.29624244570732117f,0.2872133255004883f,1.3258525133132935f,-0.23638273775577545f,0.4212562143802643f,-0.34454482793807983f,-0.2005833387374878f,-0.002771292580291629f,0.36579757928848267f,0.05590221285820007f,-0.5957719087600708f}, +{-0.17435620725154877f,-0.34709569811820984f,0.39742106199264526f,0.23025836050510406f,0.31759893894195557f,-0.48005908727645874f,-0.11584559082984924f,1.618665337562561f,0.2961588501930237f,0.5570516586303711f,0.09927701205015182f,0.5736197233200073f,-0.1649491935968399f,0.2608615458011627f,-0.2961459457874298f,0.12930260598659515f}, +{0.7618234157562256f,-0.5603615045547485f,-0.0051451027393341064f,0.19888998568058014f,0.7619378566741943f,-0.606192409992218f,0.1294034719467163f,1.2932729721069336f,0.6787902116775513f,0.37368881702423096f,0.3512172996997833f,0.7094911336898804f,-0.06857605278491974f,0.38823315501213074f,-0.3865056037902832f,0.2566696107387543f}, +{1.4753985404968262f,-1.5749534368515015f,0.21773302555084229f,0.24970105290412903f,1.438091516494751f,-1.3410722017288208f,0.16514194011688232f,1.0581666231155396f,1.1054584980010986f,0.38477128744125366f,-0.2443389892578125f,1.3622721433639526f,-0.26528480648994446f,0.5235674381256104f,-0.4132833778858185f,0.7429633736610413f}, +{-0.1381414830684662f,0.32296326756477356f,-0.2501986622810364f,-0.6822501420974731f,-0.6484224200248718f,0.3961770534515381f,0.06014183163642883f,-1.9562623500823975f,0.14606209099292755f,-0.30881643295288086f,0.15261518955230713f,-0.10579380393028259f,-0.17127792537212372f,-0.04263466224074364f,-0.15618428587913513f,-0.033108823001384735f}, +{0.10407276451587677f,-0.17438587546348572f,-0.26619744300842285f,-0.10469675064086914f,-0.40487462282180786f,-0.18597395718097687f,-0.17925891280174255f,-1.6444649696350098f,-0.010120101273059845f,-0.23186346888542175f,0.10695241391658783f,-0.2862721085548401f,0.37284889817237854f,-0.23048385977745056f,0.04303058981895447f,0.28026261925697327f}, +{0.30488404631614685f,0.349077045917511f,0.10248100757598877f,-0.5642396211624146f,-0.1891011893749237f,0.013860803097486496f,-0.07246989011764526f,-1.5340245962142944f,-0.27067628502845764f,0.018050722777843475f,-0.2956160306930542f,0.1977348029613495f,0.23040179908275604f,-0.1158660352230072f,-0.30555272102355957f,0.28618332743644714f}, +{0.10323967039585114f,-0.2507255971431732f,0.18462657928466797f,-0.2965702414512634f,0.1769070029258728f,0.11360282450914383f,-0.2990540862083435f,-1.0921586751937866f,0.046090397983789444f,-0.784417986869812f,-0.0066079325042665005f,-0.54339599609375f,0.3733484447002411f,-0.531656801700592f,0.3484981060028076f,0.09402719140052795f}, +{0.5437068939208984f,0.12157454341650009f,0.37182438373565674f,0.10810510069131851f,0.017796188592910767f,-0.06259164214134216f,-0.20339298248291016f,-0.9021218419075012f,-0.41913050413131714f,-0.2746804654598236f,0.35008612275123596f,-0.3781108260154724f,-0.06551998108625412f,-0.29703405499458313f,0.26688337326049805f,-0.31737634539604187f}, +{-0.24231690168380737f,-0.3807550072669983f,-0.40320003032684326f,-0.135234072804451f,0.13232052326202393f,-0.12746357917785645f,0.1533789038658142f,-0.46155455708503723f,-0.13511259853839874f,-0.08907300978899002f,-0.41252845525741577f,0.06504666805267334f,0.14570680260658264f,-0.2993526756763458f,0.10493969917297363f,-0.09489677101373672f}, +{0.0872870460152626f,-0.23291699588298798f,0.19847965240478516f,0.02823140099644661f,0.37074705958366394f,0.040752362459897995f,-0.2404318004846573f,-0.586179256439209f,-0.11466588079929352f,-0.4817463457584381f,-0.10735541582107544f,-0.3017888367176056f,0.09303940832614899f,-0.2488478273153305f,-0.22268100082874298f,-0.37364980578422546f}, +{-0.051991432905197144f,-0.12674333155155182f,0.4127817749977112f,-0.19834384322166443f,-0.20412969589233398f,-0.3441471755504608f,-0.32001304626464844f,-0.9517143368721008f,-0.07627648115158081f,-0.5058509111404419f,-0.1932433545589447f,-0.2879234254360199f,-0.31180211901664734f,-0.30530187487602234f,0.0479682981967926f,0.06262191385030746f}, +{0.10936000198125839f,0.09897122532129288f,0.20282304286956787f,-0.03914237394928932f,0.2795373797416687f,-0.11763463914394379f,0.04202890396118164f,-0.4100075960159302f,0.23455728590488434f,-0.19801537692546844f,-0.27762651443481445f,-0.6615355014801025f,0.10450632870197296f,-0.29707828164100647f,0.0668090283870697f,-0.0025110316928476095f}, +{-0.07633624225854874f,-0.29659169912338257f,-0.40439701080322266f,-0.18466457724571228f,-0.17516319453716278f,-0.013456307351589203f,-0.15568238496780396f,-0.6675025224685669f,0.1871490478515625f,-0.28267568349838257f,-0.4720761179924011f,-0.25658828020095825f,-0.2701036036014557f,-0.2391444593667984f,-0.08245879411697388f,0.0812353640794754f}, +{-0.1064588725566864f,-0.12016399204730988f,0.16706281900405884f,0.007519781589508057f,-0.017588406801223755f,-0.26146987080574036f,-0.041414469480514526f,-0.6730034947395325f,-0.06899238377809525f,-0.18613839149475098f,-0.3516925573348999f,0.1851750761270523f,0.11302956193685532f,0.11544660478830338f,0.29427415132522583f,-0.08377157896757126f}, }; const float h2[16][16] = { - {-1.233986258506775f,1.6802256107330322f,-0.06966331601142883f,-0.005499060265719891f,-0.21907491981983185f,2.1583659648895264f,-0.038234543055295944f,0.0904630720615387f,-0.43008196353912354f,-0.1415480375289917f,-0.3416220247745514f,-0.20333009958267212f,-0.031739287078380585f,-1.315596342086792f,-0.19554688036441803f,-0.5387665629386902f}, -{0.38715651631355286f,-0.9310109615325928f,0.057057321071624756f,-0.06171989068388939f,-0.35503754019737244f,-0.85040283203125f,-0.8426902890205383f,-0.2990124225616455f,-0.33757925033569336f,0.2895788848400116f,-2.0213239192962646f,-0.858361005783081f,0.0845860168337822f,1.210322618484497f,-2.3236031532287598f,-0.8304648995399475f}, + {-0.48791801929473877f,0.6882094144821167f,-0.06966331601142883f,0.004637989681214094f,-0.21907491981983185f,0.06930378824472427f,0.07693875581026077f,0.036887940019369125f,-0.43008196353912354f,-0.1415480375289917f,-0.5828585028648376f,-0.32945704460144043f,-0.008075037971138954f,-1.5241717100143433f,-0.2089289128780365f,-0.7718607783317566f}, +{0.04395662993192673f,-1.437508463859558f,0.057057321071624756f,-0.12063508480787277f,-0.35503754019737244f,-0.8848034143447876f,-0.41094034910202026f,-0.34160447120666504f,-0.33757925033569336f,0.2895788848400116f,-1.4832773208618164f,-0.636014461517334f,0.19798265397548676f,0.9338656067848206f,-0.30581197142601013f,-0.20769454538822174f}, {-0.22745239734649658f,0.003037691116333008f,-0.061119019985198975f,0.35696902871131897f,0.05568113923072815f,0.011741191148757935f,-0.20225946605205536f,-0.08465918898582458f,0.3489862382411957f,0.0687277615070343f,0.31964078545570374f,0.3004753887653351f,0.36063823103904724f,-0.42892736196517944f,0.08652284741401672f,0.027493387460708618f}, -{-0.1391567885875702f,0.03293241187930107f,-0.2894435524940491f,0.25554025173187256f,0.08946844935417175f,0.1340968757867813f,-0.39087218046188354f,0.4122363030910492f,0.26211628317832947f,0.2953031361103058f,0.7025435566902161f,0.05798906087875366f,-0.5013425946235657f,-0.030901746824383736f,-0.06675297021865845f,-0.0446302704513073f}, -{-1.1762845516204834f,0.8597515821456909f,-0.25313520431518555f,0.19948269426822662f,0.036378175020217896f,1.304591417312622f,-0.5957030653953552f,-0.08570799231529236f,-0.024399548768997192f,-0.39465832710266113f,-3.7821712493896484f,-0.7977238893508911f,-0.022602174431085587f,-1.1103366613388062f,-0.7675935626029968f,-0.537284791469574f}, -{0.6562917828559875f,-0.22383058071136475f,-0.3519742488861084f,0.3241978883743286f,-0.3015052080154419f,-0.2545274496078491f,-0.744201123714447f,-0.019414573907852173f,-0.23047015070915222f,0.3579089343547821f,-2.186229944229126f,-0.48980283737182617f,-0.45957082509994507f,0.5824981927871704f,-0.22895494103431702f,-0.7663227319717407f}, +{0.07395064830780029f,-0.270321786403656f,-0.2894435524940491f,0.4473000168800354f,0.08946844935417175f,0.2554236948490143f,-0.23805393278598785f,0.35016298294067383f,0.26211628317832947f,0.2953031361103058f,0.2565111219882965f,0.38108423352241516f,-0.404754102230072f,-0.24778899550437927f,0.17891016602516174f,0.042497243732213974f}, +{-0.5532359480857849f,0.39376264810562134f,-0.25313520431518555f,0.1859339028596878f,0.036378175020217896f,0.017076050862669945f,-0.39785856008529663f,-0.1502944529056549f,-0.024399548768997192f,-0.39465832710266113f,-0.5060166716575623f,-0.6321212649345398f,-0.03745249658823013f,-0.5525979995727539f,-0.34934699535369873f,-0.5389713644981384f}, +{0.10334087163209915f,-0.846465528011322f,-0.3519742488861084f,0.1501602679491043f,-0.3015052080154419f,-0.7330282330513f,-0.4977985620498657f,-0.08387657254934311f,-0.23047015070915222f,0.3579089343547821f,-1.1615582704544067f,-0.32632172107696533f,-0.348274827003479f,0.9656168818473816f,0.16907939314842224f,-0.29072293639183044f}, {-0.1828227937221527f,-0.02554568648338318f,-0.3260969817638397f,0.08422836661338806f,-0.38453540205955505f,-0.25432005524635315f,0.285016268491745f,0.12387624382972717f,-0.0982072651386261f,0.13111665844917297f,-0.03692615032196045f,-0.32796353101730347f,-0.21546880900859833f,0.049302369356155396f,-0.27088475227355957f,-0.4124959409236908f}, -{-0.007747650612145662f,0.3667842745780945f,0.33083590865135193f,-0.38213321566581726f,-0.14358049631118774f,-0.2546055316925049f,-0.09043094515800476f,-0.3003333508968353f,0.2600560486316681f,-0.37898191809654236f,0.49078798294067383f,-0.3058888614177704f,-0.31673234701156616f,0.44664251804351807f,-0.9339061975479126f,-0.1061311885714531f}, -{-0.17694538831710815f,0.1767565757036209f,-0.11379697918891907f,-0.07116051763296127f,0.041274964809417725f,-0.517110288143158f,-0.10284432768821716f,0.0019084513187408447f,0.06103590130805969f,-0.38046833872795105f,-0.3456110656261444f,-0.24793067574501038f,-0.4166972041130066f,-0.30618393421173096f,-0.33565962314605713f,-0.48154377937316895f}, -{0.17107118666172028f,0.5849232077598572f,-0.13502129912376404f,-0.25706031918525696f,0.12987366318702698f,-0.15911895036697388f,-0.2777014970779419f,-0.3632148504257202f,-0.13619378209114075f,0.16938945651054382f,0.8441702723503113f,-0.19312366843223572f,0.1250869333744049f,-0.7533880472183228f,0.4421834349632263f,-0.4836709797382355f}, -{-0.25693249702453613f,-0.010147050023078918f,0.0457797646522522f,-0.3549601435661316f,-0.03321319818496704f,-0.4391511380672455f,0.17873415350914001f,-0.20421427488327026f,-0.050184011459350586f,0.12480869889259338f,-0.22192376852035522f,0.3545852601528168f,-0.3647043704986572f,0.4194667637348175f,-0.3910166025161743f,-0.2837793529033661f}, -{0.6847327947616577f,-0.020395293831825256f,0.3954955041408539f,0.1992696225643158f,0.0033026933670043945f,0.22936652600765228f,-0.8583166599273682f,-0.11795541644096375f,0.3487861454486847f,-0.32520344853401184f,-3.0311942100524902f,-0.5921090841293335f,-0.14213289320468903f,-0.5792467594146729f,0.9252750873565674f,-0.22471986711025238f}, -{-0.267646849155426f,-0.20429572463035583f,-0.15798500180244446f,0.3999568819999695f,-0.37393757700920105f,0.35770177841186523f,0.11292675137519836f,-0.2947862446308136f,-0.3764709532260895f,0.2424570620059967f,-0.10294663906097412f,-0.2837170362472534f,0.41839322447776794f,-0.02792874164879322f,-0.13706544041633606f,0.11999254673719406f}, -{0.2282707840204239f,-0.13254989683628082f,-0.2018718123435974f,-0.07019486278295517f,0.07545611262321472f,-0.33204764127731323f,-0.4035329520702362f,-0.21416273713111877f,-0.24509364366531372f,0.19522181153297424f,0.47974857687950134f,-0.8069085478782654f,-0.40297332406044006f,0.23708327114582062f,0.5259239673614502f,-0.3548051416873932f}, +{0.1127469465136528f,0.23652486503124237f,0.33083590865135193f,-0.08112672716379166f,-0.14358049631118774f,-0.01184199471026659f,-0.24124479293823242f,-0.33522558212280273f,0.2600560486316681f,-0.37898191809654236f,0.9399498701095581f,-0.3190816640853882f,-0.31673234701156616f,-0.6848183870315552f,-0.09104667603969574f,-1.2106350660324097f}, +{-0.5105041861534119f,0.2105989009141922f,-0.11379697918891907f,-0.07779005914926529f,0.041274964809417725f,-0.7625871300697327f,-0.26743561029434204f,-0.05350113660097122f,0.06103590130805969f,-0.38046833872795105f,-0.3830336034297943f,-0.5462559461593628f,-0.5090579390525818f,-0.52454674243927f,-0.3531858026981354f,-0.3511944115161896f}, +{0.6011585593223572f,1.278187870979309f,-0.13502129912376404f,1.4583508968353271f,0.12987366318702698f,0.8150514364242554f,0.2711336314678192f,-0.3632148504257202f,-0.13619378209114075f,0.16938945651054382f,1.0110341310501099f,0.3686404824256897f,0.3811538517475128f,-1.2410987615585327f,-0.6160189509391785f,-0.767787754535675f}, +{-0.28924494981765747f,0.015288889408111572f,0.0457797646522522f,-0.35267168283462524f,-0.03321319818496704f,-0.40105175971984863f,0.17873415350914001f,-0.20421427488327026f,-0.050184011459350586f,0.12480869889259338f,-0.1917455494403839f,0.3545852601528168f,-0.3647043704986572f,0.39774590730667114f,-0.41770800948143005f,-0.26388612389564514f}, +{0.10732869058847427f,0.20420478284358978f,0.3954955041408539f,0.14591671526432037f,0.0033026933670043945f,-0.09065821766853333f,-0.3228403925895691f,-0.1903812736272812f,0.3487861454486847f,-0.32520344853401184f,-0.0845566838979721f,-0.4106420576572418f,-0.05643285810947418f,-0.5659568309783936f,0.2659776210784912f,0.07771870493888855f}, +{-0.268172949552536f,-0.20979687571525574f,-0.15798500180244446f,0.3764939606189728f,-0.37393757700920105f,0.36793282628059387f,0.11292675137519836f,-0.2947862446308136f,-0.3764709532260895f,0.2424570620059967f,-0.10847131162881851f,-0.2837170362472534f,0.41839322447776794f,-0.01855253241956234f,-0.12935252487659454f,0.11022517085075378f}, +{0.1594800055027008f,1.2708461284637451f,-0.2018718123435974f,1.449450135231018f,0.07545611262321472f,0.7168979048728943f,-0.11297860741615295f,-0.21416273713111877f,-0.24509364366531372f,0.19522181153297424f,0.9486110210418701f,-0.28593289852142334f,-0.16718891263008118f,-0.6753664016723633f,-0.7633404731750488f,-0.614047646522522f}, {0.4138670265674591f,0.1604653298854828f,0.056746453046798706f,0.036025404930114746f,0.3228367865085602f,-0.07083973288536072f,0.018455177545547485f,0.0059362053871154785f,0.40515169501304626f,0.014240056276321411f,-0.07738298177719116f,0.1407785713672638f,-0.13024571537971497f,-0.29546058177948f,-0.11976784467697144f,-0.35825538635253906f}, -{-0.9196669459342957f,0.6476971507072449f,0.12081471085548401f,-0.2587197721004486f,0.29976895451545715f,-0.28450649976730347f,-0.39351940155029297f,0.31089308857917786f,-0.3893685042858124f,-0.02222958207130432f,-4.534346580505371f,-0.12242847681045532f,-0.2689415514469147f,0.007701616268604994f,-0.33597034215927124f,-0.652117908000946f}, +{-0.7413668632507324f,0.1026708334684372f,0.12081471085548401f,-0.3019435703754425f,0.29976895451545715f,-0.2089935541152954f,-0.19728951156139374f,0.24360427260398865f,-0.3893685042858124f,-0.02222958207130432f,-0.4988212287425995f,-0.3810131847858429f,-0.34082454442977905f,-0.5941631197929382f,0.2266225963830948f,0.0005180099396966398f}, }; const float h3[16][16] = { - {-0.36079341173171997f,-1.5671656131744385f,-1.394708514213562f,-0.4786093831062317f,0.8965405225753784f,-1.7463947534561157f,0.3332441747188568f,0.3036012351512909f,-0.5677260756492615f,0.04891335964202881f,-0.11870327591896057f,0.24536024034023285f,0.3745346665382385f,-2.4593026638031006f,-1.8527313470840454f,0.2478635460138321f}, -{0.047732532024383545f,-0.23476845026016235f,-1.3676623106002808f,-0.42602431774139404f,-0.48098695278167725f,0.4428248107433319f,-0.3198729455471039f,-0.09521423280239105f,0.2190944105386734f,-0.33393579721450806f,0.2562189996242523f,-0.3128277659416199f,1.0166772603988647f,2.1899778842926025f,-0.6944977045059204f,-0.7924290299415588f}, + {-0.36079341173171997f,0.1464584767818451f,-0.317361980676651f,-0.3760572671890259f,-0.34049099683761597f,0.17843884229660034f,0.3332441747188568f,0.3036012351512909f,-0.2405819296836853f,0.04891335964202881f,0.6647762060165405f,0.4001283347606659f,-0.22401779890060425f,0.4277285635471344f,-0.05822409689426422f,0.14648514986038208f}, +{0.047732532024383545f,0.14185985922813416f,-0.2746029794216156f,-0.4051361083984375f,-0.6855432391166687f,0.8004894852638245f,-0.3198729455471039f,0.06247803568840027f,2.051791191101074f,-0.6851478815078735f,1.94772207736969f,-0.3805152475833893f,-0.071693055331707f,1.0943926572799683f,-0.2973291873931885f,-0.2905019223690033f}, {0.07903262972831726f,0.2790505588054657f,-0.07798504829406738f,0.04248586297035217f,-0.1963958442211151f,-0.19260792434215546f,-0.4038352966308594f,0.015906542539596558f,0.15353140234947205f,0.030178606510162354f,0.2488909661769867f,0.13805970549583435f,-0.0816211998462677f,-0.20733052492141724f,-0.3036302626132965f,0.054825395345687866f}, -{-0.30922991037368774f,-0.16969707608222961f,0.3056027889251709f,-0.380797415971756f,-0.22033976018428802f,0.10660405457019806f,0.20021501183509827f,0.07002416253089905f,-0.25412267446517944f,-0.365601509809494f,0.13192829489707947f,0.41021624207496643f,-0.04961511492729187f,0.0815882533788681f,0.15073642134666443f,0.004613089840859175f}, +{-0.30922991037368774f,-0.027659641578793526f,0.1773041933774948f,-0.3788892924785614f,-0.39630311727523804f,0.24171951413154602f,0.20021501183509827f,0.07002416253089905f,-0.2705947756767273f,-0.4869213402271271f,0.55600905418396f,0.41021624207496643f,-0.18743380904197693f,0.22692470252513885f,0.18151329457759857f,-0.02565847523510456f}, {-0.39607733488082886f,-0.05481579899787903f,0.1976260244846344f,0.022423356771469116f,0.16892847418785095f,-0.27518749237060547f,0.16012099385261536f,0.3626593053340912f,-0.08640444278717041f,-0.11053556203842163f,-0.10529157519340515f,-0.31317979097366333f,-0.1530032455921173f,-0.1336749792098999f,0.22959044575691223f,0.19986507296562195f}, -{-0.37449589371681213f,-0.10077743977308273f,-2.5148682594299316f,-0.04963836818933487f,0.6845123767852783f,-0.18825586140155792f,-0.18732719123363495f,0.06602504104375839f,-0.43416672945022583f,-0.19430825114250183f,-0.2474861443042755f,0.034658562391996384f,-1.109938621520996f,-0.23138557374477386f,0.34683844447135925f,-1.0771756172180176f}, -{0.4110594093799591f,0.2715781033039093f,-0.38537508249282837f,0.37246426939964294f,-0.05490662157535553f,-0.009114405140280724f,-0.08670487999916077f,-0.25336313247680664f,-0.030661463737487793f,-0.06259563565254211f,-0.1344406008720398f,0.35313835740089417f,-0.13377737998962402f,0.25604528188705444f,0.3126353323459625f,-0.1528691202402115f}, -{-0.40892091393470764f,0.043769627809524536f,-0.3867315948009491f,0.25968697667121887f,0.3424709737300873f,-0.051169753074645996f,-0.23312048614025116f,-0.390264093875885f,0.28059282898902893f,-0.1559126079082489f,-0.14134526252746582f,-0.0003446042537689209f,-0.2742875814437866f,-0.36560842394828796f,0.07994696497917175f,0.005298197269439697f}, +{-0.37449589371681213f,0.040260959416627884f,0.06951090693473816f,0.17877109348773956f,0.4688447415828705f,-0.0568152479827404f,-0.18732719123363495f,0.22384825348854065f,-0.42837828397750854f,-0.16185910999774933f,0.15216808021068573f,0.19005391001701355f,0.07660079002380371f,0.06416161358356476f,0.40849316120147705f,-0.3371749818325043f}, +{0.4110594093799591f,0.2715781033039093f,-0.3257431089878082f,0.2142973244190216f,0.11818503588438034f,-0.05779394507408142f,-0.08670487999916077f,-0.25336313247680664f,-0.030661463737487793f,-0.06259563565254211f,-0.1344406008720398f,0.35313835740089417f,0.21155259013175964f,0.12332143634557724f,0.3126353323459625f,-0.3391006588935852f}, +{-0.40892091393470764f,0.0616367906332016f,-0.4007679224014282f,0.25968697667121887f,0.328382283449173f,-0.03144282102584839f,-0.23312048614025116f,-0.390264093875885f,0.28059282898902893f,-0.1559126079082489f,-0.1259572058916092f,-0.0003446042537689209f,-0.287761926651001f,-0.3555845618247986f,0.09450873732566833f,0.005298197269439697f}, {0.10697010159492493f,-0.12228584289550781f,-0.37870171666145325f,0.21184906363487244f,-0.37222859263420105f,-0.17138728499412537f,-0.1382003128528595f,0.3493293821811676f,-0.360889196395874f,-0.3875247836112976f,0.42142823338508606f,-0.3482915461063385f,-0.3289247751235962f,-0.2186824083328247f,0.09620395302772522f,-0.06898030638694763f}, {0.2847062647342682f,0.018552124500274658f,0.11435768008232117f,0.36562982201576233f,-0.047046810388565063f,0.30447837710380554f,0.2430230677127838f,0.2909286320209503f,-0.2802048921585083f,0.18043199181556702f,0.41849127411842346f,-0.287167489528656f,0.24394884705543518f,-0.14084559679031372f,-0.10168051719665527f,0.010465055704116821f}, -{0.15459725260734558f,0.22762465476989746f,0.9617792367935181f,-0.2233445942401886f,0.7956365942955017f,2.2177605628967285f,-0.08742031455039978f,0.05785742402076721f,-0.1277361363172531f,-0.37371426820755005f,-0.03133596479892731f,-0.30447322130203247f,-2.2757232189178467f,2.249086618423462f,0.46117544174194336f,0.18256771564483643f}, -{-0.408692330121994f,0.07260357588529587f,-0.02147701010107994f,0.0922636091709137f,-0.1529182642698288f,-0.05657944083213806f,0.03285527229309082f,0.38763079047203064f,-0.20705322921276093f,-0.25883403420448303f,0.12809070944786072f,0.03996849060058594f,-0.6609845757484436f,-0.1087266057729721f,-0.10636871308088303f,-0.0133456289768219f}, -{-0.2991822361946106f,0.3794580399990082f,-0.08715943992137909f,-0.05932474136352539f,0.11478022485971451f,0.3007120192050934f,-0.11253207921981812f,0.34576353430747986f,0.04814547300338745f,-0.35770976543426514f,-0.044228196144104004f,-0.36229726672172546f,0.05380958318710327f,-0.13672849535942078f,0.35829514265060425f,-0.10585878044366837f}, -{-0.2675279378890991f,-0.1429223269224167f,0.2487889677286148f,-0.1256239265203476f,0.010968400165438652f,-0.14684614539146423f,-0.32875844836235046f,-0.31893211603164673f,-0.5752826929092407f,-0.5557873845100403f,-0.5260127782821655f,-0.5674514770507812f,0.6408833265304565f,-0.28706681728363037f,0.264085978269577f,0.7492877840995789f}, -{-0.015470266342163086f,-0.4976375699043274f,0.6594434380531311f,0.14489558339118958f,-3.8797414302825928f,0.5358673930168152f,0.05196094512939453f,-0.008358269929885864f,-0.6339079737663269f,-0.38441595435142517f,0.13179203867912292f,-0.2711312472820282f,0.45540013909339905f,-1.2167638540267944f,0.08538639545440674f,-0.11235777288675308f}, -{0.1863725483417511f,0.13157431781291962f,-0.047772910445928574f,-0.49708226323127747f,0.6382043957710266f,-0.04539773613214493f,0.04860696196556091f,0.17769548296928406f,-0.050254471600055695f,0.19876523315906525f,-0.5504136085510254f,0.19592127203941345f,0.23928996920585632f,-0.0024931563530117273f,-0.1250786930322647f,0.041962411254644394f}, +{0.15459725260734558f,0.28715085983276367f,-0.1975911408662796f,-0.10847480595111847f,-0.338723361492157f,0.37625446915626526f,-0.08742031455039978f,0.05785742402076721f,0.5200075507164001f,-0.4833226799964905f,0.5273776054382324f,-0.30447322130203247f,-0.10086123645305634f,0.042644109576940536f,0.4391385018825531f,0.3226448595523834f}, +{-0.408692330121994f,-0.15486499667167664f,0.3066166341304779f,0.0922636091709137f,0.1873702108860016f,-0.4056578278541565f,0.03285527229309082f,0.38763079047203064f,-0.20705322921276093f,-0.25883403420448303f,0.12809070944786072f,0.03996849060058594f,-0.4213770925998688f,-0.472481369972229f,-0.3355949819087982f,0.31626954674720764f}, +{-0.2991822361946106f,0.3794580399990082f,0.06649655848741531f,-0.11694668978452682f,0.2296813577413559f,0.09872535616159439f,-0.11253207921981812f,0.34576353430747986f,0.04814547300338745f,-0.35770976543426514f,-0.044228196144104004f,-0.36229726672172546f,0.1595783829689026f,-0.28000524640083313f,0.36124154925346375f,-0.16869547963142395f}, +{-0.2675279378890991f,-0.1804099678993225f,0.5291721224784851f,-0.09164145588874817f,0.8961657881736755f,-0.9392423629760742f,-0.32875844836235046f,-0.31893211603164673f,-2.9557993412017822f,-0.6771930456161499f,-0.8014379739761353f,-0.6284971237182617f,0.332326203584671f,-1.0134690999984741f,0.3772561252117157f,0.20396418869495392f}, +{-0.015470266342163086f,-0.4175601005554199f,0.4652104079723358f,0.344943642616272f,0.1992327719926834f,-0.4663916528224945f,0.05196094512939453f,-0.008358269929885864f,-0.4575410783290863f,-0.5083949565887451f,-0.2538931965827942f,-0.11511552333831787f,0.3527691960334778f,-0.12093909084796906f,0.01653306372463703f,-0.45850178599357605f}, +{0.1863725483417511f,0.08846206963062286f,-0.050088606774806976f,-0.46936851739883423f,0.5272957682609558f,0.07133814692497253f,0.04860696196556091f,0.17769548296928406f,-1.3204635381698608f,0.06790181249380112f,-0.14967891573905945f,0.19592127203941345f,0.4656137526035309f,0.1081087589263916f,-0.06106513738632202f,-0.11734148859977722f}, }; -const float hout[16] = { 0.45773375034332275f,0.5733839869499207f,-0.6704624891281128f,-0.035915032029151917f,-0.26347172260284424f,0.4087086021900177f,0.0030125975608825684f,0.05245202034711838f,-0.0588601790368557f,-0.11953806132078171f,0.08675530552864075f,-0.15528400242328644f,0.2920013666152954f,0.373188316822052f,1.212536096572876f,-0.7900809645652771f }; - -const float b1[16] = { 0.5264097452163696f,1.0703750848770142f,-1.7145336866378784f,0.2382747083902359f,1.0430195331573486f,0.8539859652519226f,-0.058932315558195114f,1.0475828647613525f,0.5750831365585327f,-0.7904888987541199f,0.564017653465271f,0.7548366189002991f,-0.3627738058567047f,-0.8757394552230835f,-1.087764859199524f,1.5956077575683594f }; - -const float b2[16] = { 0.0007784571498632431f,-0.9460138082504272f,-1.4564176797866821f,-0.5824369788169861f,-0.6939148902893066f,0.038586944341659546f,0.07729385793209076f,-0.30969977378845215f,-1.20063054561615f,-1.912178635597229f,-0.15237417817115784f,0.17741809785366058f,-0.3301374316215515f,2.0171046257019043f,-0.16467103362083435f,0.6815829873085022f }; - -const float b3[16] = { -1.963319182395935f,-0.5293647646903992f,0.3431461751461029f,-0.23769626021385193f,0.11889180541038513f,0.7799785137176514f,-0.45353031158447266f,-0.8127179145812988f,0.36436596512794495f,0.37977612018585205f,-0.3018096387386322f,-0.10593394935131073f,-0.13431759178638458f,0.4824405014514923f,-1.3276978731155396f,-0.026577739045023918f }; - -const float bout[1] = { -0.17510902881622314f }; +const float hout[16] = { 0.45773375034332275f,0.3859798014163971f,-0.29981717467308044f,-0.03291182219982147f,-0.8433356881141663f,1.002862572669983f,0.0030125975608825684f,0.15066689252853394f,-2.8478612899780273f,-0.10332534462213516f,1.0703125f,-0.1749168038368225f,-0.3780519664287567f,1.3915053606033325f,0.34188297390937805f,-0.17065440118312836f }; + +const float b1[16] = { 1.1156562566757202f,1.2580926418304443f,-1.7145336866378784f,0.18262852728366852f,0.7823516130447388f,0.998382568359375f,-0.058932315558195114f,-1.9845973253250122f,0.21749649941921234f,-1.0451427698135376f,0.5739218592643738f,1.1615904569625854f,-0.3700066804885864f,-1.0825129747390747f,-1.087764859199524f,1.4952983856201172f }; + +const float b2[16] = { -0.3779629170894623f,-1.1113404035568237f,-1.4564176797866821f,-0.6393038630485535f,-0.6939148902893066f,-0.06903098523616791f,0.2865044176578522f,-0.3734967112541199f,-1.20063054561615f,-1.912178635597229f,-0.13764147460460663f,0.5186623334884644f,-0.21744106709957123f,2.212801933288574f,0.06957299262285233f,0.9868263602256775f }; + +const float b3[16] = { -1.963319182395935f,-0.5935878157615662f,-0.005241615232080221f,-0.24495701491832733f,0.04313206300139427f,0.9367193579673767f,-0.45353031158447266f,-0.6562485098838806f,-0.07319840788841248f,-0.035821571946144104f,-0.0942746177315712f,-0.0137743866071105f,-0.5863775610923767f,0.59046870470047f,-1.1678985357284546f,-0.3959362506866455f }; + +const float bout[1] = { -0.09139688313007355f }; /////////////////////////////////////////////////////////////////////////////////////////////RL float input_RL[num_input_RL] = { 0.0f }; @@ -999,8 +999,8 @@ //i2c - //read_field(i2c_slave_addr1); - //if(DIR_VALVE_ENC < 0) value = 1023 - value; + read_field(i2c_slave_addr1); + if(DIR_VALVE_ENC < 0) value = 1023 - value; //timer_while ++; @@ -1037,8 +1037,8 @@ input_NN[ind] = torq.sen / 10000.0f + 0.5f; ind = ind + 1; for(int i=0; i<numfuture_f; i++) { - input_NN[ind] = (f_future[time_interval*i+time_interval] - torq.sen)/10000.0f+0.5f; -// input_NN[ind] = (f_future[time_interval*i+time_interval])/10000.0f+0.5f; +// input_NN[ind] = (f_future[time_interval*i+time_interval] - torq.sen)/10000.0f+0.5f; + input_NN[ind] = (f_future[time_interval*i+time_interval])/10000.0f+0.5f; ind = ind + 1; } @@ -2830,7 +2830,8 @@ if (flag_data_request[3] == HIGH) { //PWM - CAN_TX_PWM((int16_t) (V[0]*100.0f)); //1500 + //CAN_TX_PWM((int16_t) (V[0]*100.0f)); //1500 + CAN_TX_PWM((int16_t) (torq.ref)); //1500 } if (flag_data_request[4] == HIGH) {