Code covered by the BSD License  

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Servo motors controller

4.75
4.8 | 4 ratings Rate this file 16 Downloads (last 30 days) File Size: 9.88 KB File ID: #29895 Version: 1.0
image thumbnail

Servo motors controller

by

Andrea Cirillo (view profile)

 

A GUI to control six servo motors.

| Watch this File

File Information
Description

It's a servo controller for six servo motors. It can be used to control a antropomorphic arm with six motors. For a correct execution, it must select the motors following this table:
 #servo - char to use for the motor selection
   1 a
   2 b
   3 c
   4 d
   5 e
   6 f
The microcontroller must use the same char. It uses a serial communication via RS232 protocol.

Required Products Instrument Control Toolbox
MATLAB release MATLAB 7.11 (R2010b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (12)
23 Apr 2016 Ricardo Ogasawara

Hi! The problem is, how to move the servo according to the byte sent? I mean, how to setup the PWM vs MCU clock and make a source code in order to obtain a servo movement same as the slide bar value (1 degree precision). Anyone could help me please?

Comment only
21 Apr 2016 pooja sheth

nice work

13 Oct 2015 Hindash Asad

Hi Andrea,
Thank you for the great effort. I tried your matlab code and the simple fix for the Arduino from last comments and still having problems.
Your Additional support would be most appreciated. Keeping in mind I'm using the Arduino UNO board / USB serial port. Could that be the problem? Do you have code for the USB port? Thank you

22 Mar 2015 Andrea Cirillo

Andrea Cirillo (view profile)

Hi Harris,
I think that a simple Arduino solution like the following one should be work fine! Let me know if you need for further help.

int incomingByte = 0; // for incoming serial data
char selectedMotor;

void setup() {
Serial.begin(115200);
}

void loop() {
if (Serial.available() > 0) {
// read the incoming byte:
selectedMotor = Serial.read();
incomingByte = Serial.read();

if (selectedMotor == 'a') {
// active first motor
}
else if (selectedMotor == 'b') {
// active second motor
}
/* And so on... */
}
}

Comment only
16 Mar 2015 Harris Ko

The gui is similar to what i would like to use. The problem i have is what code to write for the arduino. Could you please post a sample of code for the arduino?( i am new to arduino and matlab interaction)

Comment only
13 Nov 2014 Carlos Moran

gracias por esta ayuda es de mucha utilidad

10 Jan 2013 animati

Thanks, for this good serial port code.

Comment only
01 Sep 2011 Andrea Cirillo

Andrea Cirillo (view profile)

Yes. It is a very simple algorithm.

Comment only
01 Sep 2011 Paulo

Paulo (view profile)

is it like this:

PIC microcontroller:
if motorSelection == a
then activate motor1
else if motorSelection == b
then activate motor2
.............................................................................
else if motorSelection == f
then activate motor6?

thanks!

Comment only
31 Aug 2011 Andrea Cirillo

Andrea Cirillo (view profile)

The software needs a simple circuit microcontroller based.

Comment only
31 Aug 2011 Paulo

Paulo (view profile)

how will this work? SERVO to PC? no need for microcontroller?

09 Feb 2011 Bhuvan

Bhuvan (view profile)

cheers

Comment only

Contact us