Motion Programming Example: Loop Function For Repeated Motion

window.__hsEnvConfig = {"portalID":2284573,"hublet":"na1","hsEnv":"prod","hsDeployed":true,"hsJSRGates":["CMS:JSRenderer:SeparateIslandRenderOption","CMS:JSRenderer:GraphQLQueryBuild","CMS:JSRenderer:MinifyCSS","CMS:JSRenderer:GetServerSideProps","CMS:JSRenderer:LocalProxySchemaVersion1","CMS:JSRenderer:SharedDeps"]}; window.__hsServerPageUrl = "https:\u002F\u002Fblog.orientalmotor.com\u002Fmexe02-programming-basics-loop-function-for-repeated-motion"; window.__hsBasePath = "\u002Fmexe02-programming-basics-loop-function-for-repeated-motion";

No matter how many functions a product offers, without an intuitive, easy-to-use software, those functions can be difficult to implement.

Oriental Motor simplifies things for their customers by providing a universal MEXE02 support software that works with products from multiple series. Since each product has different functionalities, the software adjusts its format accordingly. Having the same software interface for different products helps reduce the time needed to program motion sequences for each axis.

The loop function is available when any AZ series product is used with the MEXE02 software.

For an introduction to the software, check out this blog post or click on the image below.

MEXE02 support software hbspt.cta._relativeUrls=true;hbspt.cta.load(2284573, 'e351278a-3f10-4402-bda5-5b8829eac7d0', {"useNewLoader":"true","region":"na1"});

The Loop Function

One of the most common motion sequences for stepper motors is performing the exact same movement repeatedly in a fixed distance and direction. This is often referred to as a loop subroutine in programming terminology, meaning that any set of instructions within the loop subroutine will be repeated either endlessly or until a specific condition is met. After completing the loop, the program transitions back to the main program.

The following excerpt is from the AZ series functions manual.

The loop function is a function to repeat the operation of the linked operation data number for the number of times set.

Operation is repeated from the operation data number for which "Loop count" is set to the operation data number to which "Loop end number" is set for the number of times set in the "Loop count." When the operation for the number of times set is completed, the operation transits to the operation data number that is set to "Next data number".

In essence, a loop function repeats the same move a specified number of times. This is particularly useful for applications that require consistent distances, such as ticket dispensers or rotary indexing tables.

Application Example:

Consider a robotic arm that needs to perform a dance routine every time someone walks by. Each move of the arm corresponds to a specific data set (No.0, No.1, No.2). To achieve this, you can use an AZ motor for the arm's joint rotations, link three moves together sequentially, loop them for a certain number of times, then transition to the next data set (No.3) before ending the motion sequence. Don't forget to hold the final pose!

This is what we want to do...

  • Execute No.0 motion
  • Execute No.1 motion
  • Execute No.2 motion
  • Loop No.0, No.1, No.2 motions 3 times
  • Execute No.3 motion

AZ series stepper motor motion sequence - loop function

This is how we program it...

Check out the usage example below to see how this motion sequence is programmed on the MEXE02 software. Notice that only three data sets (#0, #1, #2) are needed for this sequence. A key advantage of the MEXE02 software is that once a move is programmed and stored, it doesn't need to be reprogrammed. The trick lies in the second image showing "Next data No.", "Loop count", and "Loop end No." These parameters instruct the software on how to execute data sets #0, #1, and #2.

MEXE02 software usage example - AZ series automatic sequential

And voila! You're done (don't forget to save). Here's what the motion looks like when plotted on a chart.

Motor operation  - AZ series loop function

The Case for More Driver Intelligence

Traditional stepper motor drivers aren't very intelligent beyond providing power and logic. They essentially convert incoming pulse commands into motion on the motor. The intelligence usually resides on the host controller, like a PLC, where ladder logic and pulse output can be used to perform complex motion.

The advantage of using an AZ series driver is its advanced motion sequence programming, allowing the AZ series driver to operate without a PLC in some cases. Various types of drivers are available for different purposes, such as pulse input, stored data, and multi-axis. Up to 256 "moves" can be programmed and stored in the driver's non-volatile memory. Additional moves can be achieved through fieldbus communication, such as Modbus RTU, EtherNet/IP, or EtherCAT.

Advantages of Stored Data Programming

  • Saves space
  • Simplifies design
  • Reduces the burden on the host controller

By eliminating the PLC, more space is saved, and the design becomes simpler. At the very least, the AZ series drivers lighten the load on the host controller, meaning a less expensive PLC or HMI can be used. Since the AZ series motors have built-in mechanical absolute encoders, external encoders, batteries, and sensors are unnecessary.

Here's another application example with a linear slide.

Motion control challenge: repeated feeding

Motion control solution: loop function

 

Prefer to watch and learn? Here's a video to show you how to do this.

 

Watch More Videos hbspt.cta._relativeUrls=true;hbspt.cta.load(2284573, '3257c162-1fd0-4923-a205-57699545d6e5', {"useNewLoader":"true","region":"na1"});

For more information about the AZ series family of motors, actuators, and drivers, please click below. The same dedicated drivers and the same MEXE02 software are used with all of these products.

AlphaStep Family of motion control products hbspt.cta._relativeUrls=true;hbspt.cta.load(2284573, 'c9cd6ed1-0aa4-4485-aba4-c8a4b3128d90', {"useNewLoader":"true","region":"na1"});

Please subscribe!

 

"

Conical Twin Screw and Barrel

Conical Twin Screw And Barrel,Plastic Sheet Machine Screw And Barrel,Extruder Screw And Barrel,Plastic Sheet Machine

Zhejiang Guangming Plastics Machinery Co.,Ltd. , https://www.gmscrews.com