Lost: Control a 18V15 via USB under windows

Hi,

I feel a bit lost after having looked through the SDK to find the tools needed for my scenario in the pile of files and folders.

Hopefully there is a kind soul here having a minute to kick a newbie in the right direction…:

I need to control a 18V15 Simple DC brushed motor controller from a windows computer. I plan to create my own application to control full forward, stop and full backward (optionally with softstart and brake, if possible).

Which dll(s) do I need for this? I have found compiled usbwrapper.dll and smc.dll libraries. Do I need both of these? Where do I find which library calls I need to make in order to initialize the controller and do a full forward, stop, full backward and finally a stop command?

Does it exist a precompiled application from which I can test control my motors connected to 18V15 boards?

Is the controller part of the 18V15 powered by the USB connection? Are there any issues by removing the controller power when the motor supply is connected and vice versa?

Thanks a LOT if I can have some comments on this. I’m really excited in getting started playing with motors like this.

best regards Tor

Hello, Tor.

You asked about a precompiled program for testing the motors and the controllers: that is what the Simple Motor Control Center is for. You can find instructions for downloading it and using it in the Simple Motor Controller User’s Guide. I recommend that you do that testing before attempting to write your own software.

For information about powering, please see the “Connecting Power and a Motor” section of the Simple Motor Controller User’s Guide. Yes, you can disconnect USB and/or the motor power. Power from USB is only used when VIN is not connected.

To get starting writing your own program, I recommend that you read the README.txt file that comes with Pololu USB SDK. It contains a lot of good information. However, the information in there about how to download a free C# / Visual Basic / Visual C++ environment is a little outdated; you should get Visual Studio Express 2012 for Windows Desktop. The SDK contains simple example programs in C#, Visual Basic, and Visual C++. They are named SmcExample1, SmcExample1Cpp, and SmcExample1Vb. Before you try to make your own thing, I strongly recommend compiling one of those examples and making sure that it works for you. Each of those examples creates a simple window on the screen with three buttons: Reverse, Stop, and Forward. If that’s what you want, then maybe you do not need to write any code.

You will need Smc.dll and Usbwrapper.dll. You can inspect the configuration of the example projects for more details.

You can find the library calls you need by looking at the source code of the example programs mentioned above and also by looking at the source code of the Smc class in Smc.cs. Also, Visual Studio has a very handy auto-complete feature that will help you find all the methods in the Smc class as you type a call to them.

By the way, you can control the Simple Motor Controller from many different programming languages. You can control it using the native USB interface or the USB virtual COM port. The path I am leading you down in this post is the path that leads to a .NET-based program running in Windows that uses the native USB interface.

–David