63/71
User’s Manual
v1.07
wCK series
A-4 Application Example
The following is an example C programs required and helpful for controlling a wCK module. Functions relating to serial
communication may vary depending upon the type of MPU so add accordingly required functions for your MPU.
/*=============================================================================*/
/* Example Program
*/
/* Motion Explanation : If given a force, wCK rotates to the direction of the force and stops
*/
/* Motion Logic : Read wCK’s position feedback to decide rotation direction and start movement
*/
/*
when there’s any change in position
*/
/*=============================================================================*/
#define HEADER 0xff
#define NULL 0
#define ROTATE_CCW 3
#define ROTATE_CW 4
/* Start of Function Prototype-----------------------------------------------------*/
/*------------------ Function relating to serial communication ----------------*/
void SendByte(char data); // Send 1 Byte to serial port
void GetByte(char timeout); // Receive 1 Byte from serial port
/*------------------Basic Functions relating to wCK module--------------------------*/
void SendOperCommand(char Data1, char Data2);
void SendSetCommand(char Data1, char Data2, char Data3, char Data4);
char PosSend(char ServoID, char SpeedLevel, char Position);
char PosRead(char ServoID);
char ActDown(char ServoID);
char PowerDown(void);
char Rotation360(char ServoID, char SpeedLevel, char RotationDir);
void SyncPosSend(char LastID, char SpeedLevel, char *TargetArray, char Index);
char BaudrateSet(char ServoID, char NewBaud);
char GainSet(char ServoID, char *NewPgain, char *NewDgain);
char IdSet(char ServoID, char NewId);
char GainRead(char ServoID, char *Pgain, char *Dgain);
char ResolSet(char ServoID, char NewResol);
char ResolRead(char ServoID);
char OverCTSet(char ServoID, char NewOverCT);
char OverCTRead(char ServoID);
char BoundSet(char ServoID, char *NewLBound, char *NewUBound);
char BoundRead(char ServoID, char *LBound, char *UBound);
/*------------------------------------------------------- End of Function Prototype */
Summary of Contents for wCK series
Page 1: ...wCK series User s Manual Intelligent Modular Robot Ver 1 07 ...
Page 9: ...9 71 User s Manual v1 07 wCK series Figure1 6a Application VariousArticulatedRobots ...
Page 12: ...12 71 User s Manual v1 07 wCK series Figure1 8c BlowUpPicture Figure1 8b Dimension ...
Page 17: ...17 71 User s Manual v1 07 wCK series JOINT 4 JOINT 5 JOINT 6 ...
Page 18: ...18 71 User s Manual v1 07 wCK series JOINT 7 JOINT 8 JOINT 9 ...
Page 19: ...19 71 User s Manual v1 07 wCK series JOINT 10 JOINT 12 JOINT 11 ...
Page 29: ...29 71 User s Manual v1 07 wCK series PDgainControl PIDgainControl ...