一次串口数据监控
序 1 2 3 4 5 6 7 8 十六进制 53520D 53520D35303334393332383B 4A560D 4A560D2D3136363636363B 43415B32335D0D 43415B32335D0D303B 43415B31385D0D 43415B31385D0D31303030303B ASCII码 SR 连接演示箱的ELMO演示箱的COM1到电脑的串口(COM1) 打开ELMO软件(软件可以到官方网站下载) 单击完成 选择速度模式(VelocityMode) 单击圈选的按钮(motoron) 进入速度模式 输入一个速度值,单击GO,电机以输入的速度运转 单击Stop停止,单击Direction改变方向。 输入20000(cnt/sec)按回车后,相当于输入 JV=20000; BG 我们可以在命令输入框内输入命令实现控制。 输入: JV=30000;回车 BG回车 电机以30000cnt/sec运转 输入: ST回车 电机将停止 提示:ST(相当于STOP)BG(相当于BEGIN) 设定数字输入端口的功能 我们可以设定INPUT1为高电平,硬停止 通过命令输入 JV=30000; BG 电机开始旋转, 然后将INPUT1拨动到高电平,电机停止,当INPUT1拨回高电平后,电机恢复运转,因为硬停止,并不更改软件的运动状态。 但是,当我们使用“SoftStop”时,当我们置INPUT1为高电平后,软件也停止了,即使,再让INPUT1为高电平后,电机也不能恢复运转。 其他功能的配置如下: 更多指令 MO=1 MO=0 以上的含义是:Motoron/off UM Unitmode:stepper,torquecontrol,speedcontrolpositioncontrolordualloop CurrentMode电流模式下,输入命令UM返回1 VelocityMode速度模式下,输入命令UM返回2 StepperMode步进模式下,输入命令UM返回3 DualLoopMode,输入命令UM返回4 PositionMode,输入命令UM返回5 Unitmode(UM):DefinesthefunctionoftheMetronome.Theunitmodesare: UM=1Torquecontrol UM=2Speedcontrol UM=3Micro-stepping UM=4Dual-feedbackpositioncontrol UM=5Single-feedbackpositioncontrol RM Referencemode:external(analog)referencingenabled/disabled 所有命令: Command Description PP[N] DefinetheparametersoftheCANorRS-232communication Command Description AG[N] AS[N] BP[N] CA[N] CL[N] EF[N] EM[N] ET[N] Analoggainsarray Analoginputoffsetsarray Brakeparameter Commutationparametersarray Currentcontinuouslimitationsarray Encoderfilterfrequency ECAMparameters EntriesforECAMtable FF[N] FR[N] HM[N] HY[N] MC MP[N] PL[N] PM PT PV PW[N] QP QT QV RM TR UM VH[N] VL[N] XM[N] YM[N] Feedforward Followerratio Homingandcapturemode Auxiliaryhomeandcapturemode Definemaximumpeakcurrentofservodrive,inamperes Motion(PT/PVT)parameters Peakdurationandlimit Profilermode Positiontimecommand Positionvelocitytimecommand PWMsignalparameters Position Time Velocity Referencemode:external(analog)referencingenabled/disabled Targetradius Unitmode:stepper,torquecontrol,speedcontrolpositioncontrolordualloop Highreferencelimit Lowreferencelimit XModulo YModulo Command Description GS[N] KG[N] KI[N] KP[N] KV[N] XA[N] XP[N] Gainscheduling Gainscheduledcontrollerparameters PIDintegraltermsarray PIDproportionaltermsarray Advancedfilterforspeedloop Extraparameters?(more) Extraparameters Command Description BH RC RG RL RP[N] RR RV[N] YM[N] Getasamplesignalashexadecimal Variablestorecord(twovariablesateachrecordingsequence) Recordinggap,insamples.Gapbetweenconsecutivedatarecordings. Recordlength Recorderparameters Recordingon/off Recordedvariables Auxiliarysensormodulocount Command Description AB[N] ID IQ Absoluteencodersettingparameters Readactivecurrent Readreactivecurrent PE PX PY VE VX VY YA[N] Positionerror Mainencoderposition,incounts Auxiliaryposition Velocityerror,incountspersecond Mainencodervelocity,incountspersecond Velocityofauxiliaryfeedback Auxiliarypositionsensorparameters 2 2 Command Description CD DF DS EO HX LD RS SV TM TP[N] TS TW[N] UF[N] UI[N] WI[N] WS[N] ZP[N] ZX[N] CPUdump:CPUanddatabaseexceptionsummary Downloadfirmware Downloadfirmware Echomode Selecthexadecimalordecimalmode Loadparametersformflashmemory ResetMetronometoapre-definedstateandparametervalue Saveparameterstoflashmemory Systemtime Floatingwizardparameters Samplingtime Wizardcommand Userfloatarray Userinteger Metronomedata,mainlyforusebyComposer Metronomedata,mainlyforusebyComposer Integerwizardparameters Userprogramandauto-tuningtemporarystorage Command Description AN[N] IB[N] IF[N] IP OB[N] OC[N] OL[N] OP Readanaloginputs Bit-wisedigitalinput Digitalinputfilter Readalldigitalinputs Bit-wisedigitaloutput OutputCompare OutputLogic Setalldigitaloutputs Command Description AC BG BT DC IL[N] JV Acceleration,incountspersecond Beginmotion Beginmotionatdefinedtime Deceleration,incountspersecond Inputlogic,defininghowdedicatedinputsbehave Speedofjoggingmotion,incountsperssecond 2 22 MO PA PR SD SF SP ST TC Motoron/off Absolutepositionreferenceforpoint-to-pointmotion Relativepositionreferenceforpoint-to-pointmotion Stopdeceleration Smoothfactorformotioncommand Speedforpoint-to-pointmotion Stopmotionusingdecelerationvalue Torquecommand Command Description ER[N] HL[N] LL[N] PL[N] Maximumtrackingerrors Over-speedlimitandpositionrangelimit Lowactualfeedbacklimit Peakcurrent,inamperes;andpeakduration,inseconds Command Description BV DD DV[N] EC LC MF MS PK SN SR TI[N] VR MaximummotorDCvoltage CANcontrollerstatus Referencedesiredvalue Errorcode:getcodeforlastinterpretererror Currentlimitation:reportstatusofcurrentlimitationalgorithm Motorfault:codeforlastmotor-disablecause Motionstatusreporting Peakmemory Serialnumber Numerical,bit-codedMetronomestatus Temperatureindicationsarray Software(firmware)version Command Description CC CP DL HP KL LP[N] LS MI PS XC XQ Compileprogram Clearapplicationprogram ReceiveaprogramdownloadedfromhostcomputertoMetronome.CanbeusedonlyinComposersoftware. Haltprogramexecution Killmotionandstopprogram(likeHP) Listparameters Listprogram Maskinterrupt Programstatus Continueprogramexecutionfromcurrentpointer,optionallyuntilagivenbreakpoint Executeprogram,optionallystartingatagivenlabelanduntilagivenbreakpoint ELMO编程基础 示例程序: ##START mo=0表示:motoroff um=2表示速度模式 il[1]=7表示输入逻辑 il[2]=7 il[3]=7 il[4]=7 il[5]=7 mo=1表示motoron while(1) if(ib[1]==1)表示输入2 jv=20000 elseif(ib[2]==1)表示输入3 jv=-20000 elseif(ib[3]==1)表示输入4 jv=50000 elseif(ib[4]==1)表示输入5 jv=-50000 elseif(ib[0]==1)表示输入1 jv=0 end bg end 增加模拟量输入: ##START mo=0 um=2 il[1]=7 il[2]=7 il[3]=7 il[4]=7 il[5]=7 mo=1 while(1) if(ib[1]==1) jv=20000 elseif(ib[2]==1) jv=-20000 elseif(ib[3]==1) jv=50000 elseif(ib[4]==1) jv=-50000 elseif(ib[0]==1) jv=an[1]*60000 end bg end 下载程序流程: 首先,让电机进入motoroff状态 编译或者快捷键F7 没有错误,编译成功时, 单击,下图红色圆圈,上载程序到ELMO驱动器。 单击“是(Y)” 单击“ExecuteCtrl+F5”执行程序 因篇幅问题不能全部显示,请点此查看更多更全内容