![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Original Version of STM Board
Diff: main.cpp
- Revision:
- 199:ee79b4692e3b
- Parent:
- 198:bc4dfecb8e32
--- a/main.cpp Sun Dec 20 03:03:08 2020 +0000 +++ b/main.cpp Sun Dec 20 03:25:36 2020 +0000 @@ -1,4 +1,4 @@ -//201220_1_with_delay +//201220_2_with_delay #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] = { - {-2.492051839828491f,2.4516725540161133f,0.12903714179992676f,-2.490757465362549f,-2.6756582260131836f,2.4281091690063477f,-0.25895145535469055f,-0.2330438494682312f,-0.3288726806640625f,1.7969430685043335f,0.33044230937957764f,-2.8259778022766113f,-2.8330631256103516f,0.2416958063840866f,-0.2571594715118408f,2.2232203483581543f}, -{-1.3854602575302124f,1.5994855165481567f,-0.3927857577800751f,-1.091575026512146f,-1.0983558893203735f,1.2194273471832275f,-0.48985767364501953f,0.4625398814678192f,-0.4161548912525177f,0.5750619173049927f,0.15368761122226715f,-1.7419500350952148f,-0.9391921162605286f,-0.31723925471305847f,-0.20967772603034973f,1.1359047889709473f}, -{-1.0888410806655884f,1.1380627155303955f,0.36391180753707886f,-0.8528419137001038f,-0.5124239325523376f,1.0754810571670532f,0.20260077714920044f,0.02969699166715145f,-0.11756117641925812f,-0.3696632981300354f,-0.27259182929992676f,-1.1658742427825928f,-0.43726029992103577f,0.14137530326843262f,0.05590221285820007f,0.6036397814750671f}, -{-0.5521246790885925f,0.10764690488576889f,0.39742106199264526f,0.14577916264533997f,-0.3091053068637848f,0.17434029281139374f,-0.20044343173503876f,-0.68796306848526f,0.6097877621650696f,-0.42812103033065796f,0.050127483904361725f,0.2115311473608017f,-0.007273299619555473f,0.029505113139748573f,-0.2961459457874298f,0.5710861682891846f}, -{1.207394003868103f,-1.1674365997314453f,-0.0051451027393341064f,1.0202738046646118f,0.7490691542625427f,-0.9034024477005005f,0.04487033560872078f,-0.9898844957351685f,0.7452301979064941f,-0.47734594345092773f,0.24034416675567627f,1.5481359958648682f,1.1834068298339844f,0.14985936880111694f,-0.3865056037902832f,-0.9457556009292603f}, -{4.191114902496338f,-4.077197074890137f,0.21773302555084229f,3.4757556915283203f,4.026125907897949f,-4.04514217376709f,0.0805748701095581f,1.4911282062530518f,-0.10712718218564987f,-0.8101842999458313f,-0.6279340982437134f,4.144664287567139f,3.1387953758239746f,0.27788639068603516f,-0.4132833778858185f,-3.7526161670684814f}, -{0.05604593828320503f,-0.5269882678985596f,-0.2501986622810364f,0.8053929209709167f,-0.508767306804657f,1.2673035860061646f,0.1702369749546051f,0.41742753982543945f,3.923818349838257f,2.9203224182128906f,4.625209808349609f,0.8557388782501221f,0.5013881325721741f,0.2669181227684021f,-0.15618428587913513f,-1.7190253734588623f}, -{-0.29786035418510437f,-0.6146117448806763f,-0.26619744300842285f,-0.35863757133483887f,-0.8377414345741272f,-0.29022303223609924f,-0.078120656311512f,-5.662913799285889f,-3.735013008117676f,-3.5222713947296143f,0.5320702791213989f,-0.01984715275466442f,-0.2300022393465042f,0.02583559788763523f,0.04303058981895447f,2.2264418601989746f}, -{-0.005315178073942661f,0.4084877669811249f,0.10248100757598877f,-0.049130890518426895f,-0.10337845981121063f,0.180928573012352f,0.02361851930618286f,-2.048043727874756f,-3.8224282264709473f,-0.7895442247390747f,-0.5650206208229065f,0.23716439306735992f,2.640312433242798f,0.10206064581871033f,-0.30555272102355957f,0.07618159055709839f}, -{0.10099751502275467f,-0.398851603269577f,0.18462657928466797f,0.40458497405052185f,0.5282383561134338f,0.2875088155269623f,-0.20621144771575928f,0.8464758396148682f,-2.340078592300415f,3.711749792098999f,-6.100204944610596f,-0.5303384065628052f,3.87209153175354f,-0.31372106075286865f,0.3484981060028076f,-0.9589624404907227f}, -{0.3724943995475769f,0.2132701277732849f,0.37182438373565674f,1.3321770429611206f,0.3190871775150299f,0.08779194951057434f,-0.11073392629623413f,0.04808827489614487f,4.836231708526611f,1.5474936962127686f,2.618411064147949f,-0.7479416728019714f,-2.667581081390381f,-0.07993866503238678f,0.26688337326049805f,0.20610198378562927f}, -{-0.21814200282096863f,-0.21748900413513184f,-0.40320003032684326f,0.39444229006767273f,0.3996942639350891f,-0.23974381387233734f,0.24927140772342682f,0.42778199911117554f,-1.496774673461914f,-0.9519236087799072f,-0.2538074254989624f,-0.045760106295347214f,-0.03449362516403198f,-0.08651508390903473f,0.10493969917297363f,-0.2107759714126587f}, -{-0.10616457462310791f,0.05422089993953705f,0.19847965240478516f,0.3579346239566803f,0.19547772407531738f,-0.13439396023750305f,-0.14413191378116608f,-0.09275151789188385f,-0.12082389742136002f,-3.9278764724731445f,-0.8460808396339417f,-0.00010032631689682603f,-0.6260793209075928f,-0.05694044753909111f,-0.22268100082874298f,-0.3159164488315582f}, -{-0.06967504322528839f,0.18296405673027039f,0.4127817749977112f,0.21173477172851562f,0.03739193454384804f,-0.2718232572078705f,-0.22765624523162842f,0.0479109026491642f,-0.8458966016769409f,-2.188527822494507f,-0.5611924529075623f,0.03390118479728699f,-0.6283928155899048f,-0.14168457686901093f,0.0479682981967926f,0.0000061300816014409065f}, -{0.05417802184820175f,0.03646376356482506f,0.20282304286956787f,0.14569750428199768f,0.0335032157599926f,-0.05122561752796173f,0.13000749051570892f,-0.057157427072525024f,0.7048590779304504f,2.26005220413208f,0.2068970799446106f,-0.133168026804924f,0.2436632364988327f,-0.13851526379585266f,0.0668090283870697f,0.3664224445819855f}, -{0.06464312970638275f,-0.045170340687036514f,-0.40439701080322266f,-0.11053092777729034f,-0.015158046968281269f,0.16447672247886658f,-0.07142936438322067f,0.15182127058506012f,-0.13264119625091553f,-0.23641446232795715f,0.4588874280452728f,-0.011651065200567245f,0.040492258965969086f,-0.09876388311386108f,-0.08245879411697388f,0.03925871476531029f}, -{-0.02269779145717621f,0.059974778443574905f,0.16706281900405884f,0.46414104104042053f,-0.21328707039356232f,-0.45228299498558044f,0.041288089007139206f,0.06836040318012238f,-0.32144632935523987f,0.8764961957931519f,-0.4899333417415619f,-0.17487938702106476f,-0.3217511773109436f,0.24882397055625916f,0.29427415132522583f,-0.017587721347808838f}, + {-2.1837844848632812f,2.0101635456085205f,0.04588095843791962f,-0.5758384466171265f,-2.3859260082244873f,2.2956244945526123f,1.8129379749298096f,1.5355861186981201f,-0.22093690931797028f,-2.2866008281707764f,0.8032577037811279f,-2.308483362197876f,-2.022364616394043f,-1.44899320602417f,-0.2571594715118408f,2.1746459007263184f}, +{-1.2958452701568604f,1.0988526344299316f,-0.47577235102653503f,-0.19999195635318756f,-1.253292202949524f,1.2035913467407227f,0.16407740116119385f,-0.06658501923084259f,-0.47375917434692383f,-1.3384493589401245f,-0.3297125995159149f,-1.3080674409866333f,-0.06550247967243195f,-1.1850271224975586f,-0.20967772603034973f,1.4772138595581055f}, +{-0.9654735326766968f,0.7904215455055237f,0.2810189127922058f,-0.8030968308448792f,-0.6013320088386536f,0.9044144153594971f,0.38279950618743896f,-0.35799551010131836f,-0.4297952651977539f,-0.605270266532898f,-0.19510450959205627f,-0.9962825775146484f,0.22925516963005066f,-0.08333431929349899f,0.05590221285820007f,0.581075131893158f}, +{-0.38367339968681335f,0.14867372810840607f,0.3145712614059448f,-0.5230110287666321f,-0.14263394474983215f,-0.11347147822380066f,-0.11111853271722794f,0.1234128400683403f,0.2909422218799591f,0.46737194061279297f,0.8569537997245789f,-0.06507605314254761f,0.14980092644691467f,0.3622553050518036f,-0.2961459457874298f,0.11472762376070023f}, +{1.2189306020736694f,-0.7193593978881836f,-0.08788592368364334f,-0.07936348766088486f,0.9448050260543823f,-1.0137641429901123f,-0.27093255519866943f,-0.020022014155983925f,0.6358230113983154f,1.3716148138046265f,0.8794701099395752f,0.8379188776016235f,0.45183658599853516f,0.9175698161125183f,-0.3865056037902832f,-1.2692279815673828f}, +{3.590186834335327f,-3.4975996017456055f,0.1350027471780777f,2.3956410884857178f,3.5060923099517822f,-3.3447601795196533f,-1.807590126991272f,-1.1423075199127197f,0.1169700175523758f,2.501425266265869f,-2.12386155128479f,3.2425308227539062f,1.163952112197876f,1.4989044666290283f,-0.4132833778858185f,-2.9116435050964355f}, +{-0.006196335889399052f,0.03741585835814476f,-0.2773531675338745f,-4.473310947418213f,-0.27634772658348083f,0.12931323051452637f,0.04171861708164215f,-3.9280078411102295f,3.5595314502716064f,-0.8166646361351013f,3.1788687705993652f,-0.24399122595787048f,-0.14087243378162384f,3.2437639236450195f,-0.15618428587913513f,-2.124624490737915f}, +{-0.3596242070198059f,-0.171567901968956f,-0.35079166293144226f,-1.5157039165496826f,-0.5067394375801086f,-1.009583830833435f,4.817088603973389f,-0.4044037163257599f,-0.5577526688575745f,4.15724515914917f,2.5925800800323486f,-0.024581750854849815f,-2.805974245071411f,0.1435716301202774f,0.04303058981895447f,0.8803895711898804f}, +{-0.11844680458307266f,0.7361156940460205f,0.021878330036997795f,-0.21332386136054993f,-0.1096244677901268f,-0.5460144877433777f,-1.9238289594650269f,0.47892892360687256f,-0.43380141258239746f,0.149037167429924f,1.3499506711959839f,0.0702681839466095f,2.0669760704040527f,1.0241925716400146f,-0.30555272102355957f,-0.980358898639679f}, +{-0.02248750813305378f,-0.36836478114128113f,0.10568398237228394f,0.9146596193313599f,-0.09461541473865509f,0.10696340352296829f,-7.119680881500244f,-0.5392789840698242f,1.5476149320602417f,-0.5685486793518066f,-1.2822149991989136f,-0.6936250925064087f,5.557674407958984f,-0.6546996235847473f,0.3484981060028076f,-0.30507388710975647f}, +{0.20626938343048096f,-0.1237199530005455f,0.2928805947303772f,0.5191757082939148f,0.1295856237411499f,0.30068445205688477f,3.9183223247528076f,-2.5037665367126465f,-2.3492307662963867f,-0.7124243974685669f,-0.8994795680046082f,-0.46030789613723755f,-3.5722081661224365f,1.8683465719223022f,0.26688337326049805f,-0.44005087018013f}, +{-0.1235814169049263f,-0.31122681498527527f,-0.4815855920314789f,0.7879880666732788f,0.28719767928123474f,-0.08064402639865875f,0.6580206751823425f,-0.9771832823753357f,-0.07167230546474457f,-0.4789198040962219f,-0.7216929197311401f,0.22976653277873993f,-0.4228055477142334f,0.6537925004959106f,0.10493969917297363f,-0.35554176568984985f}, +{-0.06496161222457886f,-0.01388863380998373f,0.1188524067401886f,0.5036965012550354f,0.1850457340478897f,-0.033558476716279984f,-0.004450216423720121f,-0.19332146644592285f,0.4412379264831543f,-0.12896977365016937f,-0.41583219170570374f,0.10597457736730576f,0.19178208708763123f,0.16101115942001343f,-0.22268100082874298f,-0.02980675920844078f}, +{-0.03522493317723274f,-0.006083943881094456f,0.3326011002063751f,0.8511806726455688f,-0.12043089419603348f,-0.18758372962474823f,0.0751999244093895f,-0.3965107500553131f,0.9551570415496826f,-0.06834441423416138f,-0.6902320384979248f,0.23172923922538757f,-0.114925317466259f,-0.10242374241352081f,0.0479682981967926f,0.09168383479118347f}, +{0.022258363664150238f,0.18318961560726166f,0.12307672202587128f,0.48128053545951843f,-0.029876722022891045f,-0.05051718279719353f,-0.03138022497296333f,0.24694964289665222f,0.18856319785118103f,-0.16514801979064941f,-0.39376768469810486f,-0.29822978377342224f,0.463131308555603f,0.18574166297912598f,0.0668090283870697f,-0.29248541593551636f}, +{0.0049180155619978905f,-0.2213272899389267f,-0.483573853969574f,-0.2487296462059021f,-0.03675578907132149f,0.058383576571941376f,-0.43105602264404297f,-0.06576662510633469f,-0.6182113289833069f,0.0011734002036973834f,0.13351257145404816f,-0.008947508409619331f,-0.4899154603481293f,-0.21355555951595306f,-0.08245879411697388f,0.016924362629652023f}, +{0.01701810397207737f,-0.03982752561569214f,0.08773337304592133f,0.9987277984619141f,-0.23670294880867004f,-0.003839959856122732f,0.5555870532989502f,-0.08025806397199631f,1.011113166809082f,0.003458167891949415f,-0.6364181637763977f,0.13058964908123016f,0.0927204042673111f,0.2622024714946747f,0.29427415132522583f,-0.36754608154296875f}, }; const float h2[16][16] = { - {3.0738728046417236f,1.559771180152893f,-0.19042335450649261f,0.3914716839790344f,-0.21907491981983185f,1.6640474796295166f,0.13948610424995422f,-0.08634524047374725f,-0.5460954904556274f,-0.2652187943458557f,0.06963741779327393f,-3.5057811737060547f,-0.0956161767244339f,-5.765225887298584f,-0.46290507912635803f,5.082071304321289f}, -{-2.4444243907928467f,1.0142027139663696f,-0.07617853581905365f,-2.0465540885925293f,-0.35503754019737244f,0.25830844044685364f,-0.33918139338493347f,-0.42322224378585815f,-0.4216797351837158f,0.22551164031028748f,0.9671986103057861f,0.11130780726671219f,0.07124756276607513f,1.1827691793441772f,-2.5495834350585938f,-2.0869014263153076f}, -{-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.23199157416820526f,-1.7880792617797852f,-0.2894435524940491f,1.9215139150619507f,0.08946844935417175f,0.49931082129478455f,-0.38759845495224f,0.12227743119001389f,0.18804843723773956f,0.08531558513641357f,-0.34142476320266724f,1.4358174800872803f,-0.5422481894493103f,-0.29128965735435486f,1.0840681791305542f,-0.26147159934043884f}, -{0.3284909129142761f,0.8169353604316711f,-0.3847824037075043f,0.16119417548179626f,0.036378175020217896f,2.1914660930633545f,-0.23565807938575745f,-0.4117702841758728f,-0.08101971447467804f,-0.5542977452278137f,1.027921438217163f,-0.36246106028556824f,-0.14990541338920593f,-1.1903846263885498f,-0.23719990253448486f,0.7545689344406128f}, -{1.9852561950683594f,1.632697582244873f,-0.4675808250904083f,1.9349418878555298f,-0.3015052080154419f,-0.8486825227737427f,-0.581864058971405f,-0.35089632868766785f,-0.3620368242263794f,0.12058626860380173f,0.7981455326080322f,-1.856131911277771f,-0.4701657295227051f,1.799214482307434f,1.8555665016174316f,-2.1990392208099365f}, -{-0.24421502649784088f,0.046817418187856674f,-0.3260969817638397f,0.1517666131258011f,-0.38453540205955505f,-0.17000475525856018f,0.285016268491745f,0.12387624382972717f,-0.0982072651386261f,0.13111665844917297f,0.04020293802022934f,-0.32796353101730347f,-0.21546880900859833f,-0.023107079789042473f,-0.3091234266757965f,-0.3402748107910156f}, -{0.57220059633255f,0.29739347100257874f,0.19632335007190704f,0.008231665939092636f,-0.14358049631118774f,0.15171869099140167f,-0.09043094515800476f,-0.33494824171066284f,0.17879262566566467f,-0.37898191809654236f,-0.6580735445022583f,0.7165367603302002f,-0.4525156617164612f,0.18532223999500275f,-3.5652143955230713f,-0.3483140468597412f}, -{-0.2703920006752014f,-0.9304926991462708f,-0.24047645926475525f,0.7930152416229248f,0.041274964809417725f,-0.2867431938648224f,-0.10284432768821716f,-0.11999508738517761f,-0.003526973305270076f,-0.38046833872795105f,-0.7273960709571838f,-1.1637976169586182f,-0.527924656867981f,-0.1207299679517746f,-7.605639934539795f,0.2445993423461914f}, -{0.7996191382408142f,0.2623150646686554f,-0.13502129912376404f,-0.9202054142951965f,0.12987366318702698f,0.021906832233071327f,0.11923511326313019f,-0.4247411787509918f,0.006385833024978638f,0.16225893795490265f,0.4018360376358032f,0.06512869894504547f,0.09138336032629013f,0.0027437149547040462f,0.7030954360961914f,-0.19797562062740326f}, -{-0.2666815221309662f,-1.1443369388580322f,0.0457797646522522f,-0.4290945529937744f,-0.03321319818496704f,0.20285262167453766f,0.032027360051870346f,-0.18001338839530945f,-0.15919113159179688f,-0.10972582548856735f,-2.9048874378204346f,1.0889835357666016f,-0.5255591869354248f,0.11027144640684128f,-0.26261255145072937f,0.13390804827213287f}, -{1.5477468967437744f,0.9449147582054138f,0.26128989458084106f,-2.6026813983917236f,0.0033026933670043945f,-0.4747174382209778f,-0.33315056562423706f,-0.19110865890979767f,0.20550130307674408f,-0.5178285837173462f,-1.4446262121200562f,-2.590667963027954f,-0.1823829710483551f,-2.3793771266937256f,0.9905255436897278f,1.8419498205184937f}, -{-0.7309730052947998f,-2.024406909942627f,-0.15798500180244446f,-0.25766730308532715f,-0.37393757700920105f,0.033240195363759995f,-0.03676166385412216f,-0.41733694076538086f,-0.3764709532260895f,0.058458827435970306f,-0.8576257228851318f,-0.20987293124198914f,0.28012609481811523f,-0.1621398627758026f,-1.3118759393692017f,0.440889447927475f}, -{-0.2527315020561218f,0.2273571640253067f,-0.2018718123435974f,-0.22529835999011993f,0.07545611262321472f,-0.08787805587053299f,-0.11297860741615295f,-0.25671717524528503f,-0.24509364366531372f,0.19522181153297424f,0.24586385488510132f,-0.28716936707496643f,-0.04067717865109444f,0.3425101041793823f,-0.1104995459318161f,-0.12887412309646606f}, + {-2.674283027648926f,-19.75362205505371f,-0.1445033997297287f,7.779426097869873f,-0.3419828712940216f,0.6111319661140442f,-11.97992992401123f,-0.06811906397342682f,-0.5635062456130981f,-0.14760400354862213f,5.501676082611084f,-3.258754253387451f,4.001481056213379f,-4.758901119232178f,-0.9312655925750732f,0.7366103529930115f}, +{-0.7434616684913635f,3.092632293701172f,-0.05838218703866005f,-1.307464361190796f,-0.35503754019737244f,-0.2724722623825073f,1.319793462753296f,-0.5438210368156433f,-0.42702803015708923f,0.2895788848400116f,0.7404713034629822f,-0.7428285479545593f,-1.0050708055496216f,0.47870922088623047f,-0.018869943916797638f,-0.18738682568073273f}, +{-0.22745239734649658f,0.045928705483675f,-0.061119019985198975f,0.3182114362716675f,0.05568113923072815f,-0.0237321425229311f,-0.20225946605205536f,-0.08465918898582458f,0.3489862382411957f,0.0687277615070343f,0.2845090329647064f,0.3004753887653351f,0.31974947452545166f,-0.41946619749069214f,0.10742761939764023f,-0.005538635421544313f}, +{0.1112687960267067f,0.17640958726406097f,-0.2894435524940491f,-0.029508210718631744f,-0.04560476168990135f,1.5404884815216064f,-0.5512773394584656f,0.08028208464384079f,0.18367992341518402f,0.21083085238933563f,-0.84100741147995f,0.3499418795108795f,-0.8262040019035339f,-0.06061369925737381f,0.7440986037254333f,0.7937288880348206f}, +{1.2113111019134521f,-1.9501395225524902f,-0.3431500196456909f,1.5768429040908813f,-0.09858585894107819f,0.9739106893539429f,-1.2162216901779175f,-0.4212343394756317f,-0.17827872931957245f,-0.5757948756217957f,1.239785075187683f,-0.7534657716751099f,1.118362545967102f,-2.2174103260040283f,-1.7887440919876099f,1.190489649772644f}, +{0.1777067929506302f,-1.8983210325241089f,-0.45307424664497375f,-2.1425976753234863f,-0.3015052080154419f,3.18461275100708f,-18.18368911743164f,-0.26703914999961853f,-0.48995697498321533f,0.3579089343547821f,-0.0014333250001072884f,0.4553060531616211f,-0.9638712406158447f,1.2035548686981201f,1.1829919815063477f,-0.458189994096756f}, +{-0.2140461951494217f,1.3666870594024658f,-0.3260969817638397f,-0.3568636476993561f,-0.38453540205955505f,-0.4754043519496918f,-4.1757025718688965f,-0.0017336906166747212f,-0.15257470309734344f,0.13111665844917297f,0.1802264153957367f,-3.16748309135437f,-0.41486334800720215f,0.4974520206451416f,0.6583006381988525f,-0.8409538269042969f}, +{-3.7754693031311035f,-0.8927761912345886f,0.18919311463832855f,0.14834003150463104f,-0.27119147777557373f,-0.024219632148742676f,-4.014308452606201f,-0.4794021248817444f,0.03760408237576485f,-0.5122731924057007f,0.20397134125232697f,-14.069512367248535f,-2.336082696914673f,0.6071321964263916f,-0.05089356750249863f,0.2677140235900879f}, +{-0.498852401971817f,-0.3680291175842285f,-0.24363061785697937f,0.15364482998847961f,-0.08847162872552872f,-0.010616462677717209f,0.8844281435012817f,-0.3258861303329468f,0.06103590130805969f,-0.38046833872795105f,-1.264649510383606f,-1.2231134176254272f,-0.5222742557525635f,0.17115530371665955f,-1.6105502843856812f,-1.0130584239959717f}, +{-0.10957334190607071f,2.477494955062866f,-0.13502129912376404f,0.39086753129959106f,-0.0030171233229339123f,-0.7244225144386292f,-2.244135618209839f,-0.6697809100151062f,-0.24925290048122406f,-0.0661936029791832f,0.22846399247646332f,1.8263009786605835f,-0.25706198811531067f,0.16737937927246094f,-0.31483668088912964f,0.2415773868560791f}, +{0.5647047162055969f,-2.1719229221343994f,-0.09408819675445557f,0.08505217730998993f,-0.03321319818496704f,-0.80712890625f,0.4001992642879486f,-0.40854141116142273f,-0.050184011459350586f,0.12480869889259338f,0.6780188679695129f,-0.27626320719718933f,0.48307815194129944f,0.9442746639251709f,-0.8515918850898743f,-1.0515382289886475f}, +{0.414889395236969f,-1.0162369012832642f,0.2711864113807678f,0.6045194864273071f,-0.12988048791885376f,0.11452009528875351f,-0.13452677428722382f,-0.3723098933696747f,0.11079556494951248f,-0.3499957025051117f,0.5277608633041382f,0.43197011947631836f,-0.054778654128313065f,0.09976109862327576f,0.19868263602256775f,0.9474283456802368f}, +{-1.251092791557312f,-2.3950695991516113f,-0.15798500180244446f,0.44822025299072266f,-0.5053848028182983f,0.7921834588050842f,2.1565396785736084f,-0.3741874396800995f,-0.4484594464302063f,0.11803500354290009f,-0.009846722707152367f,0.02426297776401043f,0.3284200429916382f,-0.278394490480423f,-0.4773232340812683f,-0.630092442035675f}, +{0.4361220896244049f,0.039302293211221695f,-0.2018718123435974f,0.09616457670927048f,0.07545611262321472f,-0.4409101605415344f,-0.870441734790802f,-0.319128155708313f,-0.33705347776412964f,0.06882216781377792f,-0.4649412930011749f,1.0272188186645508f,1.4670559167861938f,0.0006485587218776345f,-0.9369511604309082f,-1.3251198530197144f}, {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}, -{-2.6995644569396973f,0.1426059901714325f,-0.003839129814878106f,-0.6525433659553528f,0.29976895451545715f,0.08217727392911911f,-0.25857430696487427f,0.20994558930397034f,-0.5427520871162415f,-0.17481258511543274f,-0.4742678105831146f,0.7741270661354065f,-0.46939387917518616f,0.4754415452480316f,-0.05948866903781891f,0.06004064157605171f}, +{-2.1636977195739746f,1.3953567743301392f,-0.002055981196463108f,-0.37223538756370544f,0.164200097322464f,0.08797144889831543f,-8.68027400970459f,0.04972444847226143f,-0.5795959830284119f,-0.22661522030830383f,0.4256688058376312f,-5.334555149078369f,-2.306769847869873f,-0.09140407294034958f,1.1666741371154785f,0.2710472345352173f}, }; const float h3[16][16] = { - {-0.36079341173171997f,0.19902901351451874f,-0.017479311674833298f,-0.7806128263473511f,-1.826728105545044f,0.23857304453849792f,0.740174412727356f,0.2017861008644104f,0.3792732059955597f,-1.0531911849975586f,-0.7588154673576355f,-0.015846818685531616f,-0.8501541018486023f,-0.30473095178604126f,0.007871723733842373f,-0.09860346466302872f}, -{0.047732532024383545f,0.021063050255179405f,0.12808172404766083f,0.03686954081058502f,-3.398327112197876f,-0.12904098629951477f,-0.9065544009208679f,-0.0603376105427742f,0.09683269262313843f,-0.9680567383766174f,0.3885401785373688f,-0.40745434165000916f,0.13621456921100616f,0.45660361647605896f,-2.057027816772461f,-0.7064571976661682f}, -{0.07903262972831726f,0.2473522275686264f,-0.058172356337308884f,0.04248586297035217f,-0.1806681901216507f,-0.22005361318588257f,-0.4038352966308594f,0.015906542539596558f,0.1806468516588211f,0.030178606510162354f,0.2488909661769867f,0.13805970549583435f,-0.0650925561785698f,-0.22163918614387512f,-0.3036302626132965f,0.054825395345687866f}, -{-0.30922991037368774f,-1.023395299911499f,0.2052631825208664f,-4.644917011260986f,-3.3489151000976562f,0.24621817469596863f,-2.0494141578674316f,-0.1963813304901123f,-0.9766215682029724f,-8.70325756072998f,-2.0176901817321777f,-0.005141889210790396f,-0.008450114168226719f,0.03865490108728409f,-0.17401503026485443f,-0.44327670335769653f}, -{-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.7347820997238159f,-0.7467658519744873f,-0.7454975843429565f,0.5573446750640869f,0.4857249855995178f,0.522062361240387f,-0.0946974977850914f,-0.48451560735702515f,-0.027926772832870483f,-0.34000688791275024f,-0.22794345021247864f,0.551361083984375f,0.3427993655204773f,0.9183679223060608f,-0.6474935412406921f}, -{0.4110594093799591f,0.2715781033039093f,-0.23423463106155396f,0.37246426939964294f,0.192606121301651f,-0.08329644799232483f,-0.08670487999916077f,-0.25336313247680664f,0.04357413947582245f,-0.06259563565254211f,-0.1344406008720398f,0.35313835740089417f,0.2678389847278595f,0.05402490124106407f,0.24188868701457977f,-0.28574222326278687f}, -{-0.40892091393470764f,0.13580100238323212f,-0.5269189476966858f,0.24296578764915466f,0.1986200511455536f,0.08784182369709015f,-0.23312048614025116f,-0.390264093875885f,0.38584989309310913f,-0.1559126079082489f,-0.14134526252746582f,-0.0003446042537689209f,-0.3474012613296509f,-0.19688887894153595f,0.22498734295368195f,-0.03074646182358265f}, -{0.10697010159492493f,-0.032194703817367554f,-0.18512000143527985f,0.11056272685527802f,-0.457832396030426f,-0.08291787654161453f,-0.1382003128528595f,0.3493293821811676f,-0.1379433423280716f,-0.18000167608261108f,0.42142823338508606f,-0.3482915461063385f,-0.4284936785697937f,-0.09961219877004623f,0.20204155147075653f,-0.18239720165729523f}, -{0.2847062647342682f,0.018552124500274658f,0.1271415501832962f,0.36562982201576233f,-0.09210338443517685f,0.2671583592891693f,0.2430230677127838f,0.2909286320209503f,-0.2802048921585083f,0.18043199181556702f,0.41849127411842346f,-0.287167489528656f,0.30147701501846313f,-0.09805309772491455f,0.1475500762462616f,0.2664158046245575f}, -{0.15459725260734558f,0.8468127250671387f,0.5192074775695801f,0.3231939673423767f,-8.05964183807373f,-0.3391801416873932f,1.1652286052703857f,-0.3086276054382324f,0.5984497666358948f,-1.6198935508728027f,2.087207317352295f,-0.5538924932479858f,-0.3962406814098358f,-0.048027459532022476f,0.5870500206947327f,0.09704883396625519f}, -{-0.408692330121994f,0.243210107088089f,-0.013073918409645557f,0.5256465077400208f,-0.3921836316585541f,-0.3010461926460266f,-1.416528582572937f,0.21378983557224274f,0.48517918586730957f,-1.8187716007232666f,-0.5715388655662537f,-0.12979117035865784f,-1.0657424926757812f,-0.6168913245201111f,-0.037499845027923584f,0.7113023400306702f}, -{-0.2991822361946106f,0.13201937079429626f,0.045195113867521286f,-0.05932474136352539f,0.24825486540794373f,0.07833488285541534f,-0.0513191744685173f,0.34576353430747986f,0.21296781301498413f,-0.35770976543426514f,-0.044228196144104004f,-0.36229726672172546f,0.13522203266620636f,-0.2606737017631531f,0.36124154925346375f,-0.019244026392698288f}, -{-0.2675279378890991f,0.9919194579124451f,0.4967791736125946f,0.42134350538253784f,0.4525410234928131f,0.7671056985855103f,-19.65119171142578f,-0.35019630193710327f,0.0774022787809372f,-0.9777984023094177f,0.30070915818214417f,-0.7200683355331421f,0.4576717019081116f,-3.745297908782959f,0.08763853460550308f,-0.12950114905834198f}, -{-0.015470266342163086f,-0.663902759552002f,-0.26218274235725403f,-0.9686974287033081f,-1.2697144746780396f,-1.2993874549865723f,-0.368642657995224f,-0.11653367429971695f,0.2285005748271942f,0.8276209831237793f,-1.812983512878418f,-0.3129367232322693f,0.5683643817901611f,0.6947913765907288f,0.2220814824104309f,0.7217218279838562f}, -{0.1863725483417511f,1.1391031742095947f,-3.1924281120300293f,-0.17470817267894745f,0.32248324155807495f,-0.45596322417259216f,1.3157312870025635f,-0.0976204127073288f,-0.049222759902477264f,-0.3381028473377228f,-3.256610631942749f,-0.09532349556684494f,0.0486641451716423f,-0.03208383917808533f,0.4447547495365143f,0.9656800031661987f}, + {-0.36079341173171997f,-3.9992425441741943f,-0.019920704886317253f,-3.7401278018951416f,0.35766279697418213f,0.7107656598091125f,0.15916572511196136f,-0.02236497588455677f,-0.6144473552703857f,-0.04320945963263512f,-0.11870327591896057f,0.0760134756565094f,-1.3407607078552246f,-0.35452646017074585f,0.8123229146003723f,0.6210054755210876f}, +{0.047732532024383545f,-0.08606647700071335f,0.3044530749320984f,-0.5685889720916748f,-0.5859180688858032f,0.5168874859809875f,-0.3198729455471039f,-0.0616832859814167f,-0.7202454805374146f,-0.24511195719242096f,0.2780170738697052f,-0.3857530355453491f,0.6130155324935913f,-0.3128521144390106f,1.8281869888305664f,-1.2537225484848022f}, +{0.07903262972831726f,0.2567390203475952f,-0.07798504829406738f,0.04248586297035217f,-0.1963958442211151f,-0.19260792434215546f,-0.4038352966308594f,0.015906542539596558f,0.15353140234947205f,0.030178606510162354f,0.2488909661769867f,0.13805970549583435f,-0.057077180594205856f,-0.235126793384552f,-0.3036302626132965f,0.08288257569074631f}, +{-0.30922991037368774f,-0.5792930126190186f,-4.273653984069824f,1.1453341245651245f,-4.5254364013671875f,0.282318651676178f,0.059267595410346985f,-0.25690674781799316f,1.9092224836349487f,-0.7065148949623108f,-0.1480179727077484f,-0.08419273048639297f,-1.9301722049713135f,1.1525237560272217f,1.7244079113006592f,0.7795507311820984f}, +{-0.39607733488082886f,0.04120592027902603f,0.1131146028637886f,0.022423356771469116f,0.09063010662794113f,-0.17578840255737305f,0.16012099385261536f,0.3626593053340912f,-0.17838427424430847f,-0.11053556203842163f,-0.10529157519340515f,-0.31317979097366333f,-0.23336799442768097f,-0.05953550338745117f,0.3211229145526886f,0.19986507296562195f}, +{-0.37449589371681213f,-0.5102877020835876f,-2.3412106037139893f,-1.9704302549362183f,-0.718756377696991f,0.4018186628818512f,-0.3192301094532013f,-0.37182047963142395f,0.11803273111581802f,-0.37043070793151855f,-0.25327548384666443f,-0.23666924238204956f,-0.43877601623535156f,0.18859024345874786f,-1.599037766456604f,-0.23787960410118103f}, +{0.4110594093799591f,0.3641268312931061f,-0.24094732105731964f,0.39241111278533936f,1.028276801109314f,0.09239723533391953f,-0.08670487999916077f,-0.25336313247680664f,-0.04216204956173897f,-0.06259563565254211f,-0.1344406008720398f,0.35313835740089417f,-2.1582298278808594f,0.9374165534973145f,0.3446822166442871f,-0.48981598019599915f}, +{-0.40892091393470764f,-0.05935406684875488f,-0.2623085081577301f,0.24000565707683563f,0.4653308093547821f,-0.13498064875602722f,-0.23312048614025116f,-0.390264093875885f,0.1819913387298584f,-0.1559126079082489f,-0.14134526252746582f,-0.0003446042537689209f,-0.16760802268981934f,-0.46420595049858093f,-0.04577748477458954f,-0.024266792461276054f}, +{0.10697010159492493f,0.18819847702980042f,-0.37870171666145325f,0.21184906363487244f,-0.37222859263420105f,0.013411798514425755f,-0.1382003128528595f,0.3493293821811676f,-0.360889196395874f,-0.3875247836112976f,0.42142823338508606f,-0.3482915461063385f,-0.3289247751235962f,-0.010594150982797146f,0.09620395302772522f,-0.06898030638694763f}, +{0.2847062647342682f,0.018552124500274658f,0.11435768008232117f,0.36562982201576233f,-0.047046810388565063f,0.1384449154138565f,0.2430230677127838f,0.2909286320209503f,-0.2802048921585083f,0.18043199181556702f,0.41849127411842346f,-0.287167489528656f,0.24782028794288635f,-0.3141365051269531f,-0.10168051719665527f,0.010465055704116821f}, +{0.15459725260734558f,0.7376908659934998f,0.28115618228912354f,-0.6975672245025635f,-0.5065810084342957f,-0.3017660677433014f,-0.08742031455039978f,-0.0630878359079361f,-0.9642277359962463f,-0.2220277339220047f,-0.020114075392484665f,-0.4160120189189911f,-0.6593955755233765f,-0.25608909130096436f,0.08111029863357544f,0.36404433846473694f}, +{-0.408692330121994f,0.11722688376903534f,-2.6202144622802734f,1.1614540815353394f,0.04688110575079918f,0.8050221800804138f,-0.10356326401233673f,0.040458135306835175f,-1.7546080350875854f,-0.3304281532764435f,0.02475929632782936f,-0.40160971879959106f,1.5910406112670898f,-0.8608219027519226f,-0.8164851069450378f,0.849300742149353f}, +{-0.2991822361946106f,-16.444902420043945f,-2.7731211185455322f,-9.340137481689453f,-0.21075564622879028f,-0.1905771791934967f,-0.29088878631591797f,0.1455707550048828f,0.9463095664978027f,-0.4181814193725586f,-0.044228196144104004f,-0.44137144088745117f,-3.0297417640686035f,0.3898687958717346f,-0.4988105893135071f,-1.0869044065475464f}, +{-0.2675279378890991f,-0.6821674108505249f,-0.42561009526252747f,0.20795567333698273f,0.15388953685760498f,-0.2611711621284485f,-0.5058139562606812f,-0.7550562024116516f,-0.1124289333820343f,-0.8204157948493958f,-0.48899734020233154f,-0.7760970592498779f,0.9054858088493347f,-0.5096421241760254f,-0.6139748096466064f,0.4697928726673126f}, +{-0.015470266342163086f,0.3406878411769867f,-0.34045615792274475f,0.7845275402069092f,0.12758617103099823f,-0.1876579076051712f,0.05196094512939453f,0.020785843953490257f,-5.119916915893555f,-0.5137317776679993f,0.1519099771976471f,-0.3556460440158844f,-1.3449710607528687f,-0.5167357921600342f,-8.097357749938965f,1.6800681352615356f}, +{0.1863725483417511f,0.4552655518054962f,-1.4158952236175537f,-2.1374547481536865f,0.7595136761665344f,-0.04729481041431427f,0.04860696196556091f,0.06409500539302826f,1.3406081199645996f,0.18544192612171173f,-0.5370227098464966f,0.20714588463306427f,1.428971290588379f,-0.014740538783371449f,-0.4222463369369507f,-1.120627760887146f}, }; -const float hout[16] = { 0.45773375034332275f,0.12560291588306427f,-0.11175110936164856f,-0.1076873317360878f,-0.22688986361026764f,0.0996299684047699f,-0.1165262907743454f,-0.06413542479276657f,-0.08547917008399963f,-0.10551206022500992f,0.11794675886631012f,-0.051283299922943115f,-0.07513727247714996f,0.10889608412981033f,0.10124985873699188f,-0.09357111901044846f }; - -const float b1[16] = { 0.2962568402290344f,1.0064163208007812f,-1.7145336866378784f,-0.5373859405517578f,0.8944404125213623f,0.48690545558929443f,-0.14995934069156647f,3.185513973236084f,0.3992059826850891f,-0.3432198166847229f,0.0617363266646862f,0.8845642805099487f,-1.8659136295318604f,-0.9155887365341187f,-1.087764859199524f,0.5785734057426453f }; - -const float b2[16] = { -0.755774736404419f,-0.5792715549468994f,-1.5842629671096802f,-0.8578898310661316f,-0.6939148902893066f,-0.02991844341158867f,0.30195581912994385f,-0.6438045501708984f,-1.2855838537216187f,-2.1527836322784424f,0.730652928352356f,0.1157657578587532f,-0.3448236882686615f,2.148630142211914f,-0.6408219933509827f,0.5441248416900635f }; - -const float b3[16] = { -1.963319182395935f,-1.9574757814407349f,2.004293918609619f,2.199665069580078f,-0.4670379161834717f,0.34952792525291443f,-3.200674295425415f,-1.0005841255187988f,0.7618258595466614f,2.12058162689209f,-0.7590987682342529f,-0.37147605419158936f,-0.6215092539787292f,-0.03694118186831474f,-1.5954755544662476f,1.2799572944641113f }; - -const float bout[1] = { -0.17161530256271362f }; +const float hout[16] = { 0.45773375034332275f,0.06918291747570038f,-0.12925687432289124f,-0.15688492357730865f,-0.09581243246793747f,0.12980027496814728f,0.05758979171514511f,-0.07756929844617844f,-0.07437136024236679f,0.088389091193676f,0.1648382991552353f,-0.1090453714132309f,-0.07618726044893265f,0.10542070865631104f,-0.10273952782154083f,-0.09904715418815613f }; + +const float b1[16] = { 0.3319792151451111f,0.38004234433174133f,-1.7917866706848145f,0.8671742081642151f,0.7934799790382385f,0.8670303821563721f,-0.651479184627533f,4.418480396270752f,-1.6263774633407593f,-0.5555577278137207f,-0.8048836588859558f,1.0582845211029053f,-0.5338819622993469f,-2.1279237270355225f,-1.087764859199524f,2.0707762241363525f }; + +const float b2[16] = { 1.2374228239059448f,1.128933072090149f,-1.5688477754592896f,-0.9324873685836792f,-0.827792227268219f,-0.05313319340348244f,0.6596731543540955f,-0.6443398594856262f,-1.352556824684143f,-2.093569755554199f,-0.12882685661315918f,-0.05392090231180191f,-1.7019206285476685f,1.365263819694519f,1.3740285634994507f,1.7110040187835693f }; + +const float b3[16] = { -1.963319182395935f,0.3110598921775818f,1.3809770345687866f,1.4498616456985474f,1.02727472782135f,0.8841015696525574f,-0.6412962675094604f,-1.1947987079620361f,-2.0401856899261475f,0.14284981787204742f,-0.3684021830558777f,-0.4421199858188629f,-1.098542332649231f,2.0177974700927734f,-1.0107595920562744f,-0.3846563398838043f }; + +const float bout[1] = { -0.2631767988204956f }; float valve_ref_pos_buffer[10] = {0.0f}; @@ -1040,8 +1040,8 @@ input_NN[ind] = torq.sen / 10000.0f * 8.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 * 8.0f + 0.5f; - input_NN[ind] = (f_future[time_interval*i+time_interval])/10000.0f*8.0f+0.5f; + 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])/10000.0f*8.0f+0.5f; ind = ind + 1; } @@ -2349,7 +2349,17 @@ case MODE_VALVE_POSITION_CONTROL: { if (OPERATING_MODE == 5) { //SW Valve - VALVE_POS_CONTROL(valve_pos.ref); + + ///////////For Test LIMC/////////////////////////////////////////////////////////////////////////////////////////////////// + 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); V_out = Vout.ref; } else if (CURRENT_CONTROL_MODE == 0) { //PWM V_out = valve_pos.ref;