利用Matlab提取图片中的数据
从事科研或者工程的人员在文档撰写过程中,常需要将文献中的曲线与自己的结果对比,为获取原始数据,一种常用的办法是手动描点,即将原始曲线放大然后打印出来,选取一定数量的点,读出其横纵坐标,然后重绘。对于较为平坦的曲线,这种方法当然可行,但当曲线数量增加,曲线变化复杂,这种方法工作量可想而知。前段时间由于原始数据丢失,仅剩几十幅图片,本人尝试过手动描点,经历几个小时奋战,实在无法继续,索性转向matlab,借助其强大的数据处理能力,编写了两个GUI的小软件image2data、data_poly提取数据,如今大功告成,遂于大家分享。坐标轴标定按下面板上的按钮进行图像放大,按钮恢复初始显示大小,钮采用鼠标拖动图像按钮退出放大或者拖动的鼠标操作模式,空格键表示取点操作,键表示删除上一次取点操作,状态栏的显示当前鼠标取点总数目(注意,初始点数为,然后存处个坐标轴标定坐标,剩余用来存储曲线坐标)。值得指山的是,每次放大或者拖动桨作完毕后,必须按下按钮,才能用空格键进行取点操作。匹回图00.400.351 MHz足0.300.2530 MHz0.20frequency>100 MHz型30681012141618REVERSE VOLTAGE (VFigure 1. RF Capacitance vs ReverseBias. HSMP-3810 Series图坐标轴定标曲线描点按照上述操作反复进行图像放大、拖动、取点,状态栏的和用于显示当前坐标(注紊,这个坐标图像坐标,轴方向向下,后面坐标变换需要考虑),下图给出了描点完毕后的曲线,可以看出取点基本代表了曲线的全部信息。0.45E0400351 MHz0.3002530 MHZ.frequency> 100 MHzpr/。no0.1568101214161820REVERSE VOLTAGE (V)Figure 1. RF Capacitance vs Reversem[1Bias. hsMP-3810 Series图曲线描点数据处理及存储。按下按钮,描点后的曲线会显示在图像当中,按下按钮,程序自动进行坐标转换,得到所有描点的真实坐标,按卜按钮,使会生成一个文木,数据记录其和按钮下都有文本输入框,本别代表输入文本和存储文本的名称,不带后缀)。045"z55sd0.351M3002530 MHafrequency>100 MHz0.1502468101214161820REVERSE VOLTAGE (VFigure l. RF Capacitance vs Reversese4Bias. HsMP-3810 Series图拟合曲线效果记事本巴回囟文件〕编辑巴)格式迫!查看y1帮助)6,6ag15-92h432562gP-6811.18153B60-91488g2c-8912.15288c-E914.81Q68c-691.93177一Bg1571882c-6E-8Ube-出14.168y!:e-Uk1面=363211g-9g1py9py6-6817.99日969e-B914。394g55e-919.6696599e-B913.941218e-0911.119913-Bg3.E786699g-6511.36361243.779192-6811,5邵3777e十3.71813e-6117699899e+053.6164171e-6911_97了5775巴十B035小B725-6612-3111uB!g318286-B12.了7阳7P??5"24"9236P-R13.12096E5e+gs2502的9e-6613.526859e-E日31756187e-651391427562B9.1158646e-6814_287193.806E87ge-651h。47785F7eB98,38E17e-61↓816F877e+2.9877229e-6615.342g3B6e-Eg2.92049e-6615,6428g1eB9g2.B86ge6168697eBgg28616e-816652032cE9g78786ggc-691图数据记录文本数据后处理由于以上数据是于动选取的,故分布不够均匀,下面我们通过数据拟合,然后重新采样得到等间距的数据(可能大家会问,为什么两个功能不做在起呢?数据拟合是个比较味烦的事情,本组曲线采用多项式拟合即可,可对于更多的曲线采用指数函数、正弦函数等才能得到比较好的结果中的工具箱就包含了很多的拟合函数,为避免重复工作,仅绵写了这个小软件用来数据拟合再采样,其他的拟合就靠了)。运行代表多项式拟合的阶数(一般就够用了),代表重新釆样的数据个数,其他几个就不用解释了,默认输入文本为输出文本为,数据拟合结果如下图所示Xmax 23 ymax045fing图数据拟合再采样结果至此,数据提取过程完毕,可能操作上有些不便(毕竞只是小T具而已),但比起于动描点的速度和精度,可谓小巫见大巫。软件编写要点这两个小软件从构思到完成大概用了两大,功能的完成绝大部分归功」丰富的函数库和方便的,其中用到的主要函数上要有列衣如下,更详的介绍请参阅文档。表主要函数列表除了上述函数的掌握之外,还需要对的数据结构和函数响应有一定的理解,在此就不多讲了(多看相关例程就明白了)。编写程序之前,首先心中要有一个框架,做些什么,怎么做,顺序如何等。本软件的结构如下图所示:导入图像创建数据结构坐枟轴定标曲线描点坐标变換数据后处彐:拟合、重新采样、存储图程序沇程示意导入图像程序段:创建数据结构程序段坐标轴定标及坐标变换:数据后处理代码段附录3.1描点数据列表数据拟合结果3.3、重新采样数据列表
- 2020-12-04下载
- 积分:1
ST FOC 5.0说明书 快速入门 SDK v5.0.pdf
ST FOC 5.0说明书 配合 开源库 https://download.csdn.net/download/hxinstar/10322042使用UM2374List of tablesList of tablesTable 1. List of acronymsTable 2Document revision history..23UM2374 Rey 13/24List of figuresUM2374List of figuresFigure 1. ST MC Workbench -Icon and installation folder treeFigure 2. ST MC Workbench-GUI expanded top viewFigure 3. ST Motor Profiler-GUI889Figure 5. ST Motor Profiler-SM-PMSM parameters exampleFigure 4. ST Motor Profiler- Hardware setup list examples1011Figure 6. ST Motor Profiler-l-PMSM parameters exampleFigure 7. ST Motor Profiler-Measurement results12Figure 8. ST Motor Profiler-Save window13Figure 9. ST MC Workbench - New Project window14Figure 10. ST MC Workbench -New Project Info window14Figure 11. ST MC Workbench -Project Settings15Figure 12. ST MC Workbench-Project Settings window.15Figure 13. ST MC Workbench -Project generation button16Figure 14. ST MC Workbench -Workspace selectionFigure 15. ST MC Workbench -Project generation build infoFigure19. ST MC Workbench- Use of the motor control and monitoring.∴、∴,"…,,∴…….17Figure 16. IDE-MC Project view example18Figure 17. STMC Workbench-Motor monitoring button.19Figure 18. ST MC Workbench -Motor monitoring GUI204/24UM2374 Rey 1/UM2374General informationGeneral informationThe Mc sDK is used for the development of motor-control applications running on STM3232-bit microcontrollers based on the arm Cortex-M processorTable 1 presents the definition of acronyms that are relevant for a better understanding ofthis documentTable 1. List of acronymsAcronymDescriptionGUIGraphical user interfaceIDEIntegrated development environmentFOCField-oriented controlFWFirmwareMotor controlMC WBMotor control Workbench(STMicroelectronics sw tool)MPMotor Profiler(STMicroelectronics software tool)PMSMPermanent-magnet synchronous motorPWMPulse-width modulationSDKSoftware development kitVCVector controlMore information about ST MC Workbench is provided in the stm32 motor control SDKv5.0toolsusermanual(um2380)availableatwww.st.comarmUM2374 Rey 15/24Motor control ecosystem setupUM23742Motor control ecosystem setupA suitable ST Motor Control ecosystem environment includesA PC running the needed Mc software toolsA third-party IDEa third-party ANSI C-compilerA JTAG/SWD interface for debugging and programmingAn STMicroelectronics application board with one of the STM32 microcontrollerssupported. It drives the power stage and featuresPWM outputs to gate driverADC channels to measure currentsDC bus voltageA three-phase PMsM motol· A power supplyRefer to the STM32 motor control software development kit(Mc sDk data brief(DB3548)atwww.st.comandtothereleasenoteformoredetails2.1Software tool setupThe STMicroelectronics motor-control ecosystem runs on a pc with Windows7The following Pc software tools are correctly installedST MC Workbench (v5.0.0 or later)STM32CubeMX(v4 24.0 or later)ST-LINK/2(v4.0.0 or later)Any supported IDEIAR Embedded Workbench@ for Arm(v7.80.4Keil MDK tools (v5.24.2 or later)Ac6 System Workbench(v2.3.0 or later)(a)Refer to the respective user manuals for proper installation. STMicroelectronics documentsareavailablefromtheinternetsiteatwwwst.comSTM32 motor control SDK v5.0 tools user manual (UM2380STM32 CubeMX for STM32 configuration and initialization c code generation usermanual (UM1718)STM32 ST-LINK utility software description user manual(UM0892)The AC6 tool framework is not supported in SDK v5.0 but in later versions6/24UM2374 Rey 1/UM2374Motor control ecosystem setup22Hardware setupThe connection of the STMicroelectronics application board to the pc requires a USBType-A connector. Refer to the description of the application board for details on the USBcableA dedicated description card is delivered with each STMicroelectronics application board forproper installation For more details, refer to the user manual of the board available atwww.st.comThe selected hardware can be one of the three setups· The complete MC KitOne of the complete inverter boardsAny STM32 evaluation board combined with one of the ST evaluation power stagesthat include the mc connectorUM2374 Rey 17/24Getting StartedUM23743Getting StartedWarning: Check that the board is correctly configured for the motorcontrol application and supplied with the expected inputvoltageNoteRefer to the user manual of the related hardware to setup the correct configuration, voltagerange, serial communication capabilities, and programming/debugging interface3.1Hardware connectionConnect a uSb cable between the pc and the stmicroelectronics application board andthe JTAG/SWD programming cable if it is different from the USB cable3.2Motor profilingLaunch the ST MC Workbench software tool either byclicking on its iconrunning it directly from the installation folder treeBoth ways of launching the ST MC Workbench are illustrated in Figure 1Figure 1. ST MC Workbench- Icon and installation folder treeI STMicroelectrorics感FOC SDKLv.3.0MotorControlv500WorkBenchST Motor Control Workbenchd ST Motor profileren the st motor profiler tool either byUsing its dedicated button in the St Mc Workbench GUl as illustrated in Figure 2Running it directly from the installation folder tree as illustrated in Figure 1Figure 2. ST MC Workbench-GUl expanded top viewFile Tools Help Documet ta ionNew ProjectLoad Project4 About HelpMotor ProfilRcGert ProJEcts己tdbrsDRpower board8/24UM2374 Rey 1/UM2374Getting StartedClick on the Select Boards button to display the list of supported boards as shown onFigure 3 and select the STMicroelectronics application board setup. Figure 4 on page 10presents examples from this listNoteThe ST Motor Profiler tool may be used only with ST hardware in the list of supportedsetups.Figure 3. ST Motor Profiler-GUI2 ST Motor Profile.l:e augmentedMotor ProfilersPole pairsPe row to detecbeed and Current /mitsMaκSpet1600FPMn7 Select Board∧pk02530pkMagnetic: SM-PMSN○-NSMMechanIcal mode lO CenElectrical modelOW000UM2374 Rey 19/24Getting StartedUM2374Figure 4. ST Motor Profiler-Hardware setup list examplesE ST Motor ProfiY Hideabsolete boarde arch Control board by narSe arch power boac bv nareControl boardower BoardxCancelHide boards with warningNUCLEO-F302R8X-NUCLEO-HMOTM1 3shNUCLEO-F302R8X-NUCLEO-HMOBM1 3shT2F302R8T6L6230PDSTM32F302R8T6STL22ON6FT●Acf8m:m3SELNRV2 Emiol connectorC Product Web PageG Product Web PageC Product Web PageC Product Web PageNUCLEO-F303RESTEVAL-IPMO5F 3ShNUCLEO.F303RESTEVAL-IPM108 3sh●Aiv命Ativ● Ac livSn Ngor ombreI connectorST-LINKV2C Product Web PageC Product Web PageC Product Web PageC Product Web PageClick on the sTmicroelectronics hardware setup to select it and configure the st motorProfiler toolAs an example, Figure 4 shows the selection of the P-NUCLEO-IHM001 motor controlNucleo pack with NucLEo-F302R8 and X-NUCLEO-IHMO7M1After hardware setup selection, fill in the parameter fields with the motor informationThe number of pole pairs of the motor(mandatory fieldThe Max Speed of the motor(optional field)by default, the st Motor Profiler tool searches for the maximum allowed speedmatching the motor and the hardware setup usedThe Max Current allowed by the motor(optional field)By default, it is the maximum peak current deliverable by the hardware setupThe nominal dC bus voltage used by the hardware setup(optional field)By default, it is the power supply stage as either the bus voltage for low voltageapplications(DC voltage), or the RMs value for high voltage application(Ac voltage)The magnetic built-in type(mandatory field)By default, the SM-PMSM is selectedThe Ld/Lq ratio(mandatory field only when l-PMSM built-in is selected as shown inFigure 6 on page 1110/24UM2374 Rey 1/
- 2020-11-29下载
- 积分:1