Home
241 Intelligent Stepper Drive Manual
Contents
1. AN WARNING Incorrect QER value can result in unpredictable closed loop control operations 9 5 9 6 9 7 9 8 Check Quadrature Encoder Resolution Function Check current quadrature encoder resolution OxAA 0x00 OxC2 R2 R1 RO OxFF OxC2 is the Message ID for QER Comment R2 RO represents encoder resolution See figure 2 1 for how to convert to an unsigned 16bit integer Duality of STP Instruction When closed loop control module is enabled MCFG lt QEM gt 1 STP x defines encoder based relative position instead of relative pulse On the contrary when this module is disabled STP x defines relative pulse SPD Instruction Definition Whether closed loop control module is enabled or not SPD x defines pulses sent to motor per second Restrictions on POS Instruction In the closed loop control mode an instruction of POS x will generate an error ACK but the instruction POS can be used to check the current pulses accumulated since the origin point was set increases for positive running decrease for reverse running Similarly in open loop control mode an instruction of QEC x will generate an error ACK but the instruction QEC can be used to check the quadrature encoder pulses accumulated since the origin point was set increases for positive running decrease for reverse running Myostat ca page 48 M M C Inc
2. User Manual UIM241XX Series RS232 Instruction Control Miniature Integrated Stepper Motor Controller UIM24102 04 08 UIM241XX Ordering Information In order to serve you quicker and better please provide the product number in following format UIM241XX PART NUMBERING SYSTEM Opina E External Encoder Closed Loop Opina Internal Encoder Closed Loop Series Optional S 2 Sensor Input Ports Optional M Advanced Motion Control T Screw Terminal Motor RS232 Connector P Plug Socket Control Control Max Curent 02 2A 04 4A 08 8A bo E Note If not selected the code box can be deleted Default control connector is T screw terminal if not selected Examples UIM24104P UIM24104T M UIM24104 M S E UIM24104 S Examples of Control Connector options Screw Terminal Rectangular Plug Socket Myostat ca page 2 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller UIM24102 04 08 RS232 Instruction Control Miniature Integrated Stepper Motor Controller Miniature Integral Design Embedded DSP Microprocessor Miniature size 42 3mm 42 3mm 16 5mm Hardware DSP 64bit calculation precision Fit onto motors seamlessly Quadrature encoder based closed loop control Die cast aluminum enclosure improving Advanced motion control linear and non linear heat dissipation and durability acceleration and decelera
3. ccccccecccceececeececeeeeeeeeeeceeceseecesaeeesseeceseeeessaeessneeeseeeesaes 48 9 6 Wi Wo STP NSTUCHON TM Km 48 9 7 SPD Instruction GIRO riirii rierada a aaie 48 9 8 Restrictions n POS Inst HOHOLD ae EEEE EE EAE NEERA niai 48 APPENDIX A DIMENSIONS 4 EEA Ea 49 APPENDIX B SETE iLe p EE A EE EN NE E 50 M M C Inc Myostat ca page 9 UIM24102 04 08 1 1 1 0 Overview UIM241 miniature integrated stepper motor controllers communicate with user device using RS232 protocol The user device controls UIM241 through ASCII coded instructions Communication baud rate can be changed through instruction and will be burned into on board EEPROM UIM241 controller has a size of 42 3 x 42 3 x 16 5mm and is designed to mount onto NEMA17 23 34 42 stepper motors seamlessly UIM24102 can provide 0 7 2A output phase current UIM24104 can provide 1 5 4A output phase current and UIM24108 can provide 3 8A output phase current Phase current is adjustable through instructions Once set the value is stored into on board EEPROM UIM241 controller also has high speed current compensation to offset the effect of Back Electromotive Force BEMF to facilitate the motor s high speed performance UIM241 controllers use 12 40VDC power supply UIM241 s architecture includes communication system basic motion control system Quadrature encoder interface and real time event based change notification system Furthermore there are three optional modules can be
4. 0010 An example is provided below Example 8 12 System Description A reciprocating mobile platform has one linear potentiometer attached to the mobile table Within the stroke range the potentiometer outputs 0 6V 4V Requirements ils As soon as the sensor output is less than 0 6V the stepper motor starts to run forward DIR 1 until the potentiometer outputs arrives 4V 2 As soon as the sensor output is higher than 4V the stepper motor starts to run backward DIR 0 until the potentiometer outputs reaches 0 6V 3 Keep the reciprocating motion without the user control device Realization 1 First stop the motor by sending OFF 2 Set MCFG lt ANE gt 1 MCFG lt CHS gt 0 get MCFG 1000 0000 0000 0001 binary 0x8001 hex 32769 decimal Send instruction MCFG 0x8001 or MCFG 32769 It is required Start and Run Forwardly on S1 falling edge when analog input lt 0 6V so S1FACT lt 3 0 gt 1010 5 It is required Start and Run Reversely on S1 rising edge when analog input gt 4V therefore S1RACT lt 3 0 gt 0010 6 Fill the S12CON with above bits get S12CON 0000 0000 0010 1010 binary 7 Add suffix code 0000 for S12CON get SCFG 0000 0000 0010 1010 0000 binary 0x002A0 hex 672 decimal 8 Send instruction SCFG 0x2A0 or SCFG 672 9 Calculate the upper limit 4V 5V 4095 3276 0000 1100 1100 1100 binary 10 Add suffix code 0011 for ATCONH get SCFG 0000 11
5. See figure 2 2 for how to convert to a signed 32bit integer Position is essentially recorded from counts of the pulse counter Therefore the actual motor position is also relative to the micro stepping resolution The position counter records the total pulses sent to motor When the direction is positive DIR 1 the counter increases by 1 when the direction is negative DIR 0 the counter decreases by 1 Therefore the value of the counter is a signed 32bits integer with positive representing the final position is of the same direction of DIR 1 and vice versa POS position control is open loop control The absolute position counter only resets back to zero in two situations 1 Userissues the instruction ORG described later 2 User pre configured sensor ORG event takes place Power Failure Protection Should a Power Failure situation happen the value of the pulse counter will be pushed into EEPROM and restored when reboot next time However passive movement after power off cannot be recorded 6 14 Check Current Position POS Variable Feedback Comment Check current position N A OxCC 0x00 OxBO P4 P3 P2 P1 PO OxFF OxBO is the Message ID of current position POS P4 PO denotes the desired absolute position See figure 2 2 for how to convert to a signed 32bit integer Position is essentially recorded from counts of the pulse counter Therefore the actual motor position is also relative to the micro ste
6. specified before x it is taken as Once H bridge is enabled motor starts running on receiving the instruction SPD x x40 until another instruction SPD 0 is given For a 1 8 stepper motor if the SPD 100 User sent SPD 100 If MCS 1 motor speed 1 8 100 180 sec 30 rpm If MCS 16 motor speed 1 8 100 16 11 25 s 1 875rpm 6 10 To Check Current Speed SPD Function Check current speed Feedback OxCC 0x00 OxB2 SPD2 SPD1 SPDO OxFF OxCC denotes feedback of current status OxB2 is the Message ID of current speed SPD Comment SPD2 SPDO denotes the current motor speed See figure 2 1 for how to convert to a signed 16bit integer Unit is pulse second PPS or Hz The sign of the value denotes motor direction Myostat ca page 24 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 6 11 Displacement Control Instruction STP STP x Set the desired incremental displacement steps or micro steps if MCS 1 Integer x 2 000 000 000 1 0 1 2 000 000 000 OxB6 is the Message ID of STP STP4 STPO denotes the desired motor displacement See figure 2 2 for how to convert to a signed 32bit integer Displacement is essentially defined as counts of the pulse or encoder counter Therefore the actual motor displacement is also relative to the micro stepping resolution or encoder resolution Comment If an STP 0 instruction is received before the
7. 500 4 22000 pulses each turn QEC is the abbreviation for Quadrature Encoder Counter QEC instruction is basically of the same use as POS The difference is that POS is for open loop control while QEC is for closed loop control When closed loop control module is enabled MCFG lt QEM gt 1 QEC instruction can be used however a POS instruction can only leads to an error ACK except when it is used for status inquiry On the other hand in open loop control POS instruction can be used while QEC instruction can only be used for status inquiry provided that an encoder is included in the system whose QER is correctly configured and the Encoder Decoding Module is enabled i e MCFG lt QEI gt 1 9 3 Check Current Encoder Position Check current encoder position EC Feedback OxCC 0x00 OxB1 Q4 Q3 Q2 Q1 QO OxFF OxB1 is the Message ID of current encoder position QEC Comment Q4 QO represents the desired quadrature encoder position See figure 2 2 for how to convert to a signed 32bit integer M M C Inc Myostat ca page 47 UIM24102 04 08 9 4 Quadrature Encoder Resolution Setting Instruction QER Function Set the quadrature encoder resolution to x Integer x 0 1 65000 OxAA 0x00 OxC2 R2 R1 RO OxFF OxC2 is the Message ID of QER R2 RO represents encoder resolution See figure 2 1 for how to convert to an comment unsigned 16bit integer QER is the abbreviation for Quadrature Encoder Resolution
8. Byte 9 Byte10 is the 1st Byte 2nd Byte 3rd Byte shown in figure 2 1 respectively Myostat ca page 14 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 3 3 Baud Rate Change Instruction BDR Factory default baud rate of UIM241XX controller is 9600 User can change the baud rate as described below using the instruction BDR On receiving the BDR instruction the new baud rate will be stored in the EEPROM and will take effect after the controller is restarted BDR x Set the RS232 communication baud rate of UIM241XX controller to x Integer x 9600 57600 OxAA reserved OxBD OxFF OxBD is the Message ID of instruction BDR Commen reserved is for factory use New Baud Rate will be stored in the controllers non volatile memory EEPROM New baud rate will take effect after the controller is restarted 3 4 Reset Baud Rate to Factory Default 9600 In case of forgotten the baud rate and cannot establish the connection please take the following steps to reset the baud rate to factory default of 9600 1 Reboot the controller 2 n 10 seconds short the terminal 9 figure 0 1 to analog ground terminal 6 for 2 times with intervals around 1 second Each time the LED on the controller will flash If exceed 10 seconds please restart from step 1 If successful the LED will turn off for one second and re lit That indicates the baud rate has been changed to 9600 and ready to use 5 Use BDR in
9. Control Depends on MCFG lt S1IE gt Forward Displacement Control Depends on MCFG lt S1IE gt Reset position and encoder counter Depends on MCFG lt S1IE gt 8 6 Analog Threshold Control Register ATCON amp ATCONL A ATCONH and ATCONL define the upper and lower limit of the analog threshold Both registers are 16bits registers in the controller memory space configured through SCFG instructions However when configuring user needs to affix a 4bits suffix code to point to a specific register The suffix code for ATCONL is 0010 binary The suffix code for ATCONH is 0011 binary ATCONH structure is as follows A a value Reserved AH lt 11 0 gt Bit 15 12 Unimplemented read as 0 Bit 11 0 AH lt 11 0 gt Upper limit of analog threshold ATCONL structure is as follows KE pwiwiwissimieisieiel sje sisiye m value Reserved AL lt 11 0 gt Bit 15 12 Unimplemented read as 0 Bit 11 0 AL lt 11 0 gt Lower limit of analog threshold Note ATCONH ATCONL input range is 0 4095 with 0 corresponding to OV and 4095 corresponding to 5V 4095 is the maximum of a 12bits data Myostat ca page 42 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 8 Sensor Configuration Register Instruction SCFG SCFG x Configure the S12CON ATCONH and ATCONL Integer x 0 1 1048575 or hexadecimal x 0x00000 OxFFFFF ack fom OxO OxCO 0x0 Ox0 S2 S1 SO AL1 ALO AH1 AHO OxFF 0xCO is the Message
10. devices throughRS232 serial protocol The RS232 configuration of user device the hand shaking methods and the instruction used to change the baud rate will be introduced in this Chapter along with the method to reset the baud rate to factory default User Device RS232 Port Configuration To communicate with UIM241XX user device needs to have following RS232 port settings s 8 bits data 1 stop bit None Parity 3 2 Hand Shaking If user device knows the baud rate it can start sending instructions without hand shaking Hand shaking is more used as a method to check the existence and firmware version of the controller Under following two situations the UIM241XX will issue a greeting message 1 When UIM241XX is powered up 2 When UIM241XX receives following ASCII message ABC case sensitive and ended with a semicolon A message started with OxAA OxAB OxAC at the user device implies a successful hand shake A greeting Message from UIM241XX has the following structure Where OxAA OxAB OxAC denotes the greeting message 0x18 0x01 denotes the UIM241 controller Current denotes the maximum motor current the controller can provide Module denotes the optional control modules the controller installed Firmware Version denotes the firmware version Data is in 7 bits format Conversion from three T bits message data to a 16bits integer is illustrated in figure 2 1 Note For above Firmware Version Byte 8
11. former STP instruction is completed UIM241 will execute the current instruction and stop motor The former STP instruction is regarded as being completed Meanwhile system will shift from PT mode to VT mode If an STP instruction is received while the motor is already running the former steps will not be counted in the displacement of current STP instruction For a 1 8 stepper motor if STP 200 User sent STP 200 If MCS 1 motor rotation angle 1 8 200 360 If MCS 16 motor rotation angle 1 8 200 16 22 5 6 12 To check STP displacement Check current incremental displacement Feedback OxCC 0x00 OxB3 STP4 STP3 STP2 STP1 STPO OxFF OxCC denotes current status feedback OxB3 is the Message ID of current incremental displacement STP Comment STP4 STPO denotes the current incremental displacement See figure 2 2 for how to convert to a signed 32bit integer Displacement is essentially defined as counts from the pulse counter or encoder Therefore the actual angular displacement is relative to micro stepping resolution or encoder resolution M M C Inc Myostat ca page 25 UIM24102 04 08 6 13 Position Control Instruction POS Variable Comment Set desired position for open loop control Integer x 2 000 000 000 1 0 1 2 000 000 000 OxAA 0x00 OxB P4 P3 P2 P1 PO OxFF OxB7 is the Message ID of desired position POS P4 PO denotes the desired absolute position
12. installed per customer request Advanced Motion Control Module linear non linear acceleration deceleration S curve PT PVT displacement control Encoder based Closed loop Control Module and Sensor Input Control Module Embedded 64 bit calculating precision DSP controller guarantees the real time processing of the motion control and change notifications Entire control process is finished within 1 millisecond UIM241 s enclosure is made of die cast aluminum to provide a rugged durable protection and improves the heat dissipation Basic Control System UIM241XX controller s basic control system comprises communication system basic motion control system absolute position counter quadrature encoder interface and real time event based change notification system Communication System UIM241 controller communicates with user device using RS232 protocol User device controls the UIM241 controller through ASCII coded instructions Communication baud rate can be changed through instruction and will be burned into on board EEPROM Basic Motion Control UIM241XX controller has firmware and hardware supporting motor driving and motion control All basic motion parameters can be configured through instructions in real time such as speed position phase current micro stepping resolution and enable disable the H bridge etc Speed input range is 65 000 pulses sec Angular position displacement input range is 2 000 000 000 pulses Absolut
13. or pulse square second mDEC is the abbreviation of motion Deceleration Period Method pre requiring MCFG lt DM gt 1 mDEC x Function Set the deceleration rate to x in period mode integer x 1 2 60 000 OxAA 0x00 OxB2 DCF DC4 DC3 DC2 DC1 DCO OxFF OxB2 is the Message ID of mDEC DC4 DCO represents the value of the deceleration period See figure 2 2 for how to convert to an unsigned 32bit integer DCF the DM bit of the MCFG here always 1 DCF 1 means the input value will be interpreted as period of deceleration with the unit of milliseconds Comment Check the Current Deceleration Rate mDEC Function Check current deceleration rate OxAA 0x00 OxB2 DCF DC4 DC3 DC2 DC DCO OxFF See comments in above two modes Myostat ca page 36 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 7 11 Maximum Starting Speed Setup Instruction mMSS Set the Maximum Starting Speed Function Set the Maximum Starting Speed at x Variable Integer x 1 2 65 000 CK OxAA 0x00 0xB3 MS2 MS1 MSO OXxFF OxB3 is Message ID of mMSS MS2 MSO represents the value of Maximum Starting Speed See figure 2 1 for Comment how to convert to an unsigned 16bit integer mMSS is the abbreviation of motion Maximum Starting Speed Unit pps pulse second Check current Maximum Starting Speed Function Check the Maximum Starting Speed Variable N A XAA 0x00 OxB3 MS2 MS
14. the sensor module detects a voltage change on Sx from OV to 5V an Sx rising edge event will be created meanwhile Sx is assigned a logic value 1 i e Sx 1 If the sensor module detects a change on Sx from 5V to OV an Sx falling edge event will be created meanwhile Sx 0 Figure 8 1 Rising and Falling Edge of a Digital Sensor Input Voltage on port Sx Sx Logic Value Voltage on port Sx 8 2 Analog Input and Thresholds Figure 8 2 Analog Input and Thresholds Voltage on Sensor Port Here S1 is still 1 OV S1 Logic Value Here S1 is still 0 Falling S1 value Rising Edge Sensor input port S1 can be configured for analog input by instruction To do that user needs to first enable the analog input function by set the ANE bit of the master configuration register i e MCFG lt ANE gt 1 Then user needs to select the analog input port by clear the CHS bit of the master configuration register i e make MCFG lt CHS gt 70 Once configured the analog voltage on port S1 can be obtained by instruction sFBK In order to use the sensor events user may need to further setup the input upper and lower thresholds i e AH AL in figure 8 2 If the sensor module detects the analog input voltage is changing from lower than AH to high than AH an S1 rising edge event will be created meanwhile S1 is assigned a logic value 1 i e 1271 If the sensor module detects a change on S1 from higher than AL to lower than AL an S1 fall
15. the user device to UIM241XX to command certain operation Instructions of UIM241XX follow the rules listed below 1 Length of an instruction including the ending semicolon should be within 20 characters 2 Coded with standard 7 bits ASCII code 1 127 Expended ASCII code is NOT accepted 3 Instruction structure as follows Instruction Symbol Value or Instruction Symbol Where Instruction Symbol comprises letters with no space between them and is not case sensitive Value comprises set of numbers with no other characters between them Some instructions have no Value such as SPD STP etc Terminator is the semicolon Instruction without terminator will cause the UIM241XX to wait until 66 39 the presence of the In most situations that will cause unpredictable results 11 37 Note the equal symbol is optional User can use other characters except and Y 4 Only the first three letters of an instruction are used by the UIM241XX Therefore the following two instructions are the same ENABLE and ENA 2 2 Macro Operator and Null Instruction In practice users will combine several instructions together and send them at once For example CUR 20 MCS 16 DIR 1 SPD 5000 ENA Normally the user device will receive an ACK message on every instruction sent Thus the above instruction set will cause 5 ACK messages being transferred on the RS232 bus Especially for
16. 00 1100 1100 0011 binary OxOCCC3 hex 52419 decimal 11 Send instruction SCFG 0xCCC3 or SCFG 52419 12 Calculate the lower limit 0 6V 5V 4095 491 value is rounded 13 Add suffix code 0010 for ATCONL get 14 SCFG 0000 0001 1110 1011 0010 binary 0x01EB2 hex 7858 decimal 15 Send instruction SCFG 0x1EB2 or SCFG 7858 16 Set desired speed by sending instruction SPD 5000 17 Burn parameters into EEPROM by sending STORE 18 Initiate the motion by sending ENABLE 19 The system starts to work continuously 20 Disconnect the user device and restart the UIM241 controller the system will automatically run M M C Inc Myostat ca page 45 UIM24102 04 08 9 0 Encoder and Closed loop Control Quadrature Encoder also known as Incremental Encoder or Optical Encoder is used for tracking the angular position and velocity of rotary motion It can be applied for closed loop control of various motors A typical quadrature encoder consists of a slotted wheel for motor shaft and a transmitter detection module for detection of the slot on the wheel Usually there are 3 channels channels A B and Z INDEX Information from the three channels can be read and decoded to provide motion status of shaft including position and velocity The relationship between channel A QEA and channel B QEB is as simple as which phase leads When phase A leads B then the shaft is rotating in the clockwise direction
17. 1 60 seconds 4 mMSS This is the instruction to set the Maximum Starting Speed 5 mMDS This is the instruction to set the Maximum Cessation Speed Since the definitions of Maximum Starting Speed and Maximum Cessation Speed were already discussed in the previous sections here they are omitted The unit of Maximum Starting Speed and Maximum Cessation Speed is pps pulse per second 7 8 Enable disable Advanced Motion Control Module MCFG Advanced Motion Control Module can be enabled or disabled by setting the CM bit of MCFG MCFG lt 10 gt Setting the CM bit MCFG lt CM gt 1 will enable the module and clearing the CM bit MCFG lt CM gt 0 will disable the advanced motion control module For details of setting please refer to Section 5 1 Master Configuration Register Meanwhile the AM and DM bit of MCFG also defines the input methods of acceleration deceleration Myostat ca page 34 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 7 9 Acceleration Rate Setup Instruction mACC Value Mode pre requiring MCFG lt AM gt 0 MACC x Set the acceleration rate to x in value mode Integer x 1 2 65 000 000 OxAA Ox00 OxB1 ACF AC4 AC3 AC2 AC1 ACO OxFF 0xB1 is the Message ID of mACC AC4 ACO represents the value of the acceleration rate See figure 2 2 for how to convert to an unsigned 32bit integer Comment ACF the AM bit of the MCFG here always 0 ACF 0 means the input value w
18. 1 MSO OxFF See comments in above table 7 12 Maximum Cessation Speed Setup Instruction mMDS Set the Maximum Cessation Speed Set the Maximum Cessation Speed at x Integer x 1 2 65 000 OxAA 0x00 OxB3 MD2 MD MDO OxFF OxB4 is the Message ID for mMDS MD2 MDO represents the value of Maximum Cessation Speed See figure 2 1 C i for how to convert to an unsigned 16bit integer ommen mMDS is the abbreviation of motion Maximum Deceleration Speed mMCS is not used to avoid confusing with the micro stepping instruction MCS Unit pps pulse second Check current Maximum Cessation Speed Check the Maximum Cessation Speed OxAA 0x00 0xB3 MD2 MD1 MDO OxFF See comments in above table M M C Inc Myostat ca page 37 UIM24102 04 08 8 0 Sensor Input Control UIM241XX Motion Controller has an optional sold separately Sensor Control Module which supports two sensor input ports S1 and S2 Both sensor input ports accept digital TTL input from OV 5V Furthermore port S1 can be configured for either digital input or analog input Besides digital input condition circuit UIM241XX has a 12 bits ADC analog digital converter and a 5V reference voltage If the input voltage is 0 5V the feedback value will be 0 4095 The ADC sample rate is 50K Hz The analog feedback value is a mathematic average of 16 samples and the update rate is 1000 Hz Regardless of whether it s digital or analog the input voltag
19. 2 2 2 motor 88 8 8 8 8 S 8 S Pee Yr rx c Y Y Y wv 2000 ee s MEM mE 4600 Ps T Time DIDIT TONN GO ON On oo No Operation or Control Desired Current Position Error Desired Motor Motor Event Mode Position Position Speed Direction Speed 1 Power up VT 0 Stored Stored position 0 1 0 position 2 ENA VT 0 Stored Stored position 0 1 0 position 3 ORG VT 0 0 0 0 1 0 4 POS PT 2000 0 2000 0 1 0 5 SPD Pil 2000 0 2000 1000 1 1000 6 Position reached PT 2000 2000 0 1000 1 0 7 POS PT 2000 2000 4000 1000 0 1000 8 Position reached PI 2000 2000 0 1000 0 0 9 SPD PT 2000 2000 0 2000 0 0 10 POS PT 1000 2000 3000 2000 1 2000 11 Position reached RAT 1000 1000 0 1000 1 0 12 PT mode off VT 1000 1000 0 0 1 0 13 OFF VT 0 1000 1000 0 1 0 M M C Inc Myostat ca page 21 UIM24102 04 08 Position Velocity Tracking PVT Position Velocity Tracking PVT mode is an extended mode of Position Tracking PT mode In this mode user can enter both desired position and desired speed UIM241XX controller will instruct motor to run at the desired speed until it reaches the desired position and then stop User can enter successively or discontinuously both desired speed and desired position Shifting between the three modes is displayed in the following chart Figure 6 3 Shifting between Motion Control Modes H bridge disabled logic circuit working can accept buffer and operate instructio
20. Data Terminator Header denotes the start of a feedback message There are 3 kinds of headers 1 OxAA represents the ACK message which is a repeat of the received instruction 2 OxCC represents the status feedback which is a description of current working status 3 OXEE represents the error message Controller ID is the identification number of current controller in a controller network For UIM241XX Controller ID is always 0 Message ID denotes the property of the current message For example OxCC 0x00 OxAO OxFF where OxAO denotes that the current message means a falling edge happened at sensor S1 port Data has a 7bits data structure In figure 2 1and figure 2 2 examples are shown on how to convert a set of 7bits data into 16bits data and 32 bits data Obviously 16bits data takes three 7bits data and 32bits data needs five 7btis data to represent Terminator denotes the end of a feedback message UIM241XX controller utilizes OxFF as the terminator Note there are two types of feedback that has NO Message ID ACK message and Motor Status feedback controller s response to FBK instruction Other messages could have NO data such as some real time change notification messages Figure2 1 Conversion from three 7bits message to a 16bits data Message byte1 M M C Inc Myostat ca page 13 UIM24102 04 08 3 1 3 0 RS232 communication UIM241xx controllers communicate and exchange information with user
21. ID of SCFG 52 SO represent the value of S12CON AL1 ALO represent the value of the lower limit of analog input AH1 AHO represent the value of the upper limit of the analog input See figure 2 1 for how to convert above bytes to unsigned 16bit integers Comment S12CON ATCONH and ATCONL are 16bits registers in the controller But when configuring through SCFG user has to affix a 4bits suffix code to specify the desired register to be written The suffix code for S12CON is 0000 binary The suffix code for ATCONL is 0010 binary The suffix code for ATCONH is 0011 binary 8 8 Check the Value of S12CON ATCONH and ATCONL SCFG Check the current value of S12CON ATCONH and ATCONL ack oma Ox0 OxCO 0x0 0x0 S2 S1 SO AL1 ALO AH1 AHO OxFF See comments in above table 8 9 EEPROM Store Instruction STORE STORE instruction is used to burn the values of Sensor Control Configuration Analog Thresholds desired speed and desired displacement into the EEPROM so that the Sensor Input Module automatically participates in system control when user device is absent STORE instruction will affect the system s real time performance STORE Burn MCFG sensor CFG motion control parameters into EEPROM aan ba ver oe OxD1 is the Message ID of STORE STORE is used to burn MCFG sensor configuration speed displacement acceleration deceleration rate etc into EEPROM Comment STORE instruction will affect real time p
22. T Bit 15 12 S2RACT lt 3 0 gt S2 Rising edge Action S2RACT binary Action RTCN or Not 0000 N A No RTCN Ignore MCFG lt S2IE gt 0001 N A Depends on MCFG lt S2IE gt 0010 Start and Run Reversely Depends on MCFG lt S2IE gt 1010 Start and Run Forwardly Depends on MCFG lt S2IE gt 0011 Decelerate until Stop Depends on MCFG lt S2IE gt Reset position and encoder counter Depends on MCFG lt S2IE gt Decelerate until Stop 0100 Emergency Stop Depends on MCFG lt S2IE gt 1011 1100 Reset position and encoder counter Depends on MCFG lt S2IE gt Emergency Stop 0101 Reverse Displacement Control Depends on MCFG lt S2IE gt 1101 Forward Displacement Control Depends on MCFG lt S2IE gt 0110 Reset position and encoder counter Depends on MCFG lt S2IE gt Bit 11 8 S2FACT lt 3 0 gt S2 Falling edge Action S2FACT binary Action RTCN or Not 0000 N A No RTCN Ignore MCFG lt S2IE gt 0001 N A Depends on MCFG lt S2IE gt 0010 Start and Run Reversely Depends on MCFG lt S2IE gt 1010 Start and Run Forwardly Depends on MCFG lt S2IE gt 0011 Decelerate until Stop Depends on MCFG S2IE Reset position and encoder counter Depends on MCFG lt S2IE gt Decelerate until Stop 0100 Emergency Stop Depends on MCFG lt S2IE gt Reset position and encoder counter Depends on MCFG lt S2IE gt Emergency Stop 0101 Reverse Displacement Control Depends on MCFG lt S2IE gt 1011 1100 1101 Forward Displacement Control Depends on MCFG l
23. When phase B leads A then the shaft is rotating in the counter clockwise direction Channel Z is called index pulse which is generated per revolution as a reference for tracking of absolute position The quadrature signals from encoder can be decoded into four types of messages the order of which reverse when rotation direction is reversed The phase signals and index pulses are detected by encoder and further decoded to produce a count up pulse for one direction of shaft rotation or a countdown pulse for the other direction of shaft rotation UIM241 controller has a built in quadrature encoder hereinafter referred to as encoder interface circuit which is capable of decoding encoder signals of less than 200KHz input Another option is user can connect external encoder of their own choice to UIM241 controller using S1 and S2 ports for channel A and B In this case however INDEX decoding function is not available S1 S2 supports 0 5V TTL input The input range for S1 and S2 ports of UIM241 controller is 0 3V 5 3V Any input beyond this range can result in permanent damage Also for this case encoder power supply is to be provided by user For UIROBOT UIM241 controller with internal encoder the S1 and S2 ports are not occupied and therefore are available for sensors Whether the encoder is built in or external the controlling mode and the instructions are the same Instructions relative to encoder control function are listed below I
24. ave no power supply the power Comment qu TA Fe l consumption is cut to minimum the logic circuit is still working User needs to use the ENABLE instruction to turn the motor driver back to working Myostat ca page 22 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 6 4 Motor Current Adjusting Instruction CUR CUR x Set the output phase current to x Integer x 2 O 1 80 ACK Refer to the Basic Instruction ACK for details Integers O 80 represent O 8 0 amps Once received the current value will be stored in the controllers EEPROM If Comment the received current value is not one of the above integers an Error ACK will be sent to the user device through RS232 Incorrect instructions will be discarded without being executed 6 5 Automatic Current Reduction Instruction ACR ACR x Function Enable disable ACR automatic current reduction function Variable Integer x 0 1 Refer to the Basic Instruction ACK for details If ACR 1 the function is enabled vice versa When ACR is enabled the Comment current will be reduced after motor stops which means a decrease of holding torque Value of this instruction will be stored in EEPROM 6 6 Micro Stepping Setup Instruction MCS MCS x Function Set micro stepping resolution Variable Integer x 1 2 4 8 16 ACK Refer to the Basic Instruction ACK for details x 1 2 4 8 16 represents t
25. bsolute position of motor The actual angular displacement is also relative to micro stepping The value recorded in absolute position counter will be stored automatically on Power Failure situation and can only be cleared on user instruction or preset sensor event When DIR 1 the counter pulse increases and when DIR 0 the counter decreases Absolute position counter value can be read through POS instruction Displacement counter is mainly used for displacement control The former information is cleared when it receives a new displacement instruction It can also be used to record the displacement since last time it was Cleared Advanced Motion Control Instructions Once the advanced motion control module is enabled all basic control instructions are automatically turned into advanced control instructions This transition is transparent to the user Furthermore there are 5 additional instructions added as listed below 1 MCFG This is the instruction to enable or disable the advanced motion control module User can clear the CM bit of Master Configuration Register MCFG lt CM gt 0 to disable the module or set the CM bit MCFG lt CM gt 1 to enable the module 2 mACC This is the instruction set the acceleration rate There are two ways to set the acceleration rate a Value mode M M C Inc Myostat ca page 33 UIM24102 04 08 If the AM bit of the Master Configuration Register is clear to zero MCFG lt AM gt 0 then the val
26. ccsicccvntasscarsetiedacestetnssnseevdecbadsnanccnesacessnteeacseeetdeatstesaecssdbaaeenciees 28 7 0 Advanced Motion Control Lvnaspadsadsesdmeneldanendn nl 29 7 1 Linear Acceleration mee T TT 29 T2 Linear Dec vvs 29 oo Nonlinear ACCeleration cccccccccsscccececseeceueecececseeceueeceesaueceueceaeesaeeseuessueeseeeseeesaueesasesseesseeesaeeegas 30 7 4 Nonlinear Deceleration MR RII DR em 31 7 5 S curve Displacement Control m 32 7 6 Direction Control and Position GONE uret asia 33 1 1 Advanced Motion Control Instructions cccccceececececeeeeeseeeeceeeeseaceseaeesseeeeseeeeseueessaeessneeeseeenes 33 7 8 Enable disable Advanced Motion Control Module MCFG rrnrnrnrnnnrrrnnnnrrrnnnrenvnnnrrrrnnnernnnerennnnnnen 34 7 9 Acceleration Rate Setup Instruction MACC cccccssecccceseecceececceseecseeeeceeeseeseaesesseeeessegeesseaes 35 7 10 Deceleration Rate Setup Instruction MDEC ccceccccsssceeceeececceeececseeeeceeeseeseecessegeeessaeeesseaes 36 7 11 Maximum Starting Speed Setup Instruction MMSS J rrrronrrrrrnnrrrvnnnrrnrnnrrerrnnrenrnnrennnnrrnnnnsrennnnsre 37 7 12 Maximum Cessation Speed Setup Instruction MMDS rrrnrnenrnnrrnrnnnrrnnnnrrennnnrrnvnnnrennnnerenrnsrennnnn 37 8 0 Sensor Input Control EE EN 38 8 1 Rising and Falling Ede EE E NE NE 39 6 amp 2 Analog INputand Thresholds Ec 39 8 3 Sensor Event ree
27. cess automatically Figure 7 2 Linear Deceleration Control Speed l Current Speed Uniform Deceleration Desired Speed M M C Inc Myostat ca page 29 UIM24102 04 08 7 3 Nonlinear Acceleration To minimize the response time and to avoid resonance point user can use UIM241XX s non linear acceleration function Experiments show that through non linear acceleration UIM241XX can make NEMA17 23 4000RPM quad step in 0 25 seconds UIM241XX controller has the following non linear acceleration functions If the desired speed is higher than a certain value i e the Maximum Starting Speed defined by instruction and current motor speed is lower than the Max Starting Speed then the motor speed will first step up to the Max Starting Speed and then linearly accelerated according to the acceleration rate as shown in figure 7 3 Figure 7 3 Nonlinear Acceleration Control case 1 Uniform acceleration Desired Speed Step acceleration Maximum Starting Speed Current Speed If the desired speed is less than the Max Starting Speed then the motor speed will step up to the desired speed immediately as shown in figure 7 4 Figure 7 4 Nonlinear Acceleration Control case 2 Step Acceleration Maximum Starting Speed Desired Speed Current Speed If the current speed is higher than the Max Starting Speed the UIM241 will use the linear Acceleration Control Algorithm to control the speed Figure 7 5 Nonlinear Accele
28. convert them to a decimal based number If x using hexadecimal the number must start with Ox User Send MCFG 34611 or MCF G 0x8733 ACK Message OxAA 0x00 OxBO 0x02 OxOE 0x33 OxFF Interpretation Convert 0x2 OxE 0x33 into 16bits data we get 0x8733 That is 34611 decimal 5 3 Check Master Configuration Register MCFG Function Check the value of the Master Configuration Register OxAA 0x00 OxBO CFG2 CFG1 CFGO OxFF OxBO is the Message ID of MCFG Comment CFG2 CFGO denotes the master configuration register value See figure 2 1 for how to convert to a 16bit integer Myostat ca page 18 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 6 0 Basic Control Instructions UIM241XX controllers support the following basic control instructions Instruction Function Example T Set desired speed PPS pulse per second SPD SPD65000 SPD 65000 Check present speed Set desired incremental displacement 8 STP l STP 30000 Check present incremental displacement 9 FBK Inquiry present motor working status FBK 10 ORG Reset the position encoder counter ORG Set desired position 11 POS m POS 20000000 Check present position The above instructions are valid for both basic motion control without acceleration deceleration or S curve displacement control and advanced motion control if the module is installed and enabled User can select either basic or advanced motion control b
29. e Position Counter Quadrature Encoder Interface UIM241XX has a hardware pulse counter Output of the counter is signed The counter can be reset either by user instruction or by the configurable sensor input event Under most conditions through the advanced motion control this counter can provide the absolute position of the motor with enough accuracy UIM241XX controller has Quadrature Encoder Interface and can work with quadrature encoder when sensor input module is installed Furthermore with the encoder based closed loop control module the UIM241XX can perform self closed loop control Real time Change Notification RTCN Similar to CPU s interrupters UIM241XX can automatically generate certain messages after predefined events and sends them to the user device The time is less than 1 millisecond from the occurring of the event to the message being sent Message transfer time depends on the baud rate of the RS232 setup The transfer time will be less than 1 millisecond if the baud rate is set to 57600 UIM241XX s RTCN system supports 8 events displacement control done falling edge analog input beyond upper threshold analog input lower than lower threshold All RTCNs can be enabled or disabled by instructions Myostat ca page 10 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 1 2 Advanced Motion Control Module With advanced motion control module installed UIM241XX controller can maintain linear and non l
30. e cannot exceed 0 3V 5 3V otherwise permanent damage can be done Besides measuring the voltage input and providing the reads to the user device when inquired the sensor control module is able to carry out a certain control action when a sensor event happens Actions and sensor events can be defined by instructions With the Sensor Control Module UIM241 can perform motion controls without the user device There are 6 sensor events that can be configured for S1 and S2 as listed below Table 8 1 Sensor Events 4 S2 Rising Edge S2 Voltage Level Change Low gt gt gt High 9 Exceeding the Upper Limit S1 analog input voltage is higher than upper limit 6 Exceeding the Lower Limit S1 analog input voltage is lower than lower limit There are 9 actions that can be furthermore bound to sensor events 1 2 3 4 5 6 f 8 9 Start and Run Reversely DIR 0 at desired speed and acceleration rate Start and Run Forwardly DIR 1 at desired speed and acceleration rate Decelerate until Stop Reset position and encoder counter Decelerate until Stop Emergency Stop Reset position and encoder counter Emergency Stop Execute reverse DIR 0 displacement control Execute forward DIR 1 displacement control Reset position and encoder counter Myostat ca page 38 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 8 1 Rising and Falling Edge When port Sx x 1 2 is configured for digital input if
31. ed byte structure Low 7 e ee ee 0 N A 0 ENA OFF DR MCS 1 Q full step 15 1 16 step 3 CUR current phase current structure Phase Current e g 27 2 7 Amp 4 SPD2 SPDO denotes the current motor speed See figure 2 1 for how to convert to a signed 16bit integer Unit is pulse second PPS or Hz The sign of the value decides motor direction 5 STP4 STPO denotes the current motor displacement See figure 2 2 for how to convert to a signed 32bit integer Displacement is essentially defined as counts from the pulse counter or encoder Therefore the actual angular displacement is relative to micro stepping resolution or encoder resolution For more details on above conversion please refer to the source code of the provided demo software These software and related source code are VC VB based and free Myostat ca page 28 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 7 1 7 2 7 0 Advanced Motion Control UIM241XX has an optional Advanced Motion Control Module sold separately to perform linear non linear acceleration deceleration and S curve displacement and position control User can specify corresponding motion control parameters through instructions Instructions for the advanced motion control includes all the basic motion instructions and 5 additional instructions Once the advanced motion control module is enabled all basic control instructions are automatically
32. eeeeseeeeeeseeeeeeseeeeesaeeeeesaeeeeeas 23 6 6 Micro Stepping Setup Instruction MCS Lavere 23 6 7 Motion Direction Instruction DIR sacscscssencseticsesasesntesiedaeeensndeentattieneensaseasestedanseniadseadateceeeenetandantadesees 23 6 8 Absolute Position Counter Reset Instruction ORG sees 24 6 9 Speed Adjusting Instruction SPD ssccceowncsvsiseccdscpeusccsasctracsdiewaaersistnieedesencesentineisdaeeaesitenesieeneeeaieees 24 6 10 To Check Current Speed SPD cccccccccssceccesececceeececseseeeceuscecseuecessegeeessaseeeseueeessageeesscesessaneeees 24 6 11 Displacement Control Instruction STP un deessent ccs cacinueweceeacabeasaneiedens siacasenegeensctiednenensaceecadiels 25 6 12 To check STP Cis LEN vee aes oda See ce ates ee Sue ene teste ctecdeen 25 6 13 Absolute Position Inquiry Instruction POS ius iooaecesn dieat as Decus e niet aq ena c atn gae tan iae rae su xot ac insat e dxeus 26 6 14 To Check Current Absolute Position POS cccccccccssseecceeeseeseeeesseeeesaeeeeeseeeesseeseesaeeeesseeeeeeas 26 6 15 Basic Instruction Acknowledgment ACK ccccccseeceeseeeeeeeeeeeeeeeeeeeseeeeeseeeeeesaeeeeeseeeeesaeeeeesaeeeeeas 27 Myostat ca page 8 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 6 16 Motor Status Feedback Inquiry Instruction FBK cccceecccceeeeeeeeeeeeeeeeeeeeeeeeesseeeeeseeeesaaeeeesaeees 28 6 17 Motor Status Feedback Message isc
33. er guarantees the real time processing of the motion control and change notifications Entire control process is finished within 1 millisecond UIM241controllers can be mounted onto NEMA17 23 34 42 series stepper motor through adapting flanges Total thickness of the controller is less than 16 5 mm Enclosure is made of die cast aluminum to provide a rugged durable protection and improves the heat dissipation M M C Inc Myostat ca page 3 UIM24102 04 08 Terminal Description Figure 0 1 Terminal Description Motor Terminal Control Terminal i Control Terminals Terminal No Designator Description 1 V Supply voltage 12 40VDC GND Supply voltage ground NO RX To the RX pin on user device TX To the TX pin on user device GND To signal ground on user device AG Analog Ground for Sensor 1 Sensor 1 Input S S2 Sensor 2 Input RST Reset R232 baud rate to 9600 OIJ co Note 1 Please refer to Typical Application section for details 2 Internally linked to supply voltage ground Motor Terminals 1 A A Connect to the stepper motor phase A 2 3 4 B B Connect to the stepper motor phase B A WARNING Incorrect connection of phase winds will permanently damage the controller Resistance between leads of different phases is usually gt 100KX Resistance between leads of the same phase is usually lt 100K Myostat ca page 4 M M C Inc UIM241XX Miniature Integrated S
34. erformance It takes around 20 ms for the instruction to be executed It is recommended that sending this instruction when the motor is idle and wait 20ms before sending other instructions M M C Inc Myostat ca page 43 UIM24102 04 08 8 10 Sensor Data Inquiry Instruction SFBK Check sensor readings and status Variable Comment OxCC 0x0 OxC1 1 D2 AN1 ANO OxFF OxC1 is the Message ID of SFBK D1 and D2 represent the logic level of S1 and S2 respectively 0 1 AN1 ANO is the converted value for analog input 12 bits AN1 and ANO are 0 if no analog input port is configured See figure 2 1 for how to convert above bytes to an unsigned 16bit integer This instruction can be used for sensor data inquiry at any time and under any condition 8 11 Example of S12CON Configuration When configuring S12CON user needs to first fill every bit of the S12CON according to the information provided in previous sections and then affixes the suffix code 0000 binary Then user can use the instruction SCFG to realize the configuration An example is provided below Example 8 11 System Description A reciprocating mobile platform has one ON OFF stroke limit sensor at each end When the mobile table hit the sensor a OV presents Otherwise a 5V presents Requirements 1 As soon as one sensor S2 is hit the stepper motor starts to run reversely DIR 0 until the table hits the other sensor S1 2 As soo
35. hase Current e g 27 2 7 Amp SPD2 SPDO denotes the desired motor speed See figure 2 1 for how to convert to a signed 16bit integer Unit is pulse second PPS or Hz The sign of the value decides motor direction 5 STP4 STPO denotes the desired motor displacement See figure 2 2 for how to convert to a signed 32bit integer Displacement is essentially defined as counts from the pulse counter or encoder Therefore the actual angular displacement is relative to micro stepping resolution or encoder resolution M M C Inc Myostat ca page 27 UIM24102 04 08 6 16 Motor Status Feedback Inquiry Instruction FBK If user wants to check the current motor status following instruction should be used Please note that motor status and desired settings could be different E Check the current motor status Feedback See the p section FBK is the abbreviation for Feedback 6 17 Motor Status Feedback Message Upon receiving the FBK instruction the controller will send back the feedback message comprising the following up to date motor status incremental displacement speed direction micro stepping resolution and phase current enabled offline status and ACR status The feedback Message is 13 bytes long in the following format 1 2 3 4 5 7 10 11 value oxcc o asm cur SPD2 SPD sPDO sTP4 Where 1 OxCC denotes a Motor Status Feedback Message i e the present value of motor status 2 ASM assembl
36. he full half quarter eighth and sixteenth step resolution respectively Comment Once received the MCS value will be stored in the controllers EEPROM If the received current value is not one of the above integers an Error ACK will be sent to the user device through RS232 6 7 Motion Direction Instruction DIR DIR x obsoleted do not use Function Set the desired motor direction Variable Integer x 0 1 ACK Refer to the Basic Instruction ACK for details Motor direction is now determined by the sign of the speed Comment The actual motor direction also depends on the wiring between motor and controller M M C Inc Myostat ca page 23 UIM24102 04 08 6 8 Absolute Position Counter Reset Instruction ORG Function Reset the position encoder counter create an origin point Feedback OxCC 0x00 OxBO 0x00 0x00 0x00 0x00 0x00 OxFF OxCC indicates that a feedback message is received Comment l OxBO is the Message ID of ORG 6 9 Speed Adjusting Instruction SPD Function Set the desired speed to x Integerx 65535 1 0 1 65535 OxAA indicates confirm of instruction ACK OxB5 is the Message ID for desired speed SPD SPD2 SPDO denotes the desired motor speed See figure 2 1 for how to convert to a signed 16bit integer Unit is pulse second PPS or Hz The sign of Comment l M the value decides motor direction amp J If no or
37. ill be interpreted as the acceleration rate with the unit of pps s or pulse square second mACC is the abbreviation of motion Acceleration Period Mode pre requiring MCFG lt AM gt 1 mACC x Set the acceleration period to x in period mode Integer x 1 2 60 000 OxAA Ox00 OxB1 ACF AC4 AC3 AC2 AC1 ACO OxFF 0xB1 is the Message ID of mACC AC4 ACO represents the value of the acceleration period See figure 2 2 for how to convert to an unsigned 32bit integer ACF the AM bit of the MCFG here always 1 ACF 1 means the input value will be interpreted as period of acceleration with the unit of milliseconds Comment Check the Current Acceleration Rate mACC Check current acceleration rate Feedback OxAA 0x00 OxB1 ACF AC4 AC3 AC2 AC1 ACO OxFF See comments in above two modes M M C Inc Myostat ca page 35 UIM24102 04 08 7 10 Deceleration Rate Setup Instruction mDEC Value Mode pre requiring MCFG lt DM gt 0 mDEC x Function Set the deceleration rate to x in value mode Variable re mr x 1 2 65 000 000 Ack Jom 0x00 OxB2 DCF DC4 DC3 DC2 DC DCO OxFF OxB2 is the Message ID of mDEC DC4 DCO represents the value of the deceleration rate See figure 2 2 for how to convert to an unsigned 32bit integer Comment DCF the DM bit of the MCFG here always 0 DCF 0 means the input value will be interpreted as the deceleration rate with the unit of pps s
38. inear acceleration deceleration S curve displacement control PT PVT control auto direction control etc There are two ways to define acceleration deceleration rate 1 Value Mode Input range 1 65 000 000 PPS Sec pulse sec2 2 Period Mode Input range 1 60 000 milliseconds time to fulfill the acceleration or deceleration The input range of the displacement control is 2 billion pulses steps Advanced motion control module can be disabled enabled through user instruction 1 3 Sensor Input Control Module UIM241 s Sensor Input Module supports 2 channels of sensor input Input types are configured through instruction There is 1 channel can be configured as analog input The on board ADC has 12bit and 50K Hz sampling rate Analog input is averaged over 16 samples User can configure the desired automatic action triggered by sensor status change There are 9 actions listed below that can be triggered by 6 sensor events 1 Start and Run Reversely DIR 0 at desired speed and acceleration rate Start and Run Forwardly DIR 1 at desired speed and acceleration rate Decelerate until Stop Reset position and encoder counter Decelerate until Stop Emergency Stop Reset position and encoder counter Emergency Stop Execute reverse DIR 0 displacement control Execute forward DIR 1 displacement control Er MEG EE 0 m Reset position and encoder counter 1 4 Encoder based Closed loop Control Module With the enc
39. ing edge event will be created meanwhile S120 Otherwise S1 is kept unchanged 8 3 Sensor Event Action and Binding A sensor event is defined as the sensor voltage change matches a user defined condition Binding means assigning a sensor action to a sensor event UIM241XXs support 6 sensor events as listed in section 8 0 There are 9 actions that can be bound to those 6 sensor events The binding between M M C Inc Myostat ca page 39 UIM24102 04 08 events and actions are realized through the configuration of the Sensor Control Register S12CON These 9 actions are described below 1 Start and Run Reversely DIR 0 Run Backwards means starting and continuously running the motor backward using motion parameters i e SPD ACC DEC MSS MDS etc stored in the EEPROM Motion direction is defined by the S12CON Before making usage of this action user has to first configure the S12CON setup the desired speed SPD and if applicable the acceleration rate maximum starting speed etc After that user has to burn the SPD and S12CON into the EEPROM using the STORE instruction Start and Run Forwardly DIR 1 Same as above except that the direction is opposite forward instead of backward Decelerate until Stop Decelerating the motor speed until stop according to the motion parameters i e mDEC mMDS stored in the EEPROM To use this action the advanced motion control must be enabled Reset position and encoder counte
40. l Mode 0 Disable advanced motion control module use basic control mode 1 Enable advanced motion control module Bit 9 AM Acceleration Mode 0 Value mode Unit is pps sec or pulse square second 1 Period mode Unit is millisecond Bit 8 DM Deceleration Mode 0 Value mode Unit is pps sec or pulse square second 1 Period mode Unit is millisecond Bit 7 6 Unimplemented Read as 0 Bit 5 ORGIE Origin Zero Position RTCN 0 Disable the Origin zero position RTCN 1 Enable the Origin zero position RTCN Bit 4 STPIE Displacement Control STP POS QEC Completion RTCN 0 Disable the displacement control completion RTCN 1 Enable the displacement control completion RTCN Bit 3 2 Unimplemented Read as 0 M M C Inc Myostat ca page 17 UIM24102 04 08 Bit 1 S2IE S2 Status Change RTCN 0 Disable S2 status change RTCN 1 Enable S2 status change RTCN Bit 0 S1IE 1 Status Change RTCN 0 Disable S1 status change RTCN 1 Enable S1 status change RTCN 5 2 Master Configuration Register Instruction MCFG MCFG x Function Setup Master Configuration Register Integer x 0 1 65535 or Hexadecimal x 0x0000 OXFFFF ACK OxBO is the Message ID of MCFG CFG2 CFGO denotes the master configuration register value See figure 2 1 for how to convert to a 16bit integer Comment If x using decimal first fill each bit of the master configuration register with 0 or 1 and then
41. mperature 50 C 150 C Size and Weight Size 42 3mm x 42 3mm x 16 5mm Wight 0 1 kg M M C Inc Myostat ca page 7 UIM24102 04 08 CONTENTS Ge nerdl DES NNN usos xri essences aai naba 3 Terminal Description vr 4 1vpical FOO GAO oae E E 5 Instruction Set Summary re 6 VAC OTIS IC EEE EE ENE 7 1 0 OVervieWw me 10 1 1 PSN psice m o eee eee eee ee 10 1 2 Advanced Motion Control MOUle ccccccccsseeeceeececceseeeceeseecceeeesseueeeceessecseecesseeeeessgesessaeeeeses 11 1 3 Sensor Input Control Module rv 11 1 4 Encoder based Closed loop Control Module rrrrarrrrannrnnnnrrranrrrannrrannnnnnnennanenrannnnannennnnennanennassennn 11 1 5 Instructions and Interface sees nnne nnne sna n nnns nnns 11 2 0 Instruction and Feedback StructuUre r axxrvnrnrnnnnvnnnnnrnnnnnnnnnnnnnnnnnnennnnnnnnnennnnnennnnr 12 2 1 FT SE ve 12 2 2 Macro Operator and Null Instruction ERR 12 2 3 Feedback Message Structure aces drained oferta ttd acto Puce tied onn Duces is baden uia icc bh and upg e 13 3 0 R5232 communication are 14 3 1 User Device RS232 Port Configuration asado adt ne do Iota tatit ona Quat bus tadento Pula nent das superas Ext 14 32 Hand SVG EE EE I 14 3 3 Baud Rate Change Instruction BDR rrnernronnrrrnnrnnnnnrnnrnnnnnsnnrnnnnnsnnrnnnnnsnnnnnnsnsnnrnnnsnsrnnnnnsssensnnnn 15 3 4 Reset Baud Rate to Factory Default 9600 rrnrnnrrrnrnnn
42. n as S1 is hit the stepper motor starts to run positively DIR 1 until the table hits the S2 3 Keep the reciprocating motion without the user control device Realization 1 First stop the motor by sending OFF 2 Weare not interested in the rising edge so set S2RACT 3 0 0000 3 Itis required Start and Run Reversely on S2 failing edge so set S2FACT 3 0 0010 4 Same as 1 set STRACT 3 0 0000 5 Itis required Start and Run Forwardly on S1 failing edge so set S1IFACT lt 3 0 gt 1010 6 Fill the S12CON with above bits get S12CON 0000 0010 0000 1010 binary T Affix the suffix code 0000 to S12CON get SCFG 0000 0010 0000 1010 0000 binary 0x020A0 hex 8352 decimal 8 Send instruction SCFG 0x20A0 or SCFG 8352 Set up desired speed by sending instruction SPD 5000 10 Burn parameters into EEPROM by sending STORE 11 Press any one of the limit sensors the mobile platform will work 12 If user enables the RTCNs the user device will get feedback every time the S1 or S2 is hit 13 Disconnect the user device and restart the UIM241 controller the system will automatically run Myostat ca page 44 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 8 12 Example of ATCONH ATCONL Configuration Similar to S12CON configuration user needs to first fill every bit of the ATCONH ATCONL according to the information provided in previous sections and then affixes the suffix code 0011
43. nnnsnnnnnn 0 3V to 5 3V Maximum output current sunk by STELL Lanserer 20 mA Maximum output current sourced DY 81 92 ip ui mitate roe ab rh ias pda 20 mA Voltage on RX with respect to GND essesseseseseee nennen enne nnn nnns 25V to 25V Voltage on TX with respect to GND rrrrannnrnrrnnnnnvnrnnnnrnnnnnnnnrnnrnnnssnnnrnnnssnnnnnnsrrnsrnnnsnnnn 13 2V to 13 2V Ambient temperature under DIaS cccccccecccseeecceceeeeceeeeeeseeeeseeesseeeeseeessueeseueesseeesaeeeanees 20 C to 85 C SE NET 50 C to 150 C NOTE Working under environment exceeding the above maximum value could result in permanent damage to controller Working under conditions at the maximum value is not recommended as operation at maximum value for extended period may have negative effect on device reliability Electrical Characteristics Ambient Temperature 25 C Supply Power Voltage 12V 40VDC Motor Output Current Max 2A 4A 8A per phase instruction adjustable Driving Mode PWM constant current Stepping Resolution full step half step 1 4 1 8 and 1 16 step Communication Ambient Temperature 25 C Communication Protocol RS232 Wiring Method Three wire TX RX GND Baud Rate Max 57600 bps instruction adjustable hardware reset to 9600 Environment Requirements Working environment Avoid dust oil mist and corrosive gases Working temperature 40 C 85 C Humidity lt 80 RH no condensation no frosting Storage te
44. ns Instruction OFF l Instruction ENA ea st ection STP 0 1 Approach the desired speed j set the desired speed and then set the desired position PP paige or displacement successively or discontinuously Keep running at the desired speed approach the desired speed while making sure the Set the desired speed at 0 to desired position is achieved stop keep running at the desired speed stop after reaching the desired position Instruction STP x Instruction POS x SPD x POS x Instruction STP x NU SPD x STP x Instruction POS x InstructionQEC x Gr Sr SPD x QEC x Instruction QEC x set the desired speed and position or displacement successively or discontinuously approach the desired speed while making sure the desired position is achieved keep running at the desired speed stop after reaching the desired position 6 2 H Bridge Enable Instruction ENA ENA Function Enable the stepper motor driver i e H bridge driving circuit Refer to the following Basic Instruction ACK for details Only after the H bridge enabled can the controller drive the motor 6 3 H Bridge Disable Instruction OFF Function Disable the stepper motor driver i e H bridge driving circuit Refer to the Basic Instruction ACK for details OFF instruction turns off the dual H bridge motor driving circuit Once an OFF instruction is executed the motor will h
45. nstruction Function Example 1 MCFG Enable encoder function MCFG1792 2 QEC encoder based position control QEC 200000 3 STP encoder based displacement control STP500 4 QER Set encoder resolution QER 500 9 1 Enable Disable Encoder and Closed loop Control Module MCFG Enable Encoder Interface The Encoder Decoding Module is enabled disabled through configuring the QEI bit of MCFG MCFG lt 13 gt When MCFG lt QEI gt 0 the encoder decoding module is disabled when MCFG lt QEI gt 1 the encoder decoding module is enabled If external encoder is used S1 and S2 ports must be used for channel A and channel B respectively If user chooses UIROBOT internal encoder S1 and S2 ports are available for sensors Please note encoder interface is a standard module which is available as long as Sensor Input Module is installed Enable Closed loop Control Module The Encoder based Closed loop Control Module hereinafter referred to as Closed loop Control Module is enabled by configuring the QEM bit of MCFG MCFG lt 11 gt When MCFG lt QEM gt 0 this module is disabled when MCFG lt QEI gt 1 it is enabled Please note closed loop control module is a must even if user uses external encoders Otherwise UIM241 controller can only read the external encoder data but cannot maintain closed loop motion control with this data However if the internal encoder is installed Closed loop Control Module is automatically included For master c
46. nt ieisselneE mM 39 8 4 Introduction to Sensor Input Control Instructions cccccccceeccceeececeeeeceecesaeeeeeeeeeseeeeseeeessneessneeees 40 8 5 Sensor Input Control Register o 120 ON Lvsearrserasssassenme Seed 41 8 6 Analog Threshold Control Register ATCON amp ATCONL i uurnnnnnnnnnnnnvnnnrrnnnnnrenrnnnenrnnsrennnnerennnsnennnnnee 42 8 7 Sensor Configuration Register Instruction SCFG sees 43 8 8 Check the Value of S12CON ATCONH and ATCONL sese 43 8 9 EEPROM Store Instruction STEN NA 43 8 10 Sensor Data Inquiry Instruction SFBK cccccceccceeseeeeeseeeeeeeeeeeeseeeeeeseeeeeeeeeeesaaeeeesaeeesaeeeeesaenes 44 9 11 Examples of SIZCON Configuration i cocccssstcecacncecesanescassentcodessncsuanlaonaedesannicduhesdocenessceessaccaesesaseas 44 8 12 Configuring the AFO ONA STE ONLuuuusse essensen Ec doses tutius 45 9 0 Encoder and Closed loop Control cessere eere nnne nnne 46 9 1 Enable Disable Encoder and Closed loop Control Module MCFG rrrrrrrrnnrnrnrnnnrrvrnnnennnnrennnnnnen 46 9 2 Closed loop Position Control Instruction QEG rrrrrrnnnrrrrnnnrerrnnnrnvnnnrennnnnrenrnsnennnnrennnnrrnnnnsrennnnsne 47 9 3 Check Current Encoder POSIIOTIz uincere sence eee 47 9 4 Quadrature Encoder Resolution Setting Instruction QER ccccccscsssseeeeeeeeeseeeeeeeeeeeesssaeeeeeeees 48 9 5 Check Quadrature Encoder Resolution
47. ntrol Module is installed speed control can be achieved through linear or non linear acceleration deceleration For details please refer to Chapter 7 0 Advanced Motion Control Position Tracking PT In the Position Tracking PT mode UIM241 controller will keep motor running at a speed close to the set value until it reaches the desired steps After setting the desired speed user can enter desired positions or incremental displacement continuously or discontinuously UIM241 controller will make sure that the desired position is achieved when trying to approach the desired speed to the greatest extent As shown in Figure 6 2 UIM241 controller operates in PT mode automatically on receiving position instruction such as POS STP or QEC until an instruction of STP 0 is given STP is a displacement control instruction Logically STP 0 means no displacement It is contradictory to send a displacement instruction of no displacement Therefore UIM241 will take this instruction as a request to shift from PT mode to VT mode Myostat ca page 20 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller Figure 6 2 Position Tracking Mode without acceleration deceleration Position 2000 1000 E Eus ES 2 e O So a OE 6 3S G 6 8 o 8 o og 6 y S oO B O o N N N De ve ON x c c l A Q oO ais L0 vV na 9S Q o f o 5 c L Z On O A gt g H LL moro 2 o0 S 2 o Oo Q Q jo D Actual 22 2 2
48. oder based closed loop control module UIM241 controller can perform self closed loop motion control Without this module UIM241 can still interface with a quadrature encoder and provide reading to user device but the self closed loop is not available 1 5 Instructions and Interface Instructions for UIM241XX are simple intuitive and fault tolerating For example in order to achieve a speed of 1000 steps sec the following instructions are all valid SPD 1000 or SPD 1000 or SPD 1000 or SPD1000 or SPD amp 1000 In case the user enters a wrong instruction the controller will return an ACK of error message Incorrect instructions will not the executed to avoid accidents Myostat provides free Microsoft Windows XP based VB VC demo software and corresponding source code to facilitate the quick start of user device side programming M M C Inc Myostat ca page 11 UIM24102 04 08 2 1 2 0 Instruction and Feedback Structure Once UIM241XX receives a message instructions from the user device it will first ACK back repeat the received instruction and then execute the instruction If the real time change notification RTCN is enabled UIM241XX will further send back a message to inform the user device of the completion of the instruction Before a new instruction is received UIM241XX will keep current working status e g running stop etc Instruction Structure An instruction is a message sent from
49. on E i M All the acceleration deceleration methods may be applied in the S curve displacement control including linear acceleration deceleration and non linear acceleration deceleration which is not described in the above figures though Please note that for the non linear acceleration deceleration as there are knee points in its trajectory is not suitable for applications requiring motion smoothness In this case user can set the maximum start speed and maximum cessation speed at zero to disable non linear acceleration deceleration This process is shown is figure 7 11 Myostat ca page 32 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 7 6 1 7 Figure 7 11 S curve Displacement Control Uniform Acceleration Desired Speed Uniform Deceleration Max Start Max Cessation Speed Angular Displacement Stop Position Trajectory Start Position Direction Control and Position Counter When the user enables the advanced motion control module the actual motor direction is controlled by the module This is because if the user input commands a motion direction different from the current motion direction the desired direction cannot be executed immediately The motor must first be decelerated to zero speed before turned to the desired direction UIM241 has two types of position counters absolute position counter and displacement counter Absolute position counter is for recording the a
50. onfiguration register MCFG please refer to Section 5 1 Myostat ca page 46 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 9 2 Closed loop Position Control Instruction QEC QEC x Set desired encoder position to x for closed loop control Integer x 2 000 000 000 1 0 1 2 000 000 000 OxAA 0x00 OxB8 Q4 Q3 Q2 Q1 QO OxFF OxB8 is the Message ID of desired encoder position QEC Q4 QO represents the desired quadrature encoder position See figure 2 2 for how to convert to a signed 32bit integer Actual motor position is also relative to the encoder resolution The encoder counter records encoder pulses When the direction is positive DIR 1 the counter increases when the direction is negative DIR 0 the counter decreases Therefore the value of the counter is a signed 32bits integer with positive representing the final position is of the same direction of DIR 1 and vice versa Encoder counter can only be reset cleared under following situations Comment 1 Commanded by user instruction ORG 2 User preset sensor ORG event happens Please be aware 1 Power Failure Protection Should a Power Failure situation happen the value of the encoder counter will be pushed into EEPROM and restored when reboot next time However passive movement after power off cannot be recorded For every slot the encoder counter records 4 pulses For example when QEC 500 the encoder counter records
51. output phase current OxAA ACR X Enable disable automatic current reduction OxAA MCS X Set micro stepping resolution OxAA DIR X Set motor direction obsoleted OxAA N A SPD X Set the desired speed with direction OxAA OxB5 SPD Check current speed OxCC OxB2 STP X Set desired incremental displacement OxAA OxB6 SIF Check current incremental displacement OxCC OxB3 POS X Set desired position OxAA 0xB7 POS Check current position OxCC OxBO FBK Check current motor status OxCC MACC X Set acceleration rate OxAA OxB1 MACC Check acceleration rate OxAA OxB1 MDEC X Set deceleration rate OxAA 0xB2 MDEC Check deceleration rate OxAA 0xB2 MMSS X Set maximum starting speed OxAA OxB3 MMSS Check maximum starting speed OxAA OxB3 MMDS Check maximum cessation speed OxAA OxB3 SCFG X Set sensor control configuration register OxAA OxCO SCFG Check sensor control configuration register OxAA OxCO SFBK Check sensor status OxCC OxC 1 STORE Store motion control parameters OxAA OxD1 QER X Set quadrature encoder s resolution OxAA OxC2 QEC X Set desired quadrature encoder s position OxAA OxB8 QEC Check current quadrature encoder s position OxCC OxB1 Myostat ca page 6 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller Characteristics Absolute Maximum Ratings ST 9 oe 2 0 E ce ene ee eee eee eee 10V to 40V Voltage on S1 S2 with respect to GND raurrnnnnrnnrrnnnnrnnnnnnnernrrnnnnsnnnrnnnnrnnnnnnnsnnrnn
52. pping resolution Myostat ca page 26 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 6 15 Basic Instruction Acknowledgment ACK Upon receiving an instruction the UIM241XX controller will immediately send back an Acknowledgment ACK message For all basic instructions describe before except POS and ORG there are only two ACK messages for all of them as described below Error Message If the received instruction is incorrect UIM241 will issue an error message and the incorrect instruction will not be executed There are two kinds of errors Syntax error and value error i e variable is incorrect The structure of an error message is OxEE Error Code OxFF Where OxEE denotes an error message The error code is list below Basic ACK Message When a valid instruction is received the UIM241 will send back a basic ACK message The basic ACK message contains all desired settings Specifically following information is included in the ACK message STP SPD DIR MCS CUR ENABLE OFFLINE and ACR The basic ACK message is 13bytes long and has a structure as shown below value OxAA 0 ASM CUR SPD2 SPD1 SPDO STP4 STP3 STP2 STP1 STPO OxFF Where 1 OxAA denotes a basic ACK message 2 ASM Assembled byte structure o 7 e s 4 3 2 1 0 gt N A 0 ENA OFF DR MCS 1 0 full step 15 1 16 step 3 CUR desired phase current structure P
53. put of the sensor port The S1IE bit MCFG 0 and S2IE bit MCFG lt 1 gt enable disable the sensor real time change notification RTCN See section 5 1 for details SCFG Sensor Configuration Register SCFG is used to configure following sensor input control registers S12CON and Analog threshold control register ATCONH and ATCONL STORE Sensor Parameter Store into EEPROM STORE is used for storing parameters such as S12CON ATCONH ATCONL SPD and STP into EEPROM so that Sensor Input Control Module can perform the control when user device is absent sFBK Sensor Status Feedback At any time and under any scenario using the instruction SFBK can always read back the logic value of S1 and S2 as well as the analog measurement given MCFG lt ANE gt 1 MCFG lt CHS gt 20 Myostat ca page 40 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 8 5 Sensor Input Control Register S12CON S12CON Sensor 1 2 Control defines the binding relationship between S1 and S3 sensor events and actions as well as the activation of corresponding RTCNs It is a 16bits register inside the controller and can be configured using the instruction SCFG When writing to it user needs to affix a 4bits suffix code to point to this register For details of SCFG please refer to Section 8 7 The suffix code for S12CON is 0000 binary S12CON structure is as follows S12CON Structure ME ITEM EEE MEET S2RACT S2FACT S1RACT S1FAC
54. r Decelerate until Stop Absolute Position Counter will be reset when the sensor event happens and then deceleration process starts according to motion parameters or advanced motion parameter stored in EEPROM until stop Emergency Stop Set speed to zero immediately when the sensor event happens to force the motor stop Reset position and encoder counter Emergency Stop Absolute Position Counter will be reset when the sensor event happens and set speed to zero Reverse DIR 0 Displacement Control Control the motor to realize a backward displacement using motion parameters i e SPD STP ACC DEC MSS MDS etc stored in the EEPROM Before making usage of this action user has to first configure the S12CON setup the desired speed SPD the desired displacement STP and if applicable the acceleration rate maximum starting speed etc After that the user has to burn the parameters into the EEPROM using the STORE instruction Forward DIR 1 Displacement Control Same as above except that the displacement control is forward instead of backward Reset position and encoder counter This action resets the absolute position counter to zero and creates a zero position or origin 8 4 Introduction to Sensor Input Control Instructions There are only 4 instructions related to the sensor input control 1 MCFG The ANE bit MCFG lt 15 gt and CHS bit MCFG lt 14 gt of the master configuration register define the digital analog in
55. r use Linear Acceleration Deceleration Control Algorithm M M C Inc Myostat ca page 31 UIM24102 04 08 7 5 S curve Displacement Control S curve displacement control essentially is the displacement control under the linear acceleration and deceleration speed control The name is originated from the shape of the motion trajectory The original S curve displacement control is the acceleration coast deceleration speed control In the entire trajectory there is no knee point which makes the motion very smooth without impact or vibration The control process is shown in figure 7 9 Figure 7 9 S curve Relative Displacement Control case 1 Desired Speed Uniform Acceleration Jo Deceleration Angular Displacement Stop Position Start Position In the control process UIM241XX s advance motion control module will continuously calculate the deceleration happening point time and then perform the deceleration to guarantee that when desired displacement is reached the speed is right zero The entire calculation time is around 50 micro seconds with 64bit accuracy In practice when the desired displacement is small and the desired speed is high deceleration starts before the desired speed is achieved to ensure that the speed decelerate to right zero when desired displacement is completed The process is shown in figure 7 10 Figure 7 10 S curve Relative Displacement Control case 2 Desired Speed Uniform Accelerati
56. ration Control case 3 Uniform acceleration N Desired Speed Current Speed Maximum Starting Speed Myostat ca page 30 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 7 4 Nonlinear Deceleration Similar to the nonlinear acceleration control there are three cases and corresponding control algorithms as listed below If the desired speed is higher than a certain user preset value i e the Maximum Cessation Speed UIM241XX will use the Uniform Deceleration Control algorithm Figure 7 6 Nonlinear Deceleration Control case 1 Current Speed Uniform Deceleration Desired Speed If desired speed is lower than the Max Cessation Speed and current motor speed is higher than the Max Cessation Speed the Uniform Deceleration Control will be first applied and followed by a step deceleration to the desired speed Figure 7 7 Nonlinear Deceleration Control case 2 Current Speed Uniform deceleration d Step Deceleration Maximum Cessation Speed Desired Speed If the desired speed is lower than the Max Cessation Speed and current motor speed is lower than Max Cessation Speed then the speed will be adjusted to the desired speed through step deceleration Figure 7 8 Nonlinear Deceleration Control case 3 Step Deceleration Maximum Cessation Speed Current Speed Desired Speed Note Setting the Max Starting Speed or the Maximum Cessation Speed to 0 zero will force the controlle
57. rnrnnnnrnrnnnrvnrnnnrnnnnnnrnrnnnsrnrnnnsnnnnsnsnnnnnernsnnnsen 15 3 5 Check Controller Model MDL oscicccncsusccsctercrianccusseenttdancxscaassdasindendssianteiesdadecienasdandccs Maniesasanaieatioensed 15 4 0 Real time Change Notification axxrnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnennnnnnnnennnnnnnnnnnnennn 16 4 1 KONNE 4t 16 4 2 manieiB ape RETEN m n 16 5 0 Hardware Firmware Configuration e cesse eene eene nennen nnn nnn 17 5 1 Master Config ration Register Leese 17 5 2 Master Configuration Register Instruction MCFG rrrrrnnrrnnnnnrenrnnnrenrnnnrnrnnrenrnnrrrnrnsrennnnerennnnssen 18 5 9 Check Master Configuration Register 2 sees nnn nnns 18 6 0 Basic Control Instructions anxrnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnennnunnnnnnnnnnnnnnnnnennn 19 6 1 General Introduction of Motion Control Modes rrrrrnnnrnnnnnnrnrnnnrnvnnnnrnnnnnrennnnrnennnsnennnnsnennnnerenrnssennnnn 20 6 2 H bridge Enable Instruction ENA area 22 6 3 H Bridge Disable Instruction OFF ccccccssscecceeeeccesceeceescecceececsesseeseussesseeeesseeeesegeeesseneeessas 22 6 4 Motor Current Adjusting Instruction CUR cccccccccssseecesseecceeececeeeeeseuececseeeesseseesseeesesseneeeseas 23 6 5 Automatic Current Reduction Instruction ACR ccccceecceeseeeeeeeeeeeeee
58. struction to change the baud rate to desired value 3 5 Check Controller Model MDL MDL x Function Check the Model installed optional modules and firmware version Variable N A Feedback OxCC 0x00 OxDE 0x18 0x1 CUR ASM V2 V1 VO OxFF OxDE is the Message ID of instruction MDL CUR denotes the max phase current e g 20 means 2 0 A ASM denotes the installed optional modules It has the following structure bit 7 6 9 4 3 2 1 0 come jieseeeee teconesat ce esce l use ue Mp ee Meaning 0 Int QE Closed loop Adv Motion No of Sensor Ports For example if bit 4 is 1 the Advanced Motion Control module is installed V2 VO denote the firmware version Data is in 7 bits format Conversion from three 7bits message data to a 16bits data is illustrated in figure 2 1 M M C Inc Myostat ca page 15 UIM24102 04 08 4 1 4 2 4 0 Real time Change Notification UIM241XX controllers support Real time Change Notification RTCN Similar to interrupter of CPU a RTCN is generated and sent when a user predefined event happens The length of a RTCN is 4 bytes The time from the occurrence of the event to the sending of the RTCN is less than 0 5 milliseconds If using the 57600 baud rate the transfer time on the RS232 bus is around 0 8 milliseconds Therefore the time from the event happening till user device gets the information is less than 1 5 milliseconds RTCN Structure The struc
59. t S2IE gt 0110 Reset position and encoder counter Depends on MCFG lt S2IE gt Bit 7 4 S1RACT lt 3 0 gt S1 Rising edge Action S1RACT Cbinary Action RTCN or Not 0000 N A No RTCN Ignore MCFG lt S1IE gt 0001 N A Depends on MCFG lt S1IE gt 0010 Start and Run Reversely Depends on MCFG lt S1IE gt 1010 Start and Run Forwardly Depends on MCFG S1IE 0011 Decelerate until Stop Depends on MCFG lt S1IE gt Reset position and encoder counter Depends on MCFG S IE Decelerate until Stop 0100 Emergency Stop Depends on MCFG lt S1IE gt Reset position and encoder counter Depends on MCFG S1IE Emergency Stop 1011 1100 M M C Inc Myostat ca page 41 UIM24102 04 08 0101 Reverse Displacement Control Depends on MCFG lt S1IE gt 1101 Forward Displacement Control Depends on MCFG lt S1IE gt 0110 Reset position and encoder counter Depends on MCFG lt S1IE gt Bit 3 0 S1FACT lt 3 0 gt S1 Falling edge Action S1FACT binary Action RTCN or Not 0000 N A No RTCN Ignore MCFG lt S1IE gt 0001 Depends on MCFG lt S1IE gt Start and Run Reversely Depends on MCFG lt S1IE gt Start and Run Forwardly Depends on MCFG lt S1IE gt Decelerate until Stop Depends on MCFG lt S1IE gt Reset position and encoder counter Decelerate until Stop Emergency Stop Depends on MCFG lt S1IE gt Reset position and encoder counter Emergency Stop Depends on MCFG lt S1IE gt Depends on MCFG lt S1IE gt Reverse Displacement
60. tepper Motor Controller Typical Application UIM241xx controllers use 3 wire RS232 interface to communicate with user devices Terminal 3 should be connected to the RX of user device Terminal 4 should be connected to the TX of user device Terminal 5 should be connected to the GND of user device An example is provided in figure 0 2 If the sensor inputs are used make sure the signal are wired to the terminal 7 and or terminal 8 and the signal ground are wired to the terminal 6 Furthermore please be aware user is responsible for the power supply for sensors voltage on terminal 7 and 8 must be kept between 0 3V and 5 3V or smoke will be produced and 2 if using an external encoder channel A should be connected to S1 channel B to S2 GND to AG Figure 0 2 Typical Application Stepper motor zl 12 40VDC EN UIM241XX Controller nt Sensor 2 Terminal 9 is for resetting Baud Rate details in chapter 3 4 PIN2 to RX UIM terminal 3 PIN3 to TX UIM terminal 4 PINS to GND UIM terminal 5 M M C Inc Myostat ca page 5 UIM24102 04 08 Instruction Set Summary Instruction Description Feedback Header Message ID BDR X Set RS232 communication Baud Rate OxAA OxBD MDL Check controller model OxCC OxDE MCFG X Set master configuration register OxAA OxBO MCFG Check master configuration register OxBO ENA Enable H bridge circuit O TI an O gt gt Disable H bridge circuit CUR X Set
61. those basic motion instructions like SPD DIR MCS which have the same ACK sending a set of ACK is unnecessary To facilitate the above situation user can use the following method to send a set of instructions Instruction 1 Instruction 2 Instruction N Y N lt 10 For example CUR 20 MCS 16 DIR 1 SPD 5000 ENABLE UIM241XX will only send back 1 ACK on receiving the above message In the above example and Y is called Macro Operator Instructions between a pair of macro operators will get no ACK message The semicolon at the end of the instruction set has no letter or number before it That is called Null Instruction The only purpose of a Null Instruction is to tell the UIM241XX to feedback all the inquired parameters of the basic motion control i e Enable disable Current Micro stepping Auto current reduction Direction Speed and Displacement Actually user can simply send the null instruction alone to check the status of the above parameters If there is no null instruction after the Y in the above example there will be no ACK message at all Myostat ca page 12 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 2 3 Feedback Message Structure Feedback Message is the message sent to user device from UIM241XX controller The maximum length of feedback messages is 13 bytes Feedback messages from UIM241XX follow the structure below Header Controller ID Message ID
62. tion S curve PT PVT displacement control Motor Driving Characteristics Power failure position protection Wide supply voltage range 12 40VDC 2 sensor input ports 1 analog input 12Bits Output current 2 4 8A instruction adjustable 8 programmable real time event based change Full to 16th micro step resolution notifications Dual full H bridge with PWM constant current 9 programmable actions triggered by 6 sensor control events Accurate micro stepping and current control Simple instructions intuitive and fault tolerating RS232 Interface RS232 three wire serial communication Max baud rate 57600 bps General Description UIM24102 UIM24104 UIM24108 are miniature stepper motor controllers with RS232 interface User device can command these controllers through RS232 protocol using ASCII coded instructions Instructions are simple intuitive and fault tolerating User is not required to have advanced knowledge on stepper motor driving UIM241 s architecture includes communication system basic motion control system Quadrature encoder interface and real time event based change notification system Furthermore there are three optional modules can be installed per customer request Advanced Motion Control Module linear non linear acceleration deceleration S curve PT PVT displacement control Encoder based Closed loop Control Module and Sensor Input Control Module Embedded 64 bit calculating precision DSP controll
63. tructions This is realized through writing the corresponding configuration register s There are 4 configuration registers in UIM241XX Master Configuration Register Sensor Input Control Register and two Analog Threshold Registers In this chapter the Mater Configuration Register will be described The other three registers will be detailed in Chapter 8 0 Sensor Input Control 5 1 Master Configuration Register Master Configuration Register is used to enable disable the hardware firmware functions Once configured it will be effective immediately and its value will be burned into the on board EEPROM The burning process will not affect any real time process Master Configuration Register is a 16bits register with the following structure Bt t 4 t3 2 t 0 8 1 z e s 4 a 24 jo Bit 15 ANE Enable Disable Analog Input 0 Disable the analog input port S1 is digital 1 Enable the analog input Bit 14 CHS Analog Input Channel This bit is always O for UIM241 means only S1 can be configured as Analog Input Bit 13 QEI Enable Disable Quadrature Encoder Interface 0 Disable Quadrature Encoder Interface 1 Disable Quadrature Encoder Interface Bit 12 Unimplemented Read as 0 Bit 11 QEM Enable Disable Quadrature Encoder based Closed loop Control Module 0 Disable Quadrature Encoder based Closed loop Control Module 1 Enable Quadrature Encoder based Closed loop Control Module Bit 10 CM Advanced Motion Contro
64. ture of an RTCN message is shown below OxAA 0x00 Message ID OxFF The RTCN system is able to response to the following events Figure 3 1 Real time change notification events OxA2 xA3 1 3 falling edge of S2 Voltage on S2 High gt gt gt Low rising edge of S2 0 Voltage on S2 Low gt gt gt High A 5 beyond upper limit OxA1 Analog input user preset upper limit 6 below lower limit OxAO Analog input user preset lower limit T displacement control complete The desired position is reached OxA8 8 zero position OxA9 Position counter reaches passes zero Note When S1 is configured as analog OxA1 denotes event 5 otherwise OxA1 denotes event 2 When S1 is configured as analog OxAO denotes event 6 otherwise OxAO denotes event 3 Enable Disable RTCN Every RTCN can be enabled or disabled by user instruction Enable disable the RTCN is achieved by writing to the Master Configuration Register s ORGIE bit MCFG lt 5 gt STPIE bit MCFG lt 4 gt S2IE bit MCFG lt 1 gt and S1IE bit MCFG lt 0 gt Please refer to section 5 1 for details Please note to realize the sensor event control user needs to further configure the sensor control registers S12CON S34CON and ATCON Please refer to chapter 8 0 for details Myostat ca page 16 M M C Inc UIM241XX Miniature Integrated Stepper Motor Controller 5 0 Hardware Firmware Configuration UIM241XX s hardware and firmware can be configured by user ins
65. turned into advanced control instructions Instruction Function Example 1 MCFG Enable disable the advanced motion control module MCFG1792 2 MACC Set the acceleration rate MACC 200 3 MDEC Set the deceleration rate MDE500 4 MMSS Set the Maximum Starting Speed MMS1600 5 MMDS Set the Maximum Cessation Speed MMDS1000 It takes less than 1 millisecond for the specified parameter to take effect after the instruction is received Values of above instructions will be stored in the EEPROM Once the parameters are set the controller will perform the advanced motion control automatically At any time user can use instructions e g FBK POS SPD etc to get the current status of the motor In this chapter the Advanced Motion Control processes are first introduced followed by introduction to above 5 instructions Linear Acceleration Linear acceleration is defined as acceleration at constant rate The relationship between the speed and time is shown in figure 7 1 After the acceleration rate and desired speed is set UIM241 controller will perform the acceleration process automatically Figure 7 1 Linear Acceleration Control Acceleration Rate Desired Speed Current Speed Linear Deceleration Linear deceleration is defined as deceleration at constant rate The relationship between the speed and time is shown in figure 7 2 After the deceleration rate and desired speed is set UIM241 controller will perform the deceleration pro
66. ue of the instruction will be interpreted as the value of the acceleration rate The range of the input value is 1 65 000 000 and unit is pulse sec sec or pulse square second b Period mode If the AM bit of Master Configuration Register is set to one MCFG lt AM gt 1 then the value of the instruction will be interpreted as the period of the acceleration or in other words the time used for motor to accelerate to the desired speed from current speed The range of the input value is 1 60 000 milliseconds i e 0 001 60 seconds Figure 7 12 Two modes to Set the of Acceleration Rate 1 Acc Period 4 Desired Speed Max Start Speed 2 Acc Rate Slope Current Speed 3 mDEC Similar to mACC the deceleration also has two ways to set as listed below a Value mode If the DM bit of the Master Configuration Register is clear to zero MCFG lt DM gt 0 then the value of the instruction will be interpreted as the value of the deceleration rate The range of the input value is 1 65 000 000 and unit is pulse sec sec or pulse square second b Period mode If the DM bit of Master Configuration Register is set to one MCFG lt DM gt 1 then the value of the instruction will be interpreted as the period of the acceleration or in other words the time used for motor to decelerate to the desired speed from current speed The range of the input value is 1 60 000 milliseconds i e 0 00
67. y configuring the Master Configuration Registration MCFG In this Chapter introduction to UIM241XX motion control modes is first provided followed by detailed description of above instructions M M C Inc Myostat ca page 19 UIM24102 04 08 6 1 General Introduction of Motion Control Modes There are three motion control modes for UIM241XX controller Velocity Tracking VT Position Tracking PT and Position Velocity Tracking PVT Velocity Tracking VT In the Velocity Tracking VT mode UIM241XX controller controls the motor speed to track desired speed Figure 6 1 Velocity Tracking Instruction SPD 1000 received at this point Current Speed Advanced motion control linear non linear acceleration Basic motion control speed rises without cceleration process Instruction SPD 1000 received at this point Basic motion control speed falls without deceleration process Current Speed Advanced motion control linear non linear deceleration 1000 Please note that Sign of the value of SPD instruction instructs the motion direction For example both the instruction SPD 1000 and SPD 1000 make motor run forward at 1000pps Meanwhile the instruction SPD 1000 can cause motor to run backward at 1000pps The DIR instruction is obsoleted However if a DIR instruction occurs after an SPD instruction it will still affect motor direction If Advanced Motion Co
Download Pdf Manuals
Related Search
Related Contents
Ultimate Support Systems IQ-200 User's Manual Copyright © All rights reserved.
Failed to retrieve file