I have a problem with my understanding of how to control a motor driver from a Raspberry Pi. Ideally I’d like to use Windows IoT as that is the base of my experience. But I could also use a different framework if necessary. My questions are:
- Using the Dir and Step pins, is all I need to do is pulse the Step pin (High-Low) to get the motor to perform one step? Or do I need to simulate a PWM signal on the pins?
- Is this the best interface to use from a Pi? Or, should I use a serial interface if available?
I have a Tic T825 board and can control my motor from the Windows App just fine. But if I pulse the pins, I don’t get any motor movement.
I also will have some A4988 controllers and have basically the same question.
Any pointers to samples, or libraries for the motor drivers would be greatly appreciated.
To use the STEP/DIR pin control, you need to configure the Tic first. There are directions in the Setting up STEP/DIR control section of the Tic user’s guide. There is a minimum timing the pulses need to be high and low for, but otherwise, there is no need to change the width of the pulses. This interface is the same as our A4988 driver boards use.
The motion control features of the Tic like acceleration and positioning are bypassed if using the STEP and DIR pins directly. If you have a specific reason for controlling the driver directly, you might use those pins, but generally, the serial interface provides access to more of the features of the Tic.
Awesome, thanks very much this really helps. I believe I saw the serial API in the user doc, but are there some simple sample programs out there? Or, has anyone created a C# (or CPP) library for a Tic controller?
Thanks again for your help, really appreciate it.
We do not have a serial API in the user’s guide (or anywhere else we are aware of), but we do provide a list of all of the serial commands (in the Command Reference section), the general protocol for using them (in the Serial command encoding section), and some example code (in the Example serial code for Windows in C section) there.
By the way, if USB connections are an option for you, we provide a C library called libpololu-tic in our Tic software package. It has a C++ wrapper. We also provide a command-line utility named ticcmd that uses the library. If you run Linux on your Raspberry Pi, you could use libpololu-tic or ticcmd. However, we are not sure what it would take to get the software working on Windows IoT. We discuss the software in the Writing PC software to control the Tic section of the user’s guide.