Tic T500 interrupt pulse on change


I am planning to use the Tic T500 to drive stepper motors in a balancing robot.

So at 40 Hz the microcontroller measures the angle and sets the wheel speed appropriately. However now I am using a software pulse generator in its own thread but image that it has to run at at 1 pulse per second but after 1/40 second it tels the pulse generator to start pulsing at 10 pulses per second it will not yet respond because it is still waiting 1 second before it will respond again. (using raspberry pi).

Will using the Tic T500 prevent this problem? So if i tell it to pulse once every 10 seconds and then after 1 second tell it to pulse once every second will this work?

Also, what does it do first, pulse or wait? Since I update the pulse speed 40x per second and it would pulse before it waits, it means it will never pulse slower than 40x a second.

(If i should not approach a balancing robot with stepper motors like this at all, please let me know).

Thanks for the help!


The time it takes for a Tic stepper motor controller to respond to a movement command will typically be around 5 ms to 15 ms, even if its current speed is very slow.

The Tic does not have the same problem that your software pulse generator has because it keeps track of how much time has passed since the last pulse, compares that to the current speed (which you can update quickly), and uses that to decide whether it is time to send another pulse. For example, a speed of 40 steps per second corresponds to 25 ms between steps, so when the Tic is deciding what to do, it will take another step if there have been at least 25 ms since the previous step. That is the basic idea that the Tic uses to plan steps, although the actual algorithm is more complicated in order to support pulse rates up to 50 kHz and to make sure that the time between pulses for any given speed is accurate and constant.

The Tic does not schedule any long, uninterruptible delays. Sending speed commands rapidly is fine, since the commands will basically just update the “Target velocity” variable and they do not reset any kind of internal timer.

I think that answers all of your questions, but please let me know if something was unclear or you have more questions.

By the way, since you are making a balancing robot with a Raspberry Pi, you might be interested in our Balboa robot.