---
title: "Step 3 - Defining cycle events"
canonical: "https://help.vicon.com/space/ProCalc16/12649031/Step%203%20-%20Defining%20cycle%20events"
format: markdown
---
The next step is to automatically define events based on kinematic data from the feet only. To help to define these events we will define a few handy variables that will help us along.

First, you must find events that can uniquely identify each cycle – not the foot strike and foot off events we aim to calculate, but an event that we can use to determine that a foot strike or foot off will definitely happen between these other events. For this event, we will use a foot transitioning from being behind to being in front of the other foot, which we can call "mid swing". This is a suitable event to use because this transition event happens as the foot swings forwards at considerable speed, and is therefore highly likely to be well defined and under normal circumstances, will happen only once for each gait cycle.


    **To define cycle events:**


1. On the **Variables** tab, add a new variable and call it **FootDiff**.
2. Choose the **Vector** group and the **From point A to point B** function.
3. As point A, choose **RHEE_Lower**, and as point B choose **LHEE_Lower**.
4. From the **XYZ** drop-down menu, choose the **Y** component for both these variables. This means that only the Y component of the points used will be considered for the vector, and the vector will point forwards when the right foot is behind the left, and backwards when the left foot is behind the right.
5. Save the Variables scheme.
6. Click on the **Events** tab.
7. Create a new scheme by pressing the Create button > Macro (inline-media-image)

, entering a suitable name and then pressing Enter.
8. Click the Add button > Macro (inline-media-image)

 to add an event.
9. For the **Event Type**, choose **Left Custom Event** and type the name **LeftMidSwing**.
10. In the **Event triggered by** drop-downs, choose **Vector**, **FootDiff** and **Y**.  
The ProCalc default settings are exactly what we need for the next step: we want to define our LeftMidSwing event when the FootDiff Y component crosses from being negative to positive, in other words the **Threshold crossing** is the absolute value 0 and the **Direction** is Up, so leave these settings at their default values.
11. We could optionally define a minimum amount of time that the value has to be above zero – this could be useful if there was a bit of noise around the threshold. In this case, this is very unlikely as the forward motion of the foot is quite fast, but we could still select the **Minimum** check box and specify, for example 100ms.
12. For now you can leave the **Extra Conditions**: we will return to them later.  
Extra information is now displayed on the time bar:   
> Macro (inline-media-image)
13. Make sure you click > Macro (inline-media-image)

 and then > Macro (inline-media-image)

  to define the **RightMidSwing**. Note that you also have to change the direction of the threshold crossing from **Up** to **Down**.   
You can now look at all the calculated times in the log to see if the values appear to be correct.