UserCallBack Timing Constraints

Moderators: TomKerekes, dynomotion

Post Reply
griffinboyle
Posts: 17
Joined: Sun Apr 07, 2024 11:15 pm
Location: Boston

UserCallBack Timing Constraints

Post by griffinboyle » Tue Apr 28, 2026 12:34 pm

Hello,

What is the maximum amount of time I should be spending in the UserCallBack(), beyond which I might expect to see performance issues or unpredictable behavior? What are the recommended types of tasks to be performed in the UserCallBack() and what types of tasks should be avoided within the UserCallBack()?

Thanks in advance,
Griffin Boyle

User avatar
TomKerekes
Posts: 2923
Joined: Mon Dec 04, 2017 1:49 am

Re: UserCallBack Timing Constraints

Post by TomKerekes » Tue Apr 28, 2026 2:13 pm

Hi Griffin,

Only a few microseconds.

Every 90us a servo interrupt occurs which services all the Axis Channels and a number of other things. Depending on the number of axes enabled and their configurations the total time will vary with a worst case of around 50us. This leaves the remainder of at least 40us for the System or User Threads to execute as a Time Slice. The User Callback adds to the 90us interrupt time. A User Callback time of 40us would cause Time Slices of 0 time and/or missing interrupts so nothing anywhere near 40us should ever be taken.

You might read this.


There is an example C Program called MeasureIRQ.c which measures the length of its Time Slice and computes the time the interrupt is taking in your configuration.


HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply