![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
for learning
Diff: main.cpp
- Revision:
- 230:eff425844edf
- Parent:
- 229:c13dac18dee3
- Child:
- 231:53de35471dc7
diff -r c13dac18dee3 -r eff425844edf main.cpp --- a/main.cpp Wed Dec 30 04:54:52 2020 +0000 +++ b/main.cpp Wed Dec 30 06:33:47 2020 +0000 @@ -1,4 +1,4 @@ -//201230_1 +//201230_2 #include "mbed.h" #include "FastPWM.h" #include "INIT_HW.h" @@ -199,77 +199,71 @@ float input_NN[num_input] = { 0.0f }; const float h1[num_input][16] = { - {0.21710851788520813f,-0.05835658311843872f,0.12024858593940735f,-0.31008681654930115f,-0.0982133150100708f,-0.17835518717765808f,-0.1628284603357315f,0.0627439022064209f,-0.2620668113231659f,-0.05229143425822258f,-0.1862572282552719f,-0.3528204560279846f,0.2787628173828125f,0.2949141561985016f,-0.2396446317434311f,0.1873062551021576f}, -{-0.1646273285150528f,0.15895842015743256f,-0.36603355407714844f,-0.1901821345090866f,-0.2621099054813385f,0.1840967983007431f,-0.3777896761894226f,-0.05303867906332016f,-0.0715283527970314f,0.1800564080476761f,-0.2212582379579544f,-0.03985835984349251f,0.056893475353717804f,-0.07665825635194778f,-0.1953967958688736f,0.13413189351558685f}, -{-0.1751502901315689f,0.1295098513364792f,0.33912619948387146f,-0.5264424681663513f,0.0014073352795094252f,-0.10263941437005997f,0.2676515281200409f,-0.05712807551026344f,-0.14674054086208344f,0.18135717511177063f,-0.29151666164398193f,0.39914262294769287f,-0.10191211849451065f,-0.03679787740111351f,0.05209478735923767f,-0.23318035900592804f}, -{0.08773957192897797f,0.059932585805654526f,0.3703531324863434f,0.1890704482793808f,-0.5685915946960449f,-0.9968946576118469f,-0.10795548558235168f,0.2569338381290436f,0.023257998749613762f,0.30387452244758606f,0.12322977185249329f,-6.214670658111572f,0.6218557357788086f,0.22927629947662354f,-0.27597576379776f,1.0344496965408325f}, -{-0.341019868850708f,1.716659426689148f,-0.004794687032699585f,3.811917543411255f,-0.44779855012893677f,5.250626564025879f,0.12058994174003601f,0.06565902382135391f,0.029530562460422516f,0.13024947047233582f,0.3581587076187134f,5.495739936828613f,0.32269057631492615f,0.2027294933795929f,-0.36018112301826477f,-1.535042405128479f}, -{-0.8380345106124878f,-1.3260560035705566f,0.20290347933769226f,2.5959393978118896f,1.4356293678283691f,0.30882853269577026f,0.15389427542686462f,-0.321927011013031f,0.030967984348535538f,0.13585081696510315f,-0.1967213749885559f,1.4991086721420288f,0.5693753957748413f,0.1478225290775299f,-0.38513508439064026f,0.9474997520446777f}, -{-0.683259904384613f,-0.8101462721824646f,-0.2331579178571701f,0.2851295471191406f,0.5227901339530945f,0.2213594615459442f,0.05604562163352966f,-0.3566524088382721f,0.340404748916626f,0.08874274045228958f,0.17397800087928772f,0.36228781938552856f,0.3637121319770813f,0.204885333776474f,-0.14554673433303833f,1.5621423721313477f}, -{0.2438136488199234f,-0.038819216191768646f,-0.24806702136993408f,0.26695358753204346f,-0.6833134293556213f,-0.45427772402763367f,-0.16704979538917542f,-0.364534467458725f,0.026426557451486588f,0.13160675764083862f,0.13139647245407104f,-0.5438024401664734f,0.2081027328968048f,0.0352388434112072f,0.04009982943534851f,0.8651177287101746f}, -{0.399420827627182f,0.7111073136329651f,0.09550115466117859f,-0.13722945749759674f,-0.6188552379608154f,0.09277452528476715f,-0.06753402948379517f,-0.4231712818145752f,-0.24982194602489471f,0.34706196188926697f,-0.24380797147750854f,0.08192895352840424f,0.018970858305692673f,0.11796440184116364f,-0.2847418785095215f,0.17251382768154144f}, -{0.38405391573905945f,0.42134660482406616f,0.17205187678337097f,-1.2010875940322876f,-0.6272928714752197f,-0.0024884298909455538f,-0.2786858379840851f,-0.11577512323856354f,-0.004904093686491251f,-0.41817817091941833f,0.025525355711579323f,-0.6284334659576416f,-0.0862298384308815f,-0.287846177816391f,0.3247623145580292f,-1.3453173637390137f}, -{0.6584739685058594f,0.8861123919487f,0.34649983048439026f,-2.0575315952301025f,0.0029634551610797644f,-0.1881372630596161f,-0.1895401030778885f,-0.016842292621731758f,-0.39519330859184265f,0.0457906648516655f,0.35786765813827515f,-0.6493228077888489f,-1.0070158243179321f,-0.1055193692445755f,0.24870619177818298f,-2.0926122665405273f}, -{-4.20821475982666f,-4.356006145477295f,-0.3757385015487671f,2.0618209838867188f,2.884111166000366f,2.543921947479248f,0.1429324448108673f,0.1709202378988266f,-0.1357613056898117f,0.2062210589647293f,-0.3532536029815674f,1.7752840518951416f,4.858647346496582f,-0.660963773727417f,0.09779238700866699f,0.7557253837585449f}, -{-2.1083571910858154f,-1.7688544988632202f,0.18496140837669373f,-0.46151071786880493f,1.474288821220398f,-0.7176749110221863f,-0.22405625879764557f,-0.03395454213023186f,-0.15607798099517822f,-0.1729339212179184f,-0.06886337697505951f,-0.29444989562034607f,1.2748531103134155f,-0.20135706663131714f,-0.2075144499540329f,-3.261737823486328f}, -{3.5962183475494385f,3.374176025390625f,0.38466766476631165f,-4.8142170906066895f,-4.66273307800293f,-3.462780237197876f,-0.2982172966003418f,-0.43583643436431885f,-0.10630133002996445f,-0.2060280591249466f,-0.1487589031457901f,-1.0152119398117065f,-3.2444868087768555f,0.49480560421943665f,0.04470124840736389f,-4.24110221862793f}, -{1.598503828048706f,0.5136365294456482f,0.18900898098945618f,0.017271745949983597f,-1.8248393535614014f,-4.067183971405029f,0.03916636109352112f,0.09532613307237625f,0.30280715227127075f,0.07684552669525146f,-0.22735022008419037f,-0.6214115023612976f,-1.3549392223358154f,0.2816005051136017f,0.062258750200271606f,-3.0343241691589355f}, -{-0.04581713676452637f,-0.8378515243530273f,-0.37685394287109375f,1.967070460319519f,0.19949127733707428f,-1.418633222579956f,-0.14507901668548584f,-0.17562240362167358f,0.20774737000465393f,-0.009641649201512337f,-0.40854886174201965f,0.4172761142253876f,-0.45967918634414673f,-0.012022500857710838f,-0.07684260606765747f,0.7026128768920898f}, -{0.32617276906967163f,-0.25086039304733276f,0.15568438172340393f,0.4640309810638428f,-0.37468042969703674f,-1.229672908782959f,-0.03859376907348633f,-0.1532677412033081f,-0.03914693370461464f,0.07321617752313614f,-0.29630669951438904f,-0.5918252468109131f,-0.3932393491268158f,0.29289379715919495f,0.2742314636707306f,-0.031258534640073776f}, -{-0.005290712229907513f,-0.07519976794719696f,0.19490453600883484f,0.5935949683189392f,-0.07097543030977249f,-0.3804037272930145f,-0.336474746465683f,-0.05229208618402481f,-0.3598732352256775f,-0.1231364756822586f,-0.12190809845924377f,0.367918998003006f,-0.08971880376338959f,-0.17653463780879974f,-0.2561379373073578f,0.7032476663589478f}, -{-0.06372973322868347f,0.033496905118227005f,-0.2776013910770416f,0.2678217589855194f,0.0578499510884285f,-0.6571398377418518f,0.25546005368232727f,-0.4622184932231903f,-0.35577359795570374f,0.017385512590408325f,-0.3627778887748718f,-0.1795680820941925f,-0.22878967225551605f,0.158436581492424f,-0.30415377020835876f,-0.32187676429748535f}, -{0.16661548614501953f,-0.004885958973318338f,0.1420871913433075f,0.045542508363723755f,-0.03160545229911804f,0.008304453454911709f,-0.13263443112373352f,-0.510770320892334f,-0.14304111897945404f,0.03424033150076866f,0.13338813185691833f,0.25419220328330994f,0.2775229215621948f,0.27265164256095886f,0.13351169228553772f,0.12091268599033356f}, -{-0.0903313085436821f,-0.22801446914672852f,-0.07561364769935608f,0.37586510181427f,-0.19908323884010315f,0.0550796203315258f,0.14428457617759705f,-0.14634819328784943f,-0.3402363657951355f,-0.2975690960884094f,-0.34984755516052246f,-0.16906507313251495f,-0.308422714471817f,0.31129270792007446f,0.019461065530776978f,0.37325340509414673f}, -{-0.040057551115751266f,-0.20191167294979095f,0.2631795108318329f,0.14898988604545593f,0.1371445208787918f,-0.5027453303337097f,0.27224990725517273f,-0.1382894366979599f,-0.04866792634129524f,0.08683944493532181f,0.07068000733852386f,0.2494114190340042f,-0.12455370277166367f,0.048056963831186295f,0.06011766195297241f,0.18133442103862762f}, + {-1.9263023138046265f,1.2565475702285767f,0.1310378611087799f,-0.7171328663825989f,-1.6638556718826294f,2.41223406791687f,-0.17743819952011108f,-0.12732535600662231f,0.197967529296875f,-2.4429471492767334f,0.6014160513877869f,-2.65081787109375f,-0.2751281261444092f,0.3872623145580292f,-0.2611466646194458f,-0.20388372242450714f}, +{-0.8760362267494202f,0.3863745629787445f,-0.3988758325576782f,-0.5291993021965027f,-0.5694252848625183f,1.2946312427520752f,-0.4116867780685425f,-0.22876569628715515f,0.1517363339662552f,-1.6561946868896484f,-0.45489057898521423f,-1.691250205039978f,0.23222962021827698f,-0.2950204908847809f,-0.21292872726917267f,0.01600177399814129f}, +{-0.9007099866867065f,0.6718482375144958f,0.36955419182777405f,-0.7104339003562927f,-0.4226318299770355f,1.0896837711334229f,0.2916664779186249f,-0.01620110124349594f,-0.02159370668232441f,-0.793718695640564f,-0.11682294309139252f,-1.2158480882644653f,-0.009753492660820484f,0.09420771151781082f,0.056768983602523804f,-0.2928417921066284f}, +{-0.8114799857139587f,0.8157651424407959f,0.40358296036720276f,0.06533468514680862f,-0.660064697265625f,0.09888201206922531f,-0.11764177680015564f,0.2820272743701935f,0.10149487853050232f,0.5306861996650696f,1.088588833808899f,0.11177092790603638f,-0.17443212866783142f,-0.09849850088357925f,-0.3007376194000244f,-0.02941063791513443f}, +{0.6717588305473328f,0.34743309020996094f,-0.005224883556365967f,0.38920730352401733f,-0.006901777349412441f,-1.0295268297195435f,0.13140985369682312f,-0.037608977407217026f,-0.11234983801841736f,1.7851743698120117f,1.2310711145401f,1.5052003860473633f,-0.0765354260802269f,-0.10877707600593567f,-0.39249828457832336f,-0.41519537568092346f}, +{3.8788771629333496f,-3.4141626358032227f,0.22110894322395325f,1.4132412672042847f,3.250668525695801f,-3.932023048400879f,0.16770240664482117f,-0.25149860978126526f,-0.6953557133674622f,2.5541324615478516f,-2.3852152824401855f,3.8622140884399414f,-0.27628305554389954f,-0.20555844902992249f,-0.4196912348270416f,-0.5049533843994141f}, +{-1.0910837650299072f,1.5310019254684448f,-0.2540779709815979f,-1.699008584022522f,-2.7678186893463135f,0.042158763855695724f,0.06107431650161743f,-0.8498121500015259f,0.947952926158905f,3.5080132484436035f,4.094943046569824f,1.3560343980789185f,-0.18150930106639862f,0.7762811183929443f,-0.15860587358474731f,-0.04692316800355911f}, +{0.021252449601888657f,-1.7117400169372559f,-0.2703247666358948f,-0.3658110499382019f,-0.7817240357398987f,0.3258049786090851f,-0.18203827738761902f,-0.5964152812957764f,-0.1708083301782608f,3.059142827987671f,0.6971661448478699f,-1.2719084024429321f,0.3709676265716553f,0.30348724126815796f,0.0436977744102478f,-0.03584130480885506f}, +{0.8466247916221619f,-1.7367573976516724f,0.10406997799873352f,-0.3620944023132324f,0.5412198901176453f,0.6309167146682739f,-0.07359349727630615f,-0.4533679187297821f,-0.784812331199646f,1.6026686429977417f,-1.393445611000061f,-0.8037490248680115f,0.22625578939914703f,0.26414215564727783f,-0.31029027700424194f,-0.14219065010547638f}, +{0.2616613805294037f,-1.2834594249725342f,0.18748918175697327f,0.006672881077975035f,0.7052662968635559f,0.3891584575176239f,-0.3036908507347107f,-0.04314374551177025f,-0.39671164751052856f,-0.029073715209960938f,-0.9029676914215088f,-0.8100889921188354f,0.37156444787979126f,-0.147613987326622f,0.35390153527259827f,-0.3667701482772827f}, +{0.2742692530155182f,-0.18266388773918152f,0.3775894343852997f,0.2890429198741913f,0.2838522493839264f,0.026181545108556747f,-0.20654654502868652f,0.025287557393312454f,-0.5715938806533813f,0.09734179824590683f,-0.40069374442100525f,-0.7974845767021179f,-0.07399006187915802f,0.16150778532028198f,0.2710213363170624f,-0.6254599094390869f}, +{-0.4190559983253479f,-0.13637374341487885f,-0.40945154428482056f,0.04590035229921341f,0.3266812860965729f,-0.28913336992263794f,0.15575703978538513f,0.332510769367218f,-0.14208796620368958f,0.4671242833137512f,-0.7784496545791626f,0.04069240391254425f,0.1405734419822693f,0.17514710128307343f,0.10656675696372986f,-0.28767532110214233f}, +{-0.1321425586938858f,0.10860586166381836f,0.2015570104122162f,0.3104243874549866f,0.4348571002483368f,-0.03878514841198921f,-0.24415965378284454f,0.010409981943666935f,-0.16880515217781067f,0.0960438922047615f,-0.218440443277359f,-0.2751259207725525f,0.08706702291965485f,0.1684483289718628f,-0.22613362967967987f,-0.5390941500663757f}, +{-0.07273829728364944f,-0.0028251938056200743f,0.41918185353279114f,0.21951936185359955f,-0.040497999638319016f,-0.3893090784549713f,-0.32497477531433105f,-0.5081345438957214f,-0.15358509123325348f,-0.06052562594413757f,-0.2989772856235504f,-0.008403073064982891f,-0.3239504396915436f,0.08852782845497131f,0.04871204495429993f,-0.030978143215179443f}, +{-0.1294948160648346f,0.2567782402038574f,0.20596781373023987f,0.21820449829101562f,0.14234144985675812f,-0.2349168062210083f,0.042680561542510986f,0.04373318701982498f,0.34865522384643555f,0.06248260661959648f,-0.023645654320716858f,-0.23440442979335785f,0.09878566116094589f,0.16271169483661652f,0.06784489750862122f,0.04550747200846672f}, +{-0.35847118496894836f,-0.5122860670089722f,-0.4106670916080475f,0.13450637459754944f,-0.2616882920265198f,-0.7916378378868103f,-0.15809619426727295f,-0.2441980242729187f,0.13642601668834686f,-0.29386720061302185f,-0.7606335282325745f,0.42109808325767517f,-0.28163331747055054f,0.29003897309303284f,-0.08373728394508362f,0.08965898305177689f}, }; const float h2[16][16] = { - {-0.26723405718803406f,3.436506986618042f,-0.06966331601142883f,-1.8851170539855957f,-0.21907491981983185f,0.291226863861084f,0.015459171496331692f,-0.1071208193898201f,-0.5817054510116577f,-0.1415480375289917f,2.841161012649536f,-0.7992897033691406f,-0.07293413579463959f,-0.4298669099807739f,-2.4861531257629395f,1.5274772644042969f}, -{2.6455771923065186f,0.8134444355964661f,0.057057321071624756f,-0.12591442465782166f,-0.35503754019737244f,0.26150521636009216f,-3.3769495487213135f,-0.6518222093582153f,-0.6712901592254639f,0.2895788848400116f,1.889601707458496f,-0.6946915984153748f,0.13749389350414276f,-2.4608261585235596f,-0.49290743470191956f,-2.1129796504974365f}, + {0.3930434584617615f,-0.2760046422481537f,-0.06966331601142883f,0.5573797225952148f,-0.21907491981983185f,3.0837783813476562f,-0.03645731136202812f,0.0904630720615387f,-0.43008196353912354f,-0.1415480375289917f,1.5400919914245605f,-0.3574032187461853f,0.0677378922700882f,-3.8898062705993652f,-0.21618182957172394f,0.11639698594808578f}, +{1.1674503087997437f,-0.4660412669181824f,0.057057321071624756f,-0.3536809980869293f,-0.35503754019737244f,-0.9374600052833557f,-0.5618715286254883f,-0.2990124225616455f,-0.33757925033569336f,0.2895788848400116f,0.6180537343025208f,-0.75235515832901f,0.1972428262233734f,0.28802400827407837f,-0.5070251822471619f,0.6845030784606934f}, {-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.796710729598999f,-0.10332272946834564f,-0.2894435524940491f,1.1835746765136719f,0.08946844935417175f,-1.047329306602478f,0.8074626326560974f,0.2824513912200928f,0.012639492750167847f,0.2953031361103058f,0.5696664452552795f,-0.08588860929012299f,-0.48111507296562195f,1.6103204488754272f,0.7986408472061157f,-0.21878749132156372f}, -{-1.3417195081710815f,-0.7138416767120361f,-0.25313520431518555f,-0.6614899039268494f,0.036378175020217896f,0.823881983757019f,-4.63653039932251f,-0.27306196093559265f,-0.06466124951839447f,-0.39465832710266113f,0.0016015330329537392f,-0.7870113253593445f,-0.06011026352643967f,-3.621800184249878f,2.5364484786987305f,-1.5223392248153687f}, -{0.6848915219306946f,-0.39380156993865967f,-0.3519742488861084f,0.38149240612983704f,-0.3015052080154419f,0.10571412742137909f,-0.9900799989700317f,-0.23774199187755585f,-0.7109643220901489f,0.3579089343547821f,-0.21304041147232056f,-0.40623411536216736f,-0.2862647473812103f,-2.199444532394409f,-0.03355676680803299f,0.7081170082092285f}, +{-0.017540471628308296f,-0.3439796566963196f,-0.2894435524940491f,0.36640626192092896f,0.08946844935417175f,-0.33021655678749084f,-0.5845211148262024f,0.4122363030910492f,0.26211628317832947f,0.2953031361103058f,-0.053512122482061386f,0.04363805800676346f,-0.5480604767799377f,-0.6265043020248413f,0.0729166567325592f,0.27252864837646484f}, +{1.785760521888733f,0.6541135311126709f,-0.25313520431518555f,0.44530224800109863f,0.036378175020217896f,1.108391523361206f,-0.5546870827674866f,-0.08570799231529236f,-0.024399548768997192f,-0.39465832710266113f,-0.25993049144744873f,-0.7607472538948059f,-0.1258891373872757f,-1.8423455953598022f,-0.4726662039756775f,1.5968234539031982f}, +{0.35434088110923767f,0.07735256105661392f,-0.3519742488861084f,0.0787750780582428f,-0.3015052080154419f,-0.020565737038850784f,-0.7396655678749084f,-0.019414573907852173f,-0.23047015070915222f,0.3579089343547821f,-0.6316982507705688f,-0.28874123096466064f,-0.35083094239234924f,2.651024341583252f,0.0053144171833992004f,-0.41491958498954773f}, {-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.04024162515997887f,0.37415388226509094f,0.33083590865135193f,-0.09207740426063538f,-0.14358049631118774f,-0.4130993187427521f,-0.09043094515800476f,-0.3092288076877594f,0.2600560486316681f,-0.37898191809654236f,0.2606242001056671f,-0.2890920341014862f,-0.41139593720436096f,0.344535231590271f,0.1222056895494461f,-0.016515038907527924f}, -{-0.2864131033420563f,0.3310338258743286f,-0.11379697918891907f,0.10645820200443268f,0.041274964809417725f,-0.35836148262023926f,-0.10284432768821716f,0.0019084513187408447f,0.06103590130805969f,-0.38046833872795105f,0.04191019758582115f,-0.3197441101074219f,-0.37024784088134766f,-0.28181442618370056f,-0.3813771605491638f,-0.22868402302265167f}, -{-0.10638687759637833f,0.18947477638721466f,-0.13502129912376404f,0.10904058068990707f,0.12987366318702698f,0.06331641227006912f,0.2711336314678192f,-0.3632148504257202f,-0.13619378209114075f,0.16938945651054382f,0.21176552772521973f,0.39862415194511414f,0.3811538517475128f,-0.20535631477832794f,0.04266967624425888f,-0.26521480083465576f}, -{-0.25592130422592163f,-0.027659105136990547f,0.0457797646522522f,-0.39426594972610474f,-0.03321319818496704f,-0.44821619987487793f,0.17873415350914001f,-0.20421427488327026f,-0.050184011459350586f,0.12480869889259338f,-0.2292342334985733f,0.3545852601528168f,-0.3647043704986572f,0.44143247604370117f,-0.3769301772117615f,-0.30688443779945374f}, -{0.518974244594574f,1.4600558280944824f,0.3954955041408539f,1.4798170328140259f,0.0033026933670043945f,1.93472158908844f,0.2169281542301178f,-0.16245169937610626f,0.2089681625366211f,-0.32520344853401184f,0.0831938162446022f,-0.5508549213409424f,0.005738466512411833f,0.4115873873233795f,-0.48970356583595276f,0.2728462219238281f}, -{-0.02581711858510971f,-3.642622470855713f,-0.15798500180244446f,2.601588726043701f,-0.37393757700920105f,-1.3707489967346191f,-0.0324789434671402f,-0.5317329168319702f,-0.8471572399139404f,0.2424570620059967f,-2.8096792697906494f,-0.7880776524543762f,0.20291848480701447f,0.5545087456703186f,-0.7411673665046692f,0.05684801563620567f}, -{0.008935408666729927f,0.23658603429794312f,-0.2018718123435974f,0.08555340766906738f,0.07545611262321472f,-0.0010491880821064115f,0.033573225140571594f,-0.24210108816623688f,-0.24509364366531372f,0.19522181153297424f,-0.11541958153247833f,-0.6472615599632263f,-0.24549134075641632f,-0.29431283473968506f,-0.12282686680555344f,-0.25719138979911804f}, +{0.3322710394859314f,0.45431244373321533f,0.33083590865135193f,0.05937234312295914f,-0.14358049631118774f,-0.18344715237617493f,-0.09043094515800476f,-0.3003333508968353f,0.2600560486316681f,-0.37898191809654236f,0.24461591243743896f,-0.31911081075668335f,-0.31673234701156616f,0.19626884162425995f,-0.04439463093876839f,0.45424115657806396f}, +{-0.0497419647872448f,0.3696230351924896f,-0.11379697918891907f,-0.22385191917419434f,0.041274964809417725f,-0.2552245557308197f,-0.4296785295009613f,0.0019084513187408447f,0.06103590130805969f,-0.38046833872795105f,0.22125406563282013f,-0.8607263565063477f,-0.5130627751350403f,-0.3908783495426178f,-0.4568846523761749f,0.15553812682628632f}, +{-2.3046605587005615f,0.4630797505378723f,-0.13502129912376404f,-0.24659167230129242f,0.12987366318702698f,0.19449545443058014f,-0.05609512701630592f,-0.3632148504257202f,-0.13619378209114075f,0.16938945651054382f,-0.820694088935852f,-0.15950720012187958f,0.030118972063064575f,-1.205933928489685f,-0.11094408482313156f,-1.9438313245773315f}, +{1.0933794975280762f,-1.103476643562317f,0.0457797646522522f,-1.0171253681182861f,-0.03321319818496704f,-0.8378584980964661f,-0.1470784991979599f,-0.20421427488327026f,-0.050184011459350586f,0.12480869889259338f,2.474815845489502f,-0.09593358635902405f,-0.5490431785583496f,0.4237048923969269f,-0.26588281989097595f,-2.009275197982788f}, +{0.9703730940818787f,0.0698828399181366f,0.3954955041408539f,0.11067237704992294f,0.0033026933670043945f,-0.19158247113227844f,-0.5137899518013f,-0.11795541644096375f,0.3487861454486847f,-0.32520344853401184f,1.5676788091659546f,-0.6331459879875183f,-0.05686356872320175f,-1.8892524242401123f,0.11558829993009567f,0.7225883603096008f}, +{-0.3041229844093323f,-0.2162615954875946f,-0.15798500180244446f,0.3624812960624695f,-0.37393757700920105f,0.36882126331329346f,0.11292675137519836f,-0.2947862446308136f,-0.3764709532260895f,0.2424570620059967f,-0.11332546174526215f,-0.2837170362472534f,0.41839322447776794f,-0.011782169342041016f,-0.1232791617512703f,0.1023411750793457f}, +{-0.46950092911720276f,0.6556989550590515f,-0.2018718123435974f,-0.22713492810726166f,0.07545611262321472f,-0.010944423265755177f,-0.24789650738239288f,-0.21416273713111877f,-0.24509364366531372f,0.19522181153297424f,-0.08138655126094818f,-0.5599690675735474f,-0.3073025345802307f,0.14553077518939972f,-0.16881777346134186f,-0.39995503425598145f}, {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}, -{-1.2283841371536255f,2.0610783100128174f,0.12081471085548401f,0.40022987127304077f,0.29976895451545715f,-0.09938766807317734f,-2.411539077758789f,0.22121109068393707f,-0.6443181037902832f,-0.02222958207130432f,1.4849238395690918f,-0.6256117820739746f,-0.358810693025589f,-0.5680041909217834f,-0.3835602104663849f,-0.5177282094955444f}, +{-0.3033992648124695f,0.266085147857666f,0.12081471085548401f,-0.2207726091146469f,0.29976895451545715f,-0.0031300950795412064f,-0.112851083278656f,0.31089308857917786f,-0.3893685042858124f,-0.02222958207130432f,0.24841265380382538f,-0.14615972340106964f,-0.19991017878055573f,0.10315173864364624f,0.2499116212129593f,0.09031006693840027f}, }; const float h3[16][16] = { - {-0.36079341173171997f,0.23955848813056946f,-1.1817095279693604f,-1.58957839012146f,-0.4517802894115448f,0.00593087263405323f,0.14463050663471222f,0.0036972183734178543f,-0.6693695187568665f,-0.21179355680942535f,-2.772231340408325f,-0.08654152601957321f,-1.4973424673080444f,-1.0522558689117432f,-0.02775469981133938f,-1.0456385612487793f}, -{0.047732532024383545f,-0.898144006729126f,-3.1017537117004395f,-1.381134033203125f,-0.3441418707370758f,0.5184141993522644f,-0.24482108652591705f,0.06247803568840027f,0.2504468262195587f,-0.1780138611793518f,-2.9596712589263916f,-0.3128277659416199f,0.34827539324760437f,0.25014761090278625f,-0.4353446960449219f,-2.2584781646728516f}, + {-0.36079341173171997f,-1.2573957443237305f,0.040910087525844574f,0.3814731240272522f,-3.4035985469818115f,0.7730768918991089f,0.21111074090003967f,0.14764496684074402f,-0.9359577894210815f,-0.18621651828289032f,-0.27539879083633423f,0.15890952944755554f,-0.5615507364273071f,0.51227205991745f,-4.039036750793457f,1.0741971731185913f}, +{0.047732532024383545f,0.3565322756767273f,-0.46046897768974304f,-0.20793941617012024f,-0.6533023715019226f,0.23362523317337036f,-0.3198729455471039f,0.06247803568840027f,1.70857834815979f,-0.0621853806078434f,0.4144817292690277f,-0.3128277659416199f,0.15687963366508484f,0.5943896174430847f,0.22744028270244598f,-1.0002206563949585f}, {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,-2.42948055267334f,1.2146846055984497f,2.071460485458374f,0.23535194993019104f,0.23716674745082855f,0.0023064776323735714f,-0.2272281050682068f,-0.6102874279022217f,-0.5878366827964783f,3.270146369934082f,-0.079141765832901f,-0.19914497435092926f,1.0818650722503662f,-0.21022048592567444f,-3.447765350341797f}, +{-0.30922991037368774f,-0.033454444259405136f,0.18039926886558533f,-0.9806683659553528f,-0.41112175583839417f,0.19335953891277313f,0.20021501183509827f,0.07002416253089905f,-0.2918536365032196f,-0.2972436845302582f,0.13192829489707947f,0.2577759921550751f,0.2827956974506378f,0.1766289323568344f,0.09490811824798584f,-0.5227937698364258f}, {-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,2.105287790298462f,-1.1706833839416504f,-0.07963728904724121f,0.49037525057792664f,-0.6520670652389526f,-0.24929550290107727f,0.07373787462711334f,-0.49333110451698303f,-0.2514972388744354f,0.6977552175521851f,-0.07344245910644531f,0.4499317705631256f,-0.6970130205154419f,0.24799692630767822f,-10.489715576171875f}, -{0.4110594093799591f,0.03259836509823799f,-1.3994123935699463f,-0.6297501921653748f,-3.9271013736724854f,-1.6792638301849365f,0.008842500858008862f,-0.34646254777908325f,-0.030661463737487793f,-0.06259563565254211f,-2.7556934356689453f,0.1246558353304863f,0.2790711224079132f,2.5501139163970947f,-0.0001432369026588276f,-1.7808431386947632f}, -{-0.40892091393470764f,0.12677159905433655f,-0.3778429329395294f,0.13786058127880096f,0.2654329240322113f,-0.23563161492347717f,-0.23312048614025116f,-0.390264093875885f,0.28059282898902893f,-0.1559126079082489f,-0.14134526252746582f,-0.0003446042537689209f,-0.09309493750333786f,-0.19106461107730865f,0.10737434774637222f,0.005298197269439697f}, -{0.10697010159492493f,0.1519632488489151f,-0.4634546637535095f,0.22168387472629547f,-0.2484942376613617f,-0.12435030937194824f,-0.1382003128528595f,0.3493293821811676f,-0.360889196395874f,-0.3875247836112976f,0.5694200396537781f,-0.3482915461063385f,-0.2985605299472809f,-0.3215094208717346f,0.09620395302772522f,-0.06898030638694763f}, +{-0.37449589371681213f,0.625716507434845f,-0.4491010904312134f,-0.5491208434104919f,0.9279378652572632f,1.095594048500061f,-0.260944664478302f,0.07231055200099945f,0.08413174003362656f,-0.5106105208396912f,-0.16709838807582855f,-0.06214549019932747f,0.1851106584072113f,0.11005591601133347f,-0.8136622309684753f,-1.1251161098480225f}, +{0.4110594093799591f,0.34814590215682983f,-0.23922504484653473f,0.352090060710907f,0.06119187921285629f,-0.030877234414219856f,-0.08670487999916077f,-0.25336313247680664f,-0.0018264445243403316f,-0.06259563565254211f,-0.1344406008720398f,0.35313835740089417f,0.4247180223464966f,0.14890721440315247f,0.5002304911613464f,-0.07689762860536575f}, +{-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.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.6347795724868774f,-2.843824863433838f,-0.8757935166358948f,-3.682453155517578f,0.11140545457601547f,-0.22749444842338562f,-0.21671739220619202f,-0.2897385358810425f,-0.561979353427887f,0.1738443821668625f,-0.6332975029945374f,0.02973129227757454f,-0.4262983202934265f,0.45153680443763733f,2.4266700744628906f}, -{-0.408692330121994f,0.07524891197681427f,0.07453340291976929f,-0.13479788601398468f,-0.012258211150765419f,-0.2789190411567688f,0.03285527229309082f,0.38763079047203064f,-0.20705322921276093f,-0.25883403420448303f,0.12809070944786072f,0.03996849060058594f,-0.4356187880039215f,-0.45683375000953674f,-0.31865036487579346f,0.34510013461112976f}, -{-0.2991822361946106f,0.26059526205062866f,0.02585286647081375f,-0.05932474136352539f,0.19066159427165985f,0.12553727626800537f,-0.11253207921981812f,0.34576353430747986f,0.04814547300338745f,-0.35770976543426514f,-0.044228196144104004f,-0.36229726672172546f,0.1342717409133911f,-0.24822832643985748f,0.25641894340515137f,-0.16869547963142395f}, -{-0.2675279378890991f,-0.038760922849178314f,0.8058972358703613f,0.568178653717041f,1.926482081413269f,1.051330804824829f,-0.6637630462646484f,-0.31893211603164673f,-0.684364914894104f,-1.2043099403381348f,1.0483613014221191f,-0.6093144416809082f,-0.6137930750846863f,-1.9366679191589355f,0.2598099410533905f,3.515615940093994f}, -{-0.015470266342163086f,0.5485411286354065f,1.72163987159729f,-0.12105733156204224f,-0.3831140995025635f,-1.352612853050232f,-0.5277559757232666f,-0.23413920402526855f,-0.6437380909919739f,-0.8957201242446899f,-0.650761604309082f,-0.5959860682487488f,0.7570517063140869f,-0.511589527130127f,-0.24105386435985565f,-1.6552906036376953f}, -{0.1863725483417511f,0.23044399917125702f,2.8924405574798584f,-0.16066978871822357f,-0.9396040439605713f,0.942517876625061f,-0.12535610795021057f,0.036833830177783966f,-0.41546201705932617f,-0.26821044087409973f,-0.645840585231781f,-0.044248316437006f,0.6587316393852234f,-1.3007421493530273f,-0.2326364666223526f,-1.1934552192687988f}, +{0.15459725260734558f,-1.024733543395996f,1.5995979309082031f,-0.27259764075279236f,1.8531973361968994f,-0.4125732183456421f,-0.1896437257528305f,-0.09550414979457855f,0.8162195086479187f,-0.4692074954509735f,-0.03073452040553093f,-0.4403654634952545f,-0.7513870596885681f,0.2037004828453064f,-0.38985106348991394f,-0.679223895072937f}, +{-0.408692330121994f,0.15358807146549225f,-0.005049536935985088f,-0.14826388657093048f,0.04159063100814819f,-0.10734297335147858f,0.03285527229309082f,0.38763079047203064f,-0.2802692949771881f,-0.25883403420448303f,0.12809070944786072f,0.03996849060058594f,-0.5361540913581848f,-0.155080184340477f,-0.1125597283244133f,0.22910350561141968f}, +{-0.2991822361946106f,0.2917288541793823f,-0.05491119995713234f,0.05698283389210701f,0.11121893674135208f,0.2120652049779892f,-0.11253207921981812f,0.34576353430747986f,-0.009147325530648232f,-0.35770976543426514f,-0.044228196144104004f,-0.36229726672172546f,0.015840977430343628f,-0.1431596428155899f,0.2668173611164093f,-0.11369534581899643f}, +{-0.2675279378890991f,0.9632195830345154f,0.08237414062023163f,0.01335200946778059f,0.6503732204437256f,2.186095714569092f,-0.40164005756378174f,-0.47299718856811523f,0.028843145817518234f,-0.7749390006065369f,-0.426748663187027f,-0.805156946182251f,2.5359153747558594f,-2.802044153213501f,0.6656530499458313f,0.1555715948343277f}, +{-0.015470266342163086f,-0.12394621968269348f,0.2639738619327545f,0.3263302147388458f,-0.00948211457580328f,-0.15729205310344696f,0.05196094512939453f,-0.008358269929885864f,-0.3483721613883972f,-0.38441595435142517f,0.13179203867912292f,-0.11511552333831787f,0.049904659390449524f,0.1933007687330246f,0.2793170213699341f,-0.6006680727005005f}, +{0.1863725483417511f,1.9955533742904663f,-1.5125445127487183f,-2.1903529167175293f,-2.3343093395233154f,-0.6709278225898743f,-0.06171078234910965f,0.022372597828507423f,1.1982965469360352f,0.1121712476015091f,-0.3996275067329407f,-0.07655775547027588f,1.0996713638305664f,-0.4334034025669098f,2.731156349182129f,-0.9261353015899658f}, }; -const float hout[16] = { 0.45773375034332275f,0.2386862337589264f,-0.2851997911930084f,-0.14161087572574615f,-0.17498421669006348f,0.20173802971839905f,-0.0029246758203953505f,0.057233236730098724f,0.06631378084421158f,0.12506327033042908f,0.270881712436676f,-0.1020549014210701f,-0.24224728345870972f,0.16140422224998474f,0.2347816675901413f,-0.12646318972110748f }; - -const float b1[16] = { 0.682098388671875f,1.3871639966964722f,-1.7145336866378784f,-1.186700701713562f,2.072877883911133f,2.73624849319458f,-0.058932315558195114f,0.8410549163818359f,0.5336584448814392f,-0.8973275423049927f,0.6093431115150452f,0.40226659178733826f,-0.4711519479751587f,-1.025956630706787f,-1.087764859199524f,4.489203453063965f }; - -const float b2[16] = { -0.4100606441497803f,-1.4202418327331543f,-1.4564176797866821f,-0.7459886074066162f,-0.6939148902893066f,-0.11409489065408707f,2.606159210205078f,-0.5281766057014465f,-1.3896151781082153f,-1.912178635597229f,-1.0096604824066162f,0.04112252593040466f,-0.30573347210884094f,1.7771672010421753f,0.9408959150314331f,1.509745717048645f }; - -const float b3[16] = { -1.963319182395935f,1.035247564315796f,-4.8930206298828125f,-0.12025665491819382f,0.3674905002117157f,1.4917001724243164f,-0.7277941703796387f,-0.9398375153541565f,0.036721598356962204f,-0.03335632383823395f,-3.3403966426849365f,-0.5037021636962891f,1.1861028671264648f,2.1023385524749756f,-1.3048676252365112f,-1.8699331283569336f }; - -const float bout[1] = { -0.25776052474975586f }; +const float hout[16] = { 0.45773375034332275f,0.26064226031303406f,-0.17057237029075623f,-0.5469655990600586f,-0.2567388415336609f,0.3050605058670044f,-0.13290652632713318f,0.031939368695020676f,-0.12028782069683075f,0.024037769064307213f,0.2350914627313614f,0.05371606722474098f,-0.265004962682724f,0.25206753611564636f,0.1956772357225418f,-0.3114655911922455f }; + +const float b1[16] = { 0.5379201173782349f,1.84296715259552f,-1.7145336866378784f,0.22539174556732178f,1.0134121179580688f,0.266745001077652f,-0.058932315558195114f,0.8392517566680908f,0.23837706446647644f,-3.764920949935913f,0.3289794325828552f,1.4759081602096558f,-0.37845921516418457f,-1.3195053339004517f,-1.087764859199524f,0.8869392275810242f }; + +const float b2[16] = { -0.13295456767082214f,-0.8680578470230103f,-1.4564176797866821f,-0.7611050009727478f,-0.6939148902893066f,0.37466126680374146f,0.08869245648384094f,-0.30969977378845215f,-1.20063054561615f,-1.912178635597229f,-0.6145949363708496f,0.16012702882289886f,-0.41398656368255615f,1.9892641305923462f,-0.06826551258563995f,1.1559383869171143f }; + +const float b3[16] = { -1.963319182395935f,-0.6572089791297913f,0.4422910213470459f,-0.13730330765247345f,-1.0939308404922485f,-0.1729484647512436f,-0.544198751449585f,-0.8099983930587769f,-0.5853098034858704f,-0.0038378052413463593f,-0.2999548017978668f,-0.2378028780221939f,-0.24946801364421844f,0.8335348963737488f,0.03452490642666817f,1.6327775716781616f }; + +const float bout[1] = { -0.2027367651462555f }; float valve_ref_pos_buffer[10] = {0.0f}; @@ -1044,7 +1038,7 @@ // input_NN[ind] = torq.sen / 10000.0f * 8.0f + 0.5f; input_NN[ind] = torq.sen / 10000.0f + 0.5f; ind = ind + 1; - for(int i=0; i<numfuture_f; i++) { + for(int i=1; i<numfuture_f; i++) { // input_NN[ind] = (f_future[time_interval*i+time_interval] - torq.sen)/10000.0f * 8.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*8.0f+0.5f; @@ -2357,12 +2351,12 @@ case MODE_VALVE_POSITION_CONTROL: { if (OPERATING_MODE == 5) { //SW Valve ////For Test LIMC////////////////////////////////////////// - VALVE_POS_CONTROL(valve_pos.ref); -// for(int i=0; i<9; i++){ -// valve_ref_pos_buffer[i] = valve_ref_pos_buffer[i+1]; -// } -// valve_ref_pos_buffer[9] = valve_pos.ref; -// VALVE_POS_CONTROL(valve_ref_pos_buffer[0]); +// VALVE_POS_CONTROL(valve_pos.ref); + for(int i=0; i<9; i++){ + valve_ref_pos_buffer[i] = valve_ref_pos_buffer[i+1]; + } + valve_ref_pos_buffer[9] = valve_pos.ref; + VALVE_POS_CONTROL(valve_ref_pos_buffer[0]); //////////////////////////////////////////////////////////// V_out = Vout.ref;