USB control using GCC C on windows

Hi all
I have a motor that i am trying to control using the TIC500 motor driver board.
I am simply looking for some simple control i…e to do the following:
Step the motor forwards continuously
Step the motor backwards continuously
VAry the speed of the motor
STop the motor.
I have looked at the various stuff in the manual but am still at a loss.
I have tried using ticcmd and it doesnt seem to allow me enough control.
Please does anyone have anything they have already written at all that i could use?


I moved your post to the “Motor controllers/drivers and motors” section of our forum since it seemed more appropriate.

Are you able to move the motor using the Tic Control Center software? Have you followed the appropriate subsection of the “Setting up the controller” section of the Tic user’s guide?

I expect ticcmd to be able to do all of the control scenarios you described; could you be more clear on what you have tried and what was not working as you expected?


I was trying some of the commands like
ticcmd --exit-safe-start etc.
I cant remember exactly.
Would you be able to let me know the commands I should use for the following using ticcmd and I will try them out:
motor Forwards continuous
motor reverse continuous
motor stop, for this I kept saying ticcmd --reset.
Change the speed
Many thanks

All of your described motions can be done using the “Set Target Velocity” command. The command should follow the structure shown in the “Command reference” section of the Tic user’s guide for using ticcmd: ticcmd --velocity NUM or ticcmd -y NUM (where NUM is in units of microsteps per 10,000 seconds).

For example, your commands would look something like this:

ticcmd --exit-safe-start 	#to clear the safe start error
ticcmd --velocity 2000000 	#move forward continuously at 200 steps per second (in full step mode)
ticcmd --velocity 0 		#stop the motor
ticcmd --velocity -2000000 	#move in reverse continuously at 200 steps per second (in full step mode)
ticcmd --velocity -1000000 	#slow the speed down to 100 steps per second (in full step mode)
ticcmd --velocity 0 		#stop the motor

By the way, if you are entering the commands manually through a Command Prompt window, you might want to disable the “command timeout” feature. By default, the Tic will trigger an error if it does not receive a command once per second. You can disable or change the timeout for this feature in the “Input and motor settings” tab of the Tic Control Center.


Many thanks for that.
I will try it out and come back to you if I have any more problems.

I tried out the commands and they seem to work, except the last one, when i send
ticcmd --velocity 0 the motor still continues to spin, why is this?

Setting the target velocity to 0 should cause the motor to come to a stop. Does it start to slow down or continue spinning at the same speed? If you have a deceleration limit set to something particularly low, it might take awhile to stop. Could you try sending ticcmd -s after you send ticcmd --velocity 0 and see what values it is reporting for “Target velocity” and “Current velocity”?


Another question I have is if I have disabled the timeout on the GUI. Does the motor board remember this setting even after the power has been disconnected and the USB disconnected as well???
With regards to the stopping of the motor, is there a way to get it to stop immediately??
such as ticcmd --reset or halt??

Basically, i am trying to control a peristaltic pump and need to make it go in either forwards or reverse at a set rate so we get a set flow rate.
How would i go about doing this, because at the moment it seems to do different things each time i try.

Yes, the “Command timeout” setting will persist (even through power-cycles). If yours is not, please make sure you are clicking the “Apply settings” button in the bottom right-hand corner of the Tic Control Center.

The “Halt and hold” command stops the motor abruptly without respecting the deceleration limit. Another solution might be to set the “Max deceleration” setting in the “Input and motor settings” tab of the Tic Control Center equal to the “Max speed” setting, if you never want to decelerate slowly. Note that you can do this independently of the “Max acceleration” value by unchecking the “Use max acceleration limit for deceleration” box, so you could still have the acceleration ramp up slowly if you want.

Can you be more descriptive about the problem you are seeing? For example, what are you trying and what is it doing in each case compared to what you expected it to do?