首页 > > > AN4241 dSPIN family fully integrated stepper mo…

AN4241 dSPIN family fully integrated stepper motor drivers.pdf

AN4241 dSPIN family fully integ…

上传者: mzh6000 2014-03-28 评分1 评论0 下载0 收藏10 阅读量350 暂无简介 简介 举报

简介:本文档为《AN4241 dSPIN family fully integrated stepper motor driverspdf》,可适用于电子通讯领域,主题内容包含JanuaryDocIDRevANApplicationnotedSPINfamily:fullyintegratedsteppermotordri符等。

January 2013 Doc ID 024193 Rev 1 1/18 AN4241 Application note dSPIN family: fully integrated stepper motor drivers By Enrico Poli Introduction The L6470 and L6472 are fully integrated motor drivers providing a complete stand-alone solution for the high-end stepper motor applications. The devices can be controlled by a host microcontroller through a fast SPI interface and are able to execute a complete set of motion commands. This document describes how the devices can be configured and gives some suggestions about the operation and the application design. The current control algorithm of the devices (the L6470 voltage mode driving and the L6472 advanced current control) is not investigated in this document. For further details, please, refer to the respective application notes AN4144 "Voltage mode control operation and parameter optimization" and AN4158 "Peak current control with automatic decay adjustment and predictive current control: basics and setup". www.st.com Contents AN4241 2/18 Doc ID 024193 Rev 1 Contents 1 The L6470 and L6472 communication interface . . . . . . . . . . . . . . . . . . . 3 1.1 Communication protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2 Daisy chain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.3 5 V and 3.3 V communication interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2 Motion engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.1 Speed tracking commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.2 Positioning commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2.1 Change the target position of the on-the-fly command . . . . . . . . . . . . . . 9 2.3 Stop commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.4 Initializing position using GoUntil and ReleaseSW commands . . . . . . . . 10 3 Protections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.1 Overtemperature protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.2 Overcurrent protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.3 Undervoltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4 Stall detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 5 Main clock source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 6 Layout suggestions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 7 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 AN4241 The L6470 and L6472 communication interface Doc ID 024193 Rev 1 3/18 1 The L6470 and L6472 communication interface The device (always slave) can be driven by a MCU (always master) sending commands through an 8-bit SPI interface. The 8-bit shift register of the device is kept enabled while CS input is forced low. During this time, at every raising edge of the serial clock (CK), the SDI input is stored into the shift register. At CK falling edges the SDO output is updated according to the last bit of the shift register. When the CS input is raised, the device catches the shift register content and interprets its value as a command or an argument of the previously received command. All the bytes are sent through the SPI data lines starting from the most significant bit. 1.1 Communication protocol The communication protocol is based on single byte commands that can be followed by a command argument up to 3 byte long which must be transmitted starting from the most significant byte. Part of the information needed to execute the target operation could be embedded into the command byte, for example the target register address in the GetParam and SetParam commands, and the argument provides extra data as well as the target position of the GoTo command. By default the response byte of the device is h00 (hexadecimal format). Some commands, for example those used to read the value of a register, generate a response from the device up to 3 byte long which is transmitted during the following transmission cycles starting from the most significant byte. 1.2 Daisy chain The device is compatible with the daisy chain architecture allowing the MCU to drive multiple devices with a single SPI interface. The daisy chain architecture is obtained as follows: Master serial clock line is connected to the CK input of each slave device; Master slave select line is connected to the CS input of each slave device; Master serial data output (MOSI) is connected to the SDI input of the first slave of the chain; The SDO output of each slave device is connected to the SDI input of the next one, last slave excluded; Master serial data input (MISO) is connected to the SDO output of the last slave of the chain, The connection diagram of the configuration is shown in Figure 1. The L6470 and L6472 communication interface AN4241 4/18 Doc ID 024193 Rev 1 Figure 1. Daisy chain connection diagram In this configuration, the chain of slaves acts as a single slave with an SPI device of N byte. Each communication cycle, for example when the master needs to transmit/receive a byte from/to a slave, the master must fill all the shift registers of the slaves before raising the CS line. The devices are addressed according to the position of the byte in the communication cycle: the first byte transmitted by the master is received by the last device of the chain; the second one is received by the last-but-one slave and so on down to the last transmitted byte which is received by the first slave of the chain. The response bytes from the device chain are addressed to the same way: the first byte received by the master has been transmitted by the last device of the chain; the second one has been transmitted by the last-but-one slave and so on down to the last received byte which has been transmitted by the first slave of the chain. In theory, the number of slaves that an MCU can drive using the daisy chain configuration is unlimited; in practice the maximum number of devices connected to the same SPI depends on the clock skew. The number of slaves limits the communication speed also because every time a byte has to be transmitted to a device, the whole N slave chain has to be filled transmitting N - 1 extra bytes. 1.3 5 V and 3.3 V communication interface The device can be configured to operate both with 3.3 V and 5 V standard logic as shown in Figure 2. MCU Serial clock Slave select Serial data out Serial data in Device 1 (1st of the chain) to SDI of device 2 to SDI of device X+2from SDO of device X -1 from SDO of device N -1 Device X Device X+1 Device N (last of the chain) CS CK SDI SDO CS CK SDI SDO CS CK SDI SDO CS CK SDI SDO AM16587v1 AN4241 The L6470 and L6472 communication interface Doc ID 024193 Rev 1 5/18 Figure 2. Logic interface supply scenarios CDDPOLCDDCREGPOL CREG 10 µF100 nF100 nF47 µF VREG VDD CDDPOLCDDCREG 10 µF100 nF100 nF VREG VDD CDDPOLCDDCREGPOL CREG 10 µF100 nF100 nF47 µF VREG VDD 3.3 V 3.3 V 5 V CDDPOLCDDCREG 10 µF100 nF100 nF VREG VDD 5 V Fully self supplied device Compliant with 3.3 V logic Self supplied device Compliant with 5 V logic Externally supplied device Compliant with 3.3 V logic Externally supplied device Compliant with 5 V logic AM16588v1 Motion engine AN4241 6/18 Doc ID 024193 Rev 1 2 Motion engine The dSPIN family devices integrate a motion engine providing a full set of commands. The motion engine generates the step sequence according to the programmed speed profile and the requested command. The speed profile represents the operation boundaries, defined by the acceleration, deceleration, maximum and minimum speed, which should be respected to ensure the proper functioning of the application. The devices allow all the parameters to be set independently: Acceleration and deceleration values range from 14.55 up to 59590 steps/s2. The device can also be set to use an infinite acceleration and deceleration value; in this case, both the acceleration and deceleration phases are totally skipped. Maximum speed value ranges from 15.25 steps/s up to 15610 step/s. Minimum speed value ranges from 0 up to 976 steps/s. The acceleration, deceleration and minimum speed parameters can be modified when the motor is stopped only. The maximum speed can be also changed when the motor is running, but the new value is only considered at next command execution. The commands supported by the motion engine are listed in Table 1. Table 1. Command list Name Length (bytes) Description Notes Move 4 (including 3 of arguments) Performing the target number of microsteps as per requested direction. Can be executed when the motor is stopped only. GoTo 4 (including 3 of arguments) Reaching the absolute target position (ABS_POS register) using the shortest path. Not accepted while another command is under execution. GoTo_DIR 4 (including 3 of arguments) Reaching the absolute target position (ABS_POS register) running as per requested direction. Not accepted while another command is under execution. GoHome 1 Reaching the home position (all zeroes) using the shortest path. Not accepted while another command is under execution. GoMark 1 Reaching the position stored into the MARK register using the shortest path. Not accepted while another command is under execution. Run 4 (including 3 of arguments) Reaching the target speed in the requested direction. Always accepted and immediately executed (if present, the previous command is aborted) StepClock 1 Switching the device in step-clock mode imposing the direction. Can be executed when the motor is stopped only. AN4241 Motion engine Doc ID 024193 Rev 1 7/18 2.1 Speed tracking commands During the speed tracking, the device dynamically changes the motor speed according to the application requirements. The Run command can be used to achieve this result. The Run command sets the speed target and direction which the motor has to reach. Both speed target and direction can be changed in real time through a new Run command (see Figure 3). GoUntil 4 (including 3 of arguments) Reaching the speed target in the requested direction and stopping when SW input is forced low (falling edge). Always accepted and immediately executed (if present, the previous command is aborted) ReleaseSW 1 Runnig the motor at low speed in the requested direction and stopping when SW input is forced high (rising edge). Always accepted and immediately executed (if present, the previous command is aborted) SoftStop 1 Stopping the motor in accordance to the programmed speed profile. Always accepted and immediately executed (if present, the previous command is aborted) HardStop 1 Stopping the motor immediately (infinite deceleration). Always accepted and immediately executed (if present, the previous command is aborted) SoftHiZ 1 Stopping the motor in accordance to the programmed speed profile and then disabling the power bridges. Always accepted and immediately executed (if present, the previous command is aborted) HardHiz 1 Disabling the power bridges immediately. Always accepted and immediately executed (if present, the previous command is aborted) Table 1. Command list (continued) Name Length (bytes) Description Notes Motion engine AN4241 8/18 Doc ID 024193 Rev 1 Figure 3. Speed tracking using Run command sequences 2.2 Positioning commands The motion engine, integrated into the devices, allows the position of the motor in a target position based on integrated ABS_POS register. The ABS_POS register traces all the motion performed by the motor adding a unit to each microstep completed in forward direction and subtracting a unit when the microstep is performed in reverse direction. The target positioning can be directly imposed indicating the ABS_POS register value (absolute position) or the distance between the current position and the target one (relative position). The relative positioning command is Move. The motion engine executes this command only when the motor is stopped in order to avoid unexpected behaviors (e.g. the target of number of steps is not enough to allow the speed profile compliance). Figure 4. Relative positioning command example Speed 100 100 200 200 300 300 400 400 500 TimeRun(forward, 100) Run(forward, 600) Run(forward, 400) Run(reverse, 300) AM16589v1 0 h200000 h3FFFFF h1FFFFF h000001 0 h200000 h3FFFFF h1FFFFF h000001 Starting position Starting position Final position Move(Reverse) Move(Forward) Final position AM16590v1 AN4241 Motion engine Doc ID 024193 Rev 1 9/18 The absolute positioning commands are GoTo and GoTo_DIR. The former moves the motor to the position target choosing the rotation direction according to a minimum path algorithm (i.e. the lower number of microsteps is executed) whereas the latter imposes the direction directly. Figure 5. Absolute positioning command example If a GoTo command is requested when the motor is running, the minimum path algorithm also considers the steps required to reverse the direction (see Figure 6). Figure 6. Minimum path algorithm when motor is running The GoTo and GoTo_DIR can only be executed when no other commands are under execution. 2.2.1 Change the target position of the on-the-fly command If a Run command is sent to the device during the execution of a GoTo command, it aborts the previous command. This effect can be used to change the target position of the motion engine on-the-fly. 0 h200000 h3FFFFF h1FFFFF h000001 0 h200000 h3FFFFF h1FFFFF h000001 Starting position Starting position Target position Target position GoTo GoTo_DIR(Forward) AM16591v1 0 h200000 > then forward direction is used. h3FFFFF h1FFFFF h000001 Current position Zero speed position(where the motor will stop if it starts decelerating) Target position Motor is running in forward direction Forward direction path Forward direction path Reverse direction path Reverse direction path AM16592v1 Motion engine AN4241 10/18 Doc ID 024193 Rev 1 Following the suggested sequence of operations: 1. Read the current motor speed (SPEED register) and direction (DIR bit in the STATUS register). 2. Send a Run command setting the target speed and direction equal to the values obtained at point 1. 3. Wait for the execution command monitoring the BUSY pin or the BUSY flag in the STATUS register. 4. Send the new positioning command. This operation could introduce a small error in the generation of the speed profile. If the target position is changed a high number of times (tracking position) the error increases and anomalous behaviors could occur. 2.3 Stop commands The motor can be stopped through the stop commands. These commands can be sent at any time and they are executed immediately. The SoftStop command stops the motor fitting the deceleration value of the speed profile whereas HardStop command stops the motor immediately (infinite deceleration). The SoftHiZ and HardHiZ commands operate similarly, but the power bridges are disabled as soon as the zero speed is reached (the high impedance status is forced). 2.4 Initializing position using GoUntil and ReleaseSW commands The GoUntil and ReleaseSW commands can be used to initialize the absolute position information stored into the ABS_POS register according to an external position sensor. In this way a relation between ABS_POS value and mechanical position of the motor can be established. The position initialization sequence, as shown in Figure 7, is the following: 1. In power-up status, the load position is unknown. 2. Using GoUntil command the load is moved to the limit switch at high speed. 3. When the load reaches the limit switch the SW input of the device is forced low. The motor decelerates and then stops. 4. Considering the high speed used to approach the load to the limit switch, a significant error in the positioning could happen. 5. Using ReleaseSW command the load is moved away from the limit switch at low speed. 6. As soon as the threshold position of the limit switch is crossed by the load the SW input of the device is forced high. The motor stops immediately. 7. The load is positioned in correspondence to the threshold position of the limit switch with a high precision. AN4241 Motion engine Doc ID 024193 Rev 1 11/18 Figure 7. Initialization position using GoUntil and ReleaseSW commands Load in unknown position Position sensor (limit switch) Stepper motor dSPIN family motor driver GoUntil command is executed and the load reaches the limit switch SW SW ReleaseSW command is executed and the load is positioned exactly on the triggering point of the limit switch SW AM16593v1 Protections AN4241 12/18 Doc ID 024193 Rev 1 3 Protections The dSPIN family devices provide a complete set of protections designed to prevent from damaging the device in critical conditions. The implemented protections are: Overtemperature (see Section 3.1) Overcurrent (see Section 3.2) Undervoltage (see Section 3.3) 3.1 Overtemperature protection The overtemperature protection disables the power stage of the device when the temperature of the chip exceeds the safe operation conditions. When the overtemperature protection is triggered the device is locked in a safe condition (all MOSFETs are turned off) and is kept in this condition until the junction temperature decreases below 130 C (typical). The thermal shutdown event occurrence is signaled through the respective flag (TH_SD) in the STATUS register which is kept low until it is released by a GetStatus command (more details are available in the datasheet of the device). A warning threshold is also present allowing the host to control the device to prevent the shutdown. 3.2 Overcurrent protection The overcurrent protection monitors the current in all power MOSFETs of the device and disables the power stage when the programmed current threshold is reached. No information about the specific MOSFET or bridge causing the failure is available. As soon as the overcurrent protection is triggered, the device is locked in a safe condition (all MOSFETs are turned off) and is kept in this condition until the OCD failure flag is released by a GetStatus command. When the device is locked in safe state no command enabling the bridges can be executed (e.g. Move, Run, GoTo, HardStop, etc.). The commands are simply ignored, no non- performable signalling is returned by the device. Warning: The overcurrent protection can be disabled setting the OC_SD pin of the CONFIG register to zero. However it is not recommended this protection to be disabled. 3.3 Undervoltage The undervoltage protection avoids the power stage of the device to operate with a supply voltage below the safe conditions. AN4241 Protections Doc ID 024193 Rev 1 13/18 At power-up, the device is in undervoltage status: the power bridges of the device are kept disabled until the supply voltage is below the turn-on threshold. In this condition all the commands enabling the bridges (e.g. Move, Run, GoTo, HardStop, etc.) are ignored and the UVLO failure flag is forced low. When the turn-on threshold is reached the power bridges are operative. The UVLO flag is kept low until it is released through a GetStatus command. The device returns in undervoltage status if the supply voltage falls below the turn-off threshold. Figure 8. Undervoltage pro

该用户的其他资料

  • 名称/格式
  • 评分
  • 下载次数
  • 资料大小
  • 上传时间

用户评论

0/200
    暂无评论
上传我的资料

相关资料

资料评价:

/ 18
所需积分:0 立即下载
返回
顶部
举报
资料
关闭

温馨提示

感谢您对爱问共享资料的支持,精彩活动将尽快为您呈现,敬请期待!