Hey everyone, I’m new to the SSC-32 but I’ve spent some time perusing this forum and haven’t found much information on using MATLAB to control the SSC-32.
I have the Lynx tester program setup to control a small 3-servo “leg” and all servos are functioning properly. However, when I attempt to send a simple serial command via MATLAB, the servos don’t move. I see the light flash on the board so the signal is being received, yet no movement occurs.
I have a feeling it has to do with my serial setup in MATLAB, but I’m not quite sure what’s wrong. I set the serial, baud, stopbits, etc. just how they’re setup in the tester program, but there is more info in MATLAB and I’m not exactly sure if something is messing things up. If someone would mind taking a look at my port setup to see if they have any suggestions I would really appreciate it!
get(s)
ByteOrder = littleEndian
BytesAvailable = 3
BytesAvailableFcn =
BytesAvailableFcnCount = 48
BytesAvailableFcnMode = terminator
BytesToOutput = 0
ErrorFcn =
InputBufferSize = 512
Name = Serial-COM1
ObjectVisibility = on
OutputBufferSize = 512
OutputEmptyFcn =
RecordDetail = compact
RecordMode = overwrite
RecordName = record.txt
RecordStatus = off
Status = open
Tag =
Timeout = 10
TimerFcn =
TimerPeriod = 1
TransferStatus = idle
Type = serial
UserData = ]
ValuesReceived = 0
ValuesSent = 0
SERIAL specific properties:
BaudRate = 115200
BreakInterruptFcn =
DataBits = 8
DataTerminalReady = on
FlowControl = none
Parity = none
PinStatus = [1x1 struct]
PinStatusFcn =
Port = COM1
ReadAsyncMode = continuous
RequestToSend = on
StopBits = 1
Terminator = LF
also… this is what a simple print statement I send looks like:
In MATLAB the should be ‘/r’, do I need to change the syntax of my command for the servo(s) to respond? Thanks very much for the response, after I get this going we’re hoping to get the code together for a 6DOF leg and then ultimately 4 of those legs for a nice lil’ quadraped…
It was just a guess. I know nothing about matlab. Note the SSC-32 will ignore the T command if it’s the first time that servo is turned on. This is because before it’s turned on there is no position stored in the memory for that channel. After the servo is turned on it will then use the T or S commands.
for the sake of thorough documentation on the forum I’ll let people know what my problem was… motivated by Robot Dude I went and checked out my terminator setup in MATLAB.
My terminator as you can see in my first post was set to LF (line feed), I don’t have a great grasp on this concept yet, but when i change the setting to CR (carriage return) or CR/LF my code works just like this:
fprintf(s, ‘#0P1500’)
I’ll definitely run into some more problems so I’ll keep you guys updated, but thanks for the help and maybe this stuff will become useful for someone later…