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 features a product may offer, without an intuitive and user-friendly software, implementing those features can become quite challenging. Oriental Motor simplifies this process for its customers by providing a universal MEXE02 support software that works seamlessly across multiple product series. Since each product has its unique set of functionalities, the software adapts its format accordingly. Having a consistent user interface across different products significantly reduces 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 involves repeating the same movement in the exact distance and direction every time. In programming terminology, this is often referred to as a loop subroutine, meaning that any set of instructions within the loop will be executed either indefinitely or until a specific condition is met. Once the loop finishes, it returns to the main program.

The following excerpt is from the AZ series functions manual.

The loop function is a feature that repeats the operation of the linked operation data number for the number of times specified.

Operations are repeated from the operation data number where "Loop count" is set to the operation data number marked as "Loop end number" for the number of times specified in the "Loop count." When the operation for the specified number of times is complete, the operation transitions to the operation data number set to "Next data number."

In essence, the loop function repeats the same move a specified number of times. This is particularly useful for applications that require the same fixed distance every time, such as paper/ticket feeding or rotary index tables.

Application Example:

Imagine a scenario where a robot performs a dance routine every time someone walks by. You can use an AZ motor for the arm rotation joints, link three different moves together (No.0, No.1, No.2) sequentially, loop them for a certain number of times, then move onto the next data set (No.3), and finally hold that pose at the end. Here’s what we want to achieve:

  • Perform No.0 motion
  • Perform No.1 motion
  • Perform No.2 motion
  • Loop No.0, No.1, No.2 motion 3 times
  • Perform No.3 motion

AZ series stepper motor motion sequence - loop function

This is how we program it...

Take a look at 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 necessary for this motion sequence. A key advantage of the MEXE02 software is that once a move is programmed and stored, there's no need to program it again. The secret lies in the second image, where it shows "Next data No.", "Loop count", and "Loop end No." This tells the software how to execute data sets #0, #1, and #2.

MEXE02 software usage example - AZ series automatic sequential

And voilà! You’re done (don’t forget to save). Here's what the motion looks like when we plot a chart.

Motor operation  - AZ series loop function

The Case for More Driver Intelligence

Traditional stepper motor drivers are not particularly intelligent beyond providing power and logic. Essentially, they just convert incoming pulse commands into motor motion. The real intelligence lies in the host controller, such as a PLC, where ladder logic and pulse outputs can be used to perform complex motions.

Using a driver from the AZ series brings advanced motion sequence programming capabilities, allowing the AZ series driver to operate independently of a PLC in certain scenarios. Various types of drivers are available for different purposes, including pulse input, stored data, and multi-axis. Up to 256 "moves" can be programmed and stored in the driver's non-volatile memory. More "moves" can be achieved by utilizing fieldbus communication protocols like Modbus RTU, EtherNet/IP, or EtherCAT.

Advantages of Stored Data Programming

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

Eliminating the PLC saves space and simplifies the design. At the very least, the AZ series drivers should lighten the load on the host controller, meaning a less expensive PLC or HMI can be used. Since the AZ series motors come equipped with 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 watching videos? Here’s one that demonstrates this concept.

 

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, 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!

 

"

Webbing Sling & Round Sling

Winnerlifting are manufactured Webbing Slings and Round Slings.Webbing Slings in accordance with DIN-EN 1492-1 standard. Round Sling manufactured in accordance with DIN-EN 1492-2standard. And the essential requirements of the European Machinery Directive.Color coded and striped for WLL(Working Load Limit) identification. Every single webbing sling and round sling is labeled and certificated in accordance with the relevant Standard together with information about safety use and maintenance.





Webbing Sling & Round Sling,Webbing Sling,Lifting Slings,Endless Round Sling

WINNERLIFTING SAFETY EQUIPMENT CO., LTD. , https://www.winnerstrap.com