Chris Henschel
Published

The user-friendly Servo motor you always hoped existed

The HDrive is an easy to use IoT-enabled servo drive, both for the inexperienced and for professionals.

EasyShowcase (no instructions)2,221
The user-friendly Servo motor you always hoped existed

Things used in this project

Hardware components

TM4C Microcontroller
Texas Instruments TM4C Microcontroller
the heart of our drive
×1

Software apps and online services

Visual Studio 2015
Microsoft Visual Studio 2015
MATLAB
MATLAB
LabVIEW Home Bundle
Digilent LabVIEW Home Bundle

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Code

Matlab Example

MATLAB
Example shows how you can control one HDrive with Matlab Script
t=tcpip('192.168.1.102', 20000, 'NetworkRole', 'client') ; % configure TCP 
fopen(t); % open TCP Connection
fwrite(t, '<HDrive Position=\"200\" Torque=\"50\" Speed=\"10\" Mode=\"4\" />') % send XML drive order

C# Example

C#
Example shows how to control a motor with C#
TcpClient client = new TcpClient();
 
//create instance from TcpListener Object setup Object to listen on TCP Port 5002
TcpListener listener = new TcpListener(5002);
 
//start the server to listen for new clients
listener.Start();
 
//wait until a client has opened a connection
client = _listener.AcceptTcpClient();
 
//if a client has found, the program continues
Console.WriteLine("client found!" );
 
//create an instance of the C# Stream class and get the Stream to the client
Stream inOut = client.GetStream(); 
 
//Format the XML-Formatted Hdrive order into a byte stream and send it to the Stream
var enc = new ASCIIEncoding();
 
enc.GetBytes("<HDrive Position=\"1000\" Torque=\"50\" Speed=\"10\"  Mode=\"4\" />"); 
inOut.Write(enc, 0, enc.Count);

Credits

Chris Henschel

Chris Henschel

1 project • 4 followers
#HenschelRobotics Easy to use #IoT enabled #Servo Drives, Industrie 4.0, #Electronics, embedded systems, #C#, #Maker, 3D Printer, #Matlab, #HDrive

Comments

Add projectSign up / Login