![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Original Version of STM Board
Diff: main.cpp
- Revision:
- 149:b273ae9cec75
- Parent:
- 148:24859a1574b4
- Child:
- 150:b0ac087118cc
--- a/main.cpp Fri Oct 09 07:04:54 2020 +0000 +++ b/main.cpp Fri Oct 09 08:17:17 2020 +0000 @@ -1,4 +1,4 @@ -//201009-3 +//201009-4 #include "mbed.h" #include "FastPWM.h" #include "INIT_HW.h" @@ -193,72 +193,72 @@ float input_NN[num_input] = { 0.0f }; const float h1[num_input][16] = { - {-0.5391774773597717f,0.39459413290023804f,0.12903714179992676f,0.23971417546272278f,-1.7553921937942505f,0.23461808264255524f,-0.17472904920578003f,0.07980377972126007f,-1.7674821615219116f,-0.09692216664552689f,-1.4786144495010376f,1.7235578298568726f,-0.29386940598487854f,0.12840086221694946f,-0.2571594715118408f,-0.24729375541210175f}, -{-1.0028589963912964f,0.8362699747085571f,-0.3927857577800751f,0.0013307844055816531f,-1.965639591217041f,0.4206589162349701f,-0.4054011106491089f,0.22024913132190704f,-1.7508646249771118f,0.16952082514762878f,-1.1074979305267334f,1.4081093072891235f,0.21232673525810242f,-0.6558182239532471f,-0.20967772603034973f,-0.5124022960662842f}, -{-1.474237084388733f,1.2080758810043335f,0.36391180753707886f,-0.27925029397010803f,-1.9039968252182007f,0.8235093951225281f,0.2872133255004883f,0.9463601112365723f,-1.8797903060913086f,0.18923968076705933f,0.001633316744118929f,-0.23820088803768158f,-0.019061915576457977f,-0.6907675266265869f,0.05590221285820007f,-1.611603856086731f}, -{-1.2989332675933838f,0.8199542164802551f,0.39742106199264526f,0.46377190947532654f,-1.5591282844543457f,0.14736711978912354f,-0.11584559082984924f,1.6680612564086914f,-1.0742555856704712f,0.3393990397453308f,1.8557710647583008f,-1.9931303262710571f,-0.17380963265895844f,-1.0808627605438232f,-0.2961459457874298f,-1.810049057006836f}, -{0.45903661847114563f,-0.26011842489242554f,-0.0051451027393341064f,0.5292483568191528f,-0.18269433081150055f,-0.8014674186706543f,0.1294034719467163f,0.5932726263999939f,0.43838661909103394f,0.17132964730262756f,2.395914077758789f,-2.7526845932006836f,-0.06959218531847f,-0.351777583360672f,-0.3865056037902832f,-1.196404218673706f}, -{4.024477481842041f,-3.9894824028015137f,0.21773302555084229f,0.7237673401832581f,3.1660914421081543f,-3.8389313220977783f,0.16514194011688232f,-3.125580072402954f,3.001132011413574f,0.19894488155841827f,-1.220471978187561f,2.2527618408203125f,-0.2577652335166931f,2.5225419998168945f,-0.4132833778858185f,2.8007524013519287f}, -{-0.011310599744319916f,0.24946507811546326f,-0.2501986622810364f,-0.8816968202590942f,-0.3686523735523224f,0.4924907982349396f,0.06014183163642883f,-1.6479686498641968f,1.9060884714126587f,-0.0017323290230706334f,3.273784875869751f,-5.7665486335754395f,-0.17935927212238312f,0.05504779517650604f,-0.15618428587913513f,0.05808372423052788f}, -{-0.22189822793006897f,-0.015988502651453018f,-0.26619744300842285f,-0.2079189419746399f,-0.3074694871902466f,0.4015502333641052f,-0.17925891280174255f,-2.8648953437805176f,0.23751555383205414f,0.06484299153089523f,0.26807937026023865f,-0.8434060215950012f,0.3709881901741028f,2.499021530151367f,0.04303058981895447f,1.0254873037338257f}, -{0.2375566065311432f,0.3459382653236389f,0.10248100757598877f,-0.576600968837738f,0.16235916316509247f,0.504014253616333f,-0.07246989011764526f,-2.952346086502075f,-0.2120700627565384f,0.3160681128501892f,-2.3957817554473877f,3.1422948837280273f,0.23466862738132477f,3.780216932296753f,-0.30555272102355957f,1.3122657537460327f}, -{-0.24045763909816742f,0.1584128737449646f,0.18462657928466797f,-0.31623831391334534f,0.19137167930603027f,0.8520259857177734f,-0.2990540862083435f,-0.9546290040016174f,-0.06860948354005814f,-0.4896220564842224f,-1.8186185359954834f,1.6129069328308105f,0.3821505606174469f,1.3353029489517212f,0.3484981060028076f,0.41309139132499695f}, -{0.3433090150356293f,0.34731683135032654f,0.37182438373565674f,0.03839244693517685f,0.38068631291389465f,0.43302610516548157f,-0.20339298248291016f,0.06754434108734131f,-0.07404784858226776f,0.02042931318283081f,-0.14464162290096283f,0.28650814294815063f,-0.05367383733391762f,-0.15681298077106476f,0.26688337326049805f,-0.2110361009836197f}, -{-0.2724418044090271f,-0.4098975658416748f,-0.40320003032684326f,-0.24393324553966522f,0.8852542638778687f,0.1408403366804123f,0.1533789038658142f,0.45686399936676025f,0.4720439910888672f,0.2046501338481903f,-0.3275690972805023f,0.4410105347633362f,0.1602371335029602f,-0.4212232232093811f,0.10493969917297363f,0.026777684688568115f}, -{0.0250006802380085f,-0.22699081897735596f,0.19847965240478516f,-0.11016523838043213f,1.081355333328247f,0.36846381425857544f,-0.2404318004846573f,0.3834404945373535f,0.2804113030433655f,-0.1921449899673462f,-0.22452819347381592f,0.06680287420749664f,0.11048870533704758f,-0.39280158281326294f,-0.22268100082874298f,-0.45355942845344543f}, -{-0.1391890048980713f,-0.13208922743797302f,0.4127817749977112f,-0.35954952239990234f,0.34895798563957214f,-0.03233657404780388f,-0.32001304626464844f,0.13076581060886383f,0.011575589887797832f,-0.21877500414848328f,-0.6484295129776001f,0.10535576194524765f,-0.2911722660064697f,-0.6765049695968628f,0.0479682981967926f,-0.1850130707025528f}, -{0.04523872956633568f,-0.09568798542022705f,0.20282304286956787f,-0.21763867139816284f,0.7222434878349304f,-0.01668154075741768f,0.04202890396118164f,0.9265015721321106f,0.007596075534820557f,0.09358415007591248f,-0.8935897350311279f,0.03570370003581047f,0.12766724824905396f,-0.5751539468765259f,0.0668090283870697f,-0.26897409558296204f}, -{-0.22048141062259674f,-0.5126572251319885f,-0.40439701080322266f,-0.36166179180145264f,-0.06317420303821564f,-0.026087496429681778f,-0.15568238496780396f,0.9305192232131958f,-0.4274589419364929f,0.00926499255001545f,-1.4270097017288208f,0.14081589877605438f,-0.2446974515914917f,-0.6733102202415466f,-0.08245879411697388f,-0.5800500512123108f}, -{0.0003174336743541062f,-0.7243605256080627f,0.16706281900405884f,-0.15288002789020538f,-0.0962081328034401f,-0.7339073419570923f,-0.041414469480514526f,1.0410723686218262f,-0.8618423938751221f,0.1065572202205658f,-2.380552053451538f,0.4902736246585846f,0.1410515010356903f,-0.4971206784248352f,0.29427415132522583f,-0.9882739782333374f}, + {-0.6169755458831787f,0.5948215126991272f,0.12903714179992676f,0.5884579420089722f,-0.9432981610298157f,0.4874749183654785f,-0.17472904920578003f,0.44460251927375793f,-1.3207292556762695f,-0.25449368357658386f,-0.2339312732219696f,0.47591209411621094f,-0.2703731060028076f,-0.03621765598654747f,-0.2571594715118408f,-1.745444416999817f}, +{-0.7696728110313416f,0.6025012135505676f,-0.3927857577800751f,0.18237116932868958f,-0.8556034564971924f,0.2768941819667816f,-0.4054011106491089f,0.2682054340839386f,-0.8353373408317566f,-0.0415828675031662f,-0.27073076367378235f,0.25327548384666443f,0.2294783890247345f,-0.5943036079406738f,-0.20967772603034973f,-0.903499186038971f}, +{-0.8678860664367676f,0.5725551247596741f,0.36391180753707886f,-0.2636171877384186f,-0.39811229705810547f,0.35338619351387024f,0.2872133255004883f,0.4132649600505829f,-0.44572967290878296f,-0.12256179749965668f,-0.34459352493286133f,-0.4546497166156769f,-0.008530620485544205f,-0.14337007701396942f,0.05590221285820007f,-0.20182473957538605f}, +{-0.6535317897796631f,0.16435904800891876f,0.39742106199264526f,0.3013381063938141f,0.0075928992591798306f,-0.28438887000083923f,-0.11584559082984924f,0.49083566665649414f,0.3678398132324219f,0.07045812904834747f,0.09927131235599518f,-0.8109145760536194f,-0.1704373061656952f,-0.11016498506069183f,-0.2961459457874298f,1.1189262866973877f}, +{0.2888871729373932f,-0.14343173801898956f,-0.0051451027393341064f,0.15250109136104584f,0.5875188708305359f,-0.5056445002555847f,0.1294034719467163f,-0.36446136236190796f,0.9410679936408997f,0.31322237849235535f,0.3512546122074127f,-1.3186581134796143f,-0.07376156002283096f,0.466142475605011f,-0.3865056037902832f,1.2423783540725708f}, +{1.3994739055633545f,-1.7239813804626465f,0.21773302555084229f,0.07611975073814392f,1.6012725830078125f,-1.651916265487671f,0.16514194011688232f,-1.6280549764633179f,1.2326716184616089f,1.3550405502319336f,-0.24429886043071747f,-0.15746863186359406f,-0.27015793323516846f,1.5229518413543701f,-0.4132833778858185f,0.44188135862350464f}, +{0.39866718649864197f,0.16642259061336517f,-0.2501986622810364f,-1.024619698524475f,-0.3439548909664154f,0.5203994512557983f,0.06014183163642883f,-0.23343060910701752f,0.9580716490745544f,-0.4035128057003021f,0.1511380523443222f,0.3182518780231476f,-0.17843955755233765f,-0.10459809005260468f,-0.15618428587913513f,-0.9287129044532776f}, +{0.0785316601395607f,-0.3670685589313507f,-0.26619744300842285f,-0.12710848450660706f,-0.5723583698272705f,0.009777887724339962f,-0.17925891280174255f,-0.3827355206012726f,-0.21057161688804626f,0.1923319697380066f,0.10589253902435303f,0.14203622937202454f,0.36342835426330566f,0.16098101437091827f,0.04303058981895447f,-0.22491160035133362f}, +{0.29670801758766174f,-0.035655878484249115f,0.10248100757598877f,-0.6135661005973816f,-0.36749836802482605f,0.15164998173713684f,-0.07246989011764526f,-0.6397947669029236f,-0.8155761361122131f,0.6950511932373047f,-0.29665613174438477f,2.0973360538482666f,0.22101281583309174f,0.40356382727622986f,-0.30555272102355957f,-1.191580891609192f}, +{-0.04192425310611725f,-0.4759320020675659f,0.18462657928466797f,-0.34934404492378235f,-0.09540810436010361f,0.33820977807044983f,-0.2990540862083435f,-0.2171635925769806f,-0.5427071452140808f,-0.20592382550239563f,-0.0075898440554738045f,1.2421354055404663f,0.3641347289085388f,-0.10239019244909286f,0.3484981060028076f,-1.1702260971069336f}, +{0.3629056215286255f,0.029816236346960068f,0.37182438373565674f,0.061602648347616196f,-0.20005883276462555f,0.17882686853408813f,-0.20339298248291016f,0.020882783457636833f,-0.658286988735199f,0.11572472006082535f,0.3491577208042145f,0.7644428014755249f,-0.07471837103366852f,-0.0018598255701363087f,0.26688337326049805f,-0.7226802706718445f}, +{-0.2780630886554718f,-0.5210357308387756f,-0.40320003032684326f,-0.1715334802865982f,0.07301802188158035f,-0.03441068157553673f,0.1533789038658142f,0.3054661154747009f,-0.04069248214364052f,0.3940032124519348f,-0.41339191794395447f,0.684217095375061f,0.13649077713489532f,0.1101810559630394f,0.10493969917297363f,-0.0066968477331101894f}, +{0.0321117527782917f,-0.27469030022621155f,0.19847965240478516f,0.008619049564003944f,0.27372124791145325f,0.147988423705101f,-0.2404318004846573f,0.08296826481819153f,0.005448771640658379f,0.001319614122621715f,-0.10822436213493347f,-0.006367080844938755f,0.08386833965778351f,0.16397559642791748f,-0.22268100082874298f,-0.20400726795196533f}, +{-0.1663299798965454f,-0.0762108862400055f,0.4127817749977112f,-0.18933038413524628f,-0.3754563629627228f,-0.1961674690246582f,-0.32001304626464844f,-0.29224878549575806f,-0.09518685936927795f,-0.08264501392841339f,-0.19418920576572418f,-0.10590852797031403f,-0.32082730531692505f,0.04110307991504669f,0.0479682981967926f,0.16589368879795074f}, +{0.06994720548391342f,0.0633668452501297f,0.20282304286956787f,0.006450027227401733f,0.17445866763591766f,-0.06924864649772644f,0.04202890396118164f,0.3091362416744232f,0.15688040852546692f,0.21616044640541077f,-0.27863019704818726f,-0.39659392833709717f,0.09555865079164505f,0.02592609077692032f,0.0668090283870697f,0.13379117846488953f}, +{-0.15547308325767517f,-0.2905401885509491f,-0.40439701080322266f,-0.11864195019006729f,-0.2988205850124359f,0.020556630566716194f,-0.15568238496780396f,-0.01289344485849142f,0.059013765305280685f,0.17861860990524292f,-0.47299885749816895f,-0.330662339925766f,-0.2790428400039673f,0.13708925247192383f,-0.08245879411697388f,0.28014299273490906f}, +{-0.18751932680606842f,-0.13028556108474731f,0.16706281900405884f,0.08243079483509064f,-0.0856199711561203f,-0.31701093912124634f,-0.041414469480514526f,-0.03316572308540344f,-0.14375491440296173f,0.33842185139656067f,-0.3525752127170563f,-0.28301799297332764f,0.10419143736362457f,0.5677728056907654f,0.29427415132522583f,0.2742917835712433f}, }; const float h2[16][16] = { - {-4.60468864440918f,2.131378650665283f,-0.06966331601142883f,0.10892010480165482f,-0.21907491981983185f,2.6552937030792236f,-0.12888698279857635f,0.0904630720615387f,-0.43008196353912354f,-0.1415480375289917f,0.0013025148073211312f,-0.5862739682197571f,-0.025005504488945007f,-2.328867197036743f,1.115570306777954f,-0.2078929990530014f}, -{2.0235300064086914f,0.8596984148025513f,0.057057321071624756f,-0.1866421103477478f,-0.35503754019737244f,-2.5662477016448975f,-0.6065406203269958f,-0.2990124225616455f,-0.33757925033569336f,0.2895788848400116f,0.06960289925336838f,-0.9175828695297241f,0.18136079609394073f,0.7756555080413818f,-7.386626243591309f,-7.464320182800293f}, + {-1.4991356134414673f,-0.4428083598613739f,-0.06966331601142883f,0.1967444270849228f,-0.21907491981983185f,0.9966632723808289f,0.28873929381370544f,0.0904630720615387f,-0.43008196353912354f,-0.1415480375289917f,1.9076564311981201f,-0.21810698509216309f,-0.25772976875305176f,-0.818320631980896f,-1.330167293548584f,-1.0718622207641602f}, +{0.8618813157081604f,-0.8748403191566467f,0.057057321071624756f,-0.2028317004442215f,-0.35503754019737244f,-0.5499786138534546f,-0.5643825531005859f,-0.2990124225616455f,-0.33757925033569336f,0.2895788848400116f,1.4778800010681152f,-0.6772118806838989f,0.2140946090221405f,0.8742734789848328f,-0.757195234298706f,-1.1809730529785156f}, {-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.27730849385261536f,-0.1645153909921646f,-0.2894435524940491f,0.70150226354599f,0.08946844935417175f,0.48729225993156433f,-0.23805393278598785f,0.4122363030910492f,0.26211628317832947f,0.2953031361103058f,1.158684492111206f,0.26607567071914673f,-0.404754102230072f,-0.2277091145515442f,-0.25776034593582153f,0.4264698624610901f}, -{-0.5035111904144287f,0.39109963178634644f,-0.25313520431518555f,0.20651747286319733f,0.036378175020217896f,0.4138354957103729f,-0.4872615337371826f,-0.08570799231529236f,-0.024399548768997192f,-0.39465832710266113f,-1.0461386442184448f,-1.0473610162734985f,-0.05514759197831154f,0.07305154949426651f,-4.25538969039917f,-4.954710960388184f}, -{1.0616633892059326f,-1.186822772026062f,-0.3519742488861084f,0.007102915085852146f,-0.3015052080154419f,-1.1060622930526733f,-0.6743010878562927f,-0.019414573907852173f,-0.23047015070915222f,0.3579089343547821f,-1.1522501707077026f,-0.43350106477737427f,-0.3656301200389862f,0.19797030091285706f,-4.184879302978516f,-5.358226299285889f}, +{-0.009984130039811134f,-0.30000436305999756f,-0.2894435524940491f,0.5964742302894592f,0.08946844935417175f,0.35389357805252075f,-0.23805393278598785f,0.4122363030910492f,0.26211628317832947f,0.2953031361103058f,0.48026028275489807f,0.2649420201778412f,0.2603621482849121f,-0.17744247615337372f,0.19240126013755798f,0.06972163915634155f}, +{-0.8961815237998962f,-2.5839736461639404f,-0.25313520431518555f,0.20026060938835144f,0.036378175020217896f,-0.4976740777492523f,-0.40996047854423523f,-0.08570799231529236f,-0.024399548768997192f,-0.39465832710266113f,-2.1841514110565186f,-0.7194414138793945f,-0.033286239951848984f,0.58295077085495f,-0.4543146789073944f,0.8327545523643494f}, +{0.9096110463142395f,0.42002537846565247f,-0.3519742488861084f,0.044624269008636475f,-0.3015052080154419f,-0.3457305431365967f,-0.6627653241157532f,-0.019414573907852173f,-0.23047015070915222f,0.3579089343547821f,-0.9428110122680664f,-0.30588483810424805f,-0.5022498369216919f,0.19978851079940796f,0.6076751351356506f,-0.4376809597015381f}, {-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.15874917805194855f,1.7312915325164795f,0.33083590865135193f,-0.28847888112068176f,-0.14358049631118774f,-0.060595765709877014f,-0.1094602644443512f,-0.3003333508968353f,0.2600560486316681f,-0.37898191809654236f,-0.6095865368843079f,-0.4384234547615051f,-0.31673234701156616f,0.18864622712135315f,-1.1672102212905884f,-4.914340496063232f}, -{-1.2331624031066895f,-0.5348597764968872f,-0.11379697918891907f,-0.36659547686576843f,0.041274964809417725f,-0.13728760182857513f,-0.30137109756469727f,0.0019084513187408447f,0.06103590130805969f,-0.38046833872795105f,-0.5203396081924438f,-0.5306758880615234f,-0.37024784088134766f,0.23910202085971832f,-2.1148717403411865f,-2.907675266265869f}, -{-0.0964743122458458f,0.18446290493011475f,-0.13502129912376404f,-0.09913630038499832f,0.12987366318702698f,0.05532713606953621f,0.2711336314678192f,-0.3632148504257202f,-0.13619378209114075f,0.16938945651054382f,0.20963427424430847f,0.36861976981163025f,0.3811538517475128f,-0.20610904693603516f,0.035831838846206665f,-0.28706878423690796f}, -{-0.06534615159034729f,-0.9871935844421387f,0.0457797646522522f,-1.0752142667770386f,-0.03321319818496704f,-0.05270973965525627f,0.13657520711421967f,-0.20421427488327026f,-0.050184011459350586f,0.12480869889259338f,-1.997399926185608f,0.2250584363937378f,-0.5145581364631653f,0.414652943611145f,-1.8539263010025024f,-1.830542802810669f}, -{1.0817053318023682f,2.9600586891174316f,0.3954955041408539f,0.11802361160516739f,0.0033026933670043945f,0.8234096765518188f,-0.5742489099502563f,-0.11795541644096375f,0.3487861454486847f,-0.32520344853401184f,0.1341339647769928f,-0.6345933079719543f,-0.0755934789776802f,-3.2760252952575684f,2.3911561965942383f,-0.5675102472305298f}, -{-0.1932232826948166f,-0.11534421890974045f,-0.15798500180244446f,0.42554527521133423f,-0.37393757700920105f,0.4575781524181366f,0.11292675137519836f,-0.2947862446308136f,-0.3764709532260895f,0.2424570620059967f,-0.0070910267531871796f,-0.28871336579322815f,0.41839322447776794f,-0.12473998963832855f,-0.2313767522573471f,0.19968171417713165f}, -{0.1520247608423233f,-0.21206627786159515f,-0.2018718123435974f,0.21511490643024445f,0.07545611262321472f,0.386330246925354f,-0.5531171560287476f,-0.21416273713111877f,-0.24509364366531372f,0.19522181153297424f,0.007985370233654976f,0.037351030856370926f,-0.3235759437084198f,-0.6140403747558594f,-0.3110964894294739f,0.26951977610588074f}, +{0.7905358076095581f,-0.9253769516944885f,0.33083590865135193f,-0.6139405369758606f,-0.14358049631118774f,-0.7288406491279602f,-0.25853750109672546f,-0.3003333508968353f,0.2600560486316681f,-0.37898191809654236f,0.5997555255889893f,-0.5442047119140625f,-1.299996256828308f,0.7177129983901978f,-0.25826573371887207f,0.09799324721097946f}, +{-0.5557106137275696f,-3.067866563796997f,-0.11379697918891907f,-0.3425405025482178f,0.041274964809417725f,-1.2420828342437744f,-0.16694867610931396f,0.0019084513187408447f,0.06103590130805969f,-0.38046833872795105f,-1.9725902080535889f,-0.474020779132843f,-2.1596693992614746f,0.003320923773571849f,-0.6637433171272278f,1.0982234477996826f}, +{0.05579625070095062f,0.7109156250953674f,-0.13502129912376404f,0.10466735810041428f,0.12987366318702698f,0.3961135745048523f,0.042060285806655884f,-0.3632148504257202f,-0.13619378209114075f,0.16938945651054382f,0.9018820524215698f,0.07822465896606445f,0.3899971842765808f,-0.8546745181083679f,0.19335848093032837f,-0.6027081608772278f}, +{-0.26683756709098816f,-0.012357143685221672f,0.0457797646522522f,-0.355249285697937f,-0.03321319818496704f,-0.43344053626060486f,0.17873415350914001f,-0.20421427488327026f,-0.050184011459350586f,0.12480869889259338f,-0.2250356674194336f,0.3545852601528168f,-0.3647043704986572f,0.42234641313552856f,-0.3869626522064209f,-0.28717151284217834f}, +{0.12352939695119858f,1.0202922821044922f,0.3954955041408539f,0.09096221625804901f,0.0033026933670043945f,0.32841622829437256f,-0.400757759809494f,-0.11795541644096375f,0.3487861454486847f,-0.32520344853401184f,-0.20216724276542664f,-0.45146751403808594f,-0.34278544783592224f,-0.7512372136116028f,0.5691444873809814f,0.8877333402633667f}, +{-0.2586395740509033f,-0.22174979746341705f,-0.15798500180244446f,0.3783508539199829f,-0.37393757700920105f,0.3508637249469757f,0.11292675137519836f,-0.2947862446308136f,-0.3764709532260895f,0.2424570620059967f,-0.11833125352859497f,-0.2837170362472534f,0.41839322447776794f,-0.005224073305726051f,-0.11831463873386383f,0.09768742322921753f}, +{-0.20115642249584198f,0.5370058417320251f,-0.2018718123435974f,0.11546266078948975f,0.07545611262321472f,0.5185575485229492f,-0.3408329486846924f,-0.21416273713111877f,-0.24509364366531372f,0.19522181153297424f,0.6304463148117065f,-0.5738548636436462f,-0.21711954474449158f,-0.6472672820091248f,-0.14394758641719818f,-0.5366228818893433f}, {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.05947384610772133f,1.6254005432128906f,0.12081471085548401f,-0.6328864693641663f,0.29976895451545715f,2.0650336742401123f,-0.21144846081733704f,0.31089308857917786f,-0.3893685042858124f,-0.02222958207130432f,0.31426239013671875f,-0.30968815088272095f,-0.3031739294528961f,-1.4839590787887573f,-14.394143104553223f,-10.769466400146484f}, +{-0.3031010627746582f,-2.337932586669922f,0.12081471085548401f,-0.4727434515953064f,0.29976895451545715f,-0.6936953663825989f,-0.17153315246105194f,0.31089308857917786f,-0.3893685042858124f,-0.02222958207130432f,-1.2046879529953003f,-0.3625001907348633f,-0.6335773468017578f,0.9249081611633301f,-0.7597517967224121f,0.5675207376480103f}, }; const float h3[16][16] = { - {-0.36079341173171997f,-0.8681421875953674f,0.03378281742334366f,-0.4423454701900482f,-0.1589602530002594f,0.16609609127044678f,0.2739587426185608f,1.733913779258728f,-0.5824562907218933f,-0.19480228424072266f,-0.02518732100725174f,-0.07014037668704987f,-7.893889904022217f,2.598219871520996f,-0.9259099364280701f,1.1275923252105713f}, -{0.047732532024383545f,-0.05760038644075394f,-0.8972983956336975f,-0.4367654621601105f,1.0358027219772339f,0.0038531706668436527f,0.09161756932735443f,-2.744044542312622f,-0.07693451642990112f,-0.6351262927055359f,0.12419307231903076f,-0.5911248326301575f,-0.625014066696167f,0.24820762872695923f,-1.2196614742279053f,0.04447555169463158f}, + {-0.36079341173171997f,-2.431511402130127f,0.48094454407691956f,-0.43318596482276917f,0.7724326848983765f,-0.8424602150917053f,0.3332441747188568f,0.1677408516407013f,-0.2405819296836853f,0.04891335964202881f,0.007284906692802906f,0.3017812967300415f,1.454294204711914f,1.9459514617919922f,-1.176064133644104f,2.467236042022705f}, +{0.047732532024383545f,-0.424442321062088f,0.2520815134048462f,-0.29737576842308044f,0.08667732775211334f,-0.1258617639541626f,-0.3198729455471039f,-0.08507407456636429f,0.14653588831424713f,-0.5653276443481445f,0.2704995572566986f,-0.43905630707740784f,0.05636966973543167f,0.7499547600746155f,-0.6143069863319397f,-1.4294815063476562f}, {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.1095256432890892f,0.1461382508277893f,-0.4282403588294983f,-0.37470322847366333f,0.262407124042511f,0.20021501183509827f,0.07002416253089905f,-0.28139200806617737f,-0.365601509809494f,0.13192829489707947f,0.41021624207496643f,-0.18083760142326355f,0.22999069094657898f,0.7787657976150513f,-0.24559295177459717f}, +{-0.30922991037368774f,0.19423305988311768f,0.014880705624818802f,-0.4279879331588745f,-0.5059630870819092f,0.41218385100364685f,0.20021501183509827f,0.07002416253089905f,-0.2341509461402893f,-0.365601509809494f,0.13192829489707947f,0.41021624207496643f,-0.3304626941680908f,0.43075019121170044f,0.6122162342071533f,-0.327704519033432f}, {-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.9267206788063049f,-0.6206665635108948f,-0.06270885467529297f,-2.0365681648254395f,0.11840212345123291f,-0.6220248937606812f,0.5569406151771545f,-0.6690928936004639f,-0.6675124764442444f,-0.41809624433517456f,-0.05644897371530533f,1.6417187452316284f,0.9519827365875244f,0.4041912853717804f,-0.5156958103179932f}, -{0.4110594093799591f,0.2972392439842224f,-0.16911417245864868f,0.37246426939964294f,-0.0034000270534306765f,-0.018108969554305077f,-0.08670487999916077f,-0.25336313247680664f,-0.030661463737487793f,-0.06259563565254211f,-0.1344406008720398f,0.35313835740089417f,-0.019481442868709564f,0.09743179380893707f,0.3126353323459625f,-0.4010780453681946f}, +{-0.37449589371681213f,0.6680253744125366f,-0.24715794622898102f,0.10065750777721405f,0.06749700009822845f,0.34828999638557434f,-0.18732719123363495f,0.07260999083518982f,-0.5348027944564819f,-0.4479295611381531f,-0.24411070346832275f,-0.005275629460811615f,-0.24113760888576508f,0.04656511917710304f,0.483327716588974f,-0.5596005916595459f}, +{0.4110594093799591f,0.15456320345401764f,-0.24521583318710327f,0.37246426939964294f,0.1920163780450821f,-0.15861345827579498f,-0.08670487999916077f,-0.25336313247680664f,-0.030661463737487793f,-0.06259563565254211f,-0.1344406008720398f,0.35313835740089417f,0.23028717935085297f,0.08431509137153625f,0.3126353323459625f,-0.3391006588935852f}, {-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.5559394955635071f,-1.210669755935669f,-0.21811194717884064f,-0.6207281947135925f,0.3128461539745331f,-0.08742031455039978f,0.05785742402076721f,-0.2560839354991913f,-0.30516543984413147f,-0.09135229885578156f,-0.30447322130203247f,0.8603754043579102f,-0.3016645014286041f,0.43661561608314514f,0.28164395689964294f}, -{-0.408692330121994f,-0.1774040162563324f,-0.07135714590549469f,0.0922636091709137f,0.02450498938560486f,0.5377879738807678f,0.03285527229309082f,0.5418570041656494f,-0.20705322921276093f,-0.25883403420448303f,0.12809070944786072f,0.03996849060058594f,-0.3288362920284271f,0.20047692954540253f,-0.1884039342403412f,0.10154416412115097f}, -{-0.2991822361946106f,0.3557475805282593f,-0.07273796200752258f,-0.05932474136352539f,0.09151226282119751f,0.22994504868984222f,-0.11253207921981812f,0.34576353430747986f,0.04814547300338745f,-0.35770976543426514f,-0.044228196144104004f,-0.36229726672172546f,0.016865311190485954f,-0.1392846703529358f,0.36124154925346375f,-0.16869547963142395f}, -{-0.2675279378890991f,0.026982862502336502f,-1.4290748834609985f,0.014674745500087738f,1.156470775604248f,-0.5175734162330627f,-0.34526437520980835f,-2.1798133850097656f,-0.8058183789253235f,-0.7355859875679016f,-0.6557437181472778f,-0.6299757957458496f,1.993207335472107f,-2.6451828479766846f,0.10933384299278259f,0.5743248462677002f}, -{-0.015470266342163086f,1.331382155418396f,-2.041633367538452f,0.1916993260383606f,1.8626195192337036f,1.2849215269088745f,-0.029416298493742943f,-1.4763147830963135f,-0.758314847946167f,-0.38441595435142517f,0.023597268387675285f,-0.16400480270385742f,1.8707743883132935f,-1.219574213027954f,0.27632343769073486f,0.07438213378190994f}, -{0.1863725483417511f,1.258126139640808f,-2.8785998821258545f,-0.679178774356842f,-1.9536710977554321f,1.0000137090682983f,0.04860696196556091f,-0.4158812165260315f,-0.14610783755779266f,0.09710219502449036f,-0.8095475435256958f,-0.00298866699449718f,1.294432282447815f,-0.8672913312911987f,-0.03188243880867958f,0.7572516202926636f}, +{0.15459725260734558f,0.5555095076560974f,-0.27437877655029297f,-0.190069317817688f,-0.48159661889076233f,0.7639893889427185f,-0.08742031455039978f,-0.09131276607513428f,-0.1763586550951004f,-0.44166475534439087f,-0.02608502097427845f,-0.6524152159690857f,0.020948048681020737f,-0.9568206071853638f,0.2814425230026245f,0.34854236245155334f}, +{-0.408692330121994f,0.007887898944318295f,0.10853831470012665f,0.0922636091709137f,0.00928102619946003f,-0.19759854674339294f,0.03285527229309082f,0.38763079047203064f,-0.20705322921276093f,-0.25883403420448303f,0.12809070944786072f,0.03996849060058594f,-0.4604015052318573f,-0.35185670852661133f,-0.29245057702064514f,0.2524697184562683f}, +{-0.2991822361946106f,1.0659689903259277f,-0.6361850500106812f,-0.05932474136352539f,-0.5562215447425842f,0.8203627467155457f,-0.11253207921981812f,0.34576353430747986f,0.04814547300338745f,-0.35770976543426514f,-0.044228196144104004f,-0.36229726672172546f,0.1439414769411087f,-0.2309979945421219f,0.19343101978302002f,0.12345266342163086f}, +{-0.2675279378890991f,-0.015056195668876171f,0.31358519196510315f,0.028304465115070343f,0.40976324677467346f,-0.16461938619613647f,-0.32875844836235046f,-0.31893211603164673f,-0.5566126108169556f,-0.8399508595466614f,-0.42490312457084656f,-0.586377739906311f,0.834416925907135f,0.05600754916667938f,0.13219621777534485f,0.34952405095100403f}, +{-0.015470266342163086f,-0.9729060530662537f,1.0328625440597534f,0.31857767701148987f,1.0769188404083252f,-1.3789411783218384f,0.05196094512939453f,-0.1561768800020218f,-0.40417930483818054f,-0.38441595435142517f,0.09286094456911087f,-0.37651821970939636f,0.14351722598075867f,0.805290937423706f,-0.21882160007953644f,-0.48183634877204895f}, +{0.1863725483417511f,0.491633802652359f,-0.4661361277103424f,-0.4922640025615692f,0.005252148024737835f,-0.07922336459159851f,0.04860696196556091f,0.02271122857928276f,-0.163008913397789f,-0.08158453553915024f,-0.30917301774024963f,-0.004401434678584337f,0.293024480342865f,-0.09468794614076614f,-0.25325796008110046f,0.37502631545066833f}, }; -const float hout[16] = { 0.45773375034332275f,0.25683534145355225f,0.10269259661436081f,-0.09886153042316437f,-0.14727230370044708f,0.14305056631565094f,-0.040428634732961655f,-0.25981852412223816f,0.17771703004837036f,0.1439041644334793f,-0.02130241133272648f,0.11746034026145935f,-0.320387601852417f,0.23103196918964386f,0.7381985783576965f,-0.22942443192005157f }; +const float hout[16] = { 0.45773375034332275f,0.46150368452072144f,-0.1613515466451645f,-0.07821951061487198f,-0.3364546298980713f,0.45417219400405884f,0.0030125975608825684f,0.05208330228924751f,-0.12402372807264328f,-0.05899381637573242f,-0.028325878083705902f,0.015735700726509094f,-0.24386273324489594f,0.7545584440231323f,0.8510534167289734f,-0.35208162665367126f }; -const float b1[16] = { 0.34920957684516907f,1.5879549980163574f,-1.7145336866378784f,-0.2492268681526184f,2.44551682472229f,1.714568018913269f,-0.058932315558195114f,2.2690889835357666f,2.216073751449585f,-0.8915195465087891f,3.6109790802001953f,0.49270865321159363f,-0.3803519308567047f,-2.3657329082489014f,-1.087764859199524f,2.2678914070129395f }; +const float b1[16] = { 0.9123589992523193f,1.0290874242782593f,-1.7145336866378784f,0.1726180613040924f,1.0475683212280273f,0.9286171793937683f,-0.058932315558195114f,0.9587783217430115f,0.8604491353034973f,-0.932363748550415f,0.5728248357772827f,0.08530331403017044f,-0.37935054302215576f,-0.7848360538482666f,-1.087764859199524f,1.9914882183074951f }; -const float b2[16] = { 0.5859363675117493f,-2.0544838905334473f,-1.4564176797866821f,-0.7034727334976196f,-0.6939148902893066f,-0.12358913570642471f,0.08653870224952698f,-0.30969977378845215f,-1.20063054561615f,-1.912178635597229f,-0.18094295263290405f,0.23272359371185303f,-0.2365279495716095f,2.786655902862549f,0.8425362706184387f,1.1348179578781128f }; +const float b2[16] = { 0.1742895245552063f,-0.7612563371658325f,-1.4564176797866821f,-0.7200983166694641f,-0.6939148902893066f,0.1939559280872345f,0.2192271202802658f,-0.30969977378845215f,-1.20063054561615f,-1.912178635597229f,-0.03863578662276268f,0.41583994030952454f,-0.2901434004306793f,1.971176028251648f,0.2521037757396698f,0.7886443138122559f }; -const float b3[16] = { -1.963319182395935f,0.2189684808254242f,-0.36385029554367065f,-0.26613104343414307f,-1.088571548461914f,0.1981901228427887f,-0.6529271006584167f,-1.2547568082809448f,0.07332992553710938f,-0.10717277973890305f,-0.4783993661403656f,-0.3101188540458679f,-2.357795238494873f,-2.0888407230377197f,-1.6876097917556763f,-0.2026701420545578f }; +const float b3[16] = { -1.963319182395935f,-0.2411147952079773f,0.37178677320480347f,-0.07739337533712387f,0.34993961453437805f,0.5473472476005554f,-0.45353031158447266f,-0.8083206415176392f,0.36311396956443787f,0.10367195308208466f,-0.27569082379341125f,-0.13503602147102356f,-0.3063124120235443f,0.6951006054878235f,-1.3749268054962158f,-0.20929524302482605f }; -const float bout[1] = { -0.10198569297790527f }; +const float bout[1] = { -0.49270275235176086f }; float VALVE_POS_RAW_NN = 0.0f; @@ -375,35 +375,35 @@ else if(NN_Control_Flag == 1) { - int ind = 0; - for(int i=0; i<numpast_u; i++) { - input_NN[ind] = u_past[time_interval*i]; - ind = ind + 1; - } - - for(int i=0; i<numpast_x; i++) { - input_NN[ind] = x_past[time_interval*i] / 60.0f; - ind = ind + 1; - } - input_NN[ind] = (pos.sen / ENC_PULSE_PER_POSITION) / 60.0f; - ind = ind + 1; - -// for(int i=0; i<numfuture_x; i++) { -// input_NN[ind] = x_future[time_interval*i+time_interval] / 60.0f; +// int ind = 0; +// for(int i=0; i<numpast_u; i++) { +// input_NN[ind] = u_past[time_interval*i]; +// ind = ind + 1; +// } +// +// for(int i=0; i<numpast_x; i++) { +// input_NN[ind] = x_past[time_interval*i] / 60.0f; // ind = ind + 1; // } - - for(int i=0; i<numpast_f; i++) { - input_NN[ind] = f_past[time_interval*i] / 10000.0f + 0.5f; - ind = ind + 1; - } - 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; - ind = ind + 1; - } +// input_NN[ind] = (pos.sen / ENC_PULSE_PER_POSITION) / 60.0f; +// ind = ind + 1; +// +//// for(int i=0; i<numfuture_x; i++) { +//// input_NN[ind] = x_future[time_interval*i+time_interval] / 60.0f; +//// ind = ind + 1; +//// } +// +// for(int i=0; i<numpast_f; i++) { +// input_NN[ind] = f_past[time_interval*i] / 10000.0f + 0.5f; +// ind = ind + 1; +// } +// 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; +// ind = ind + 1; +// } float output1[16] = { 0.0f }; float output2[16] = { 0.0f };