The Bioloid Gait Software has been ported to the new CM-700. The software has been tested with AX-12+, RX28, RX24, RX64 and DX117 servos and can run them all interchangeably. Note, no accommodations have been made for the different servo speeds so the servo group speeds will need to be recalculated. In addition the software has been massively cleaned and streamlined. All compiler warnings in main.c have been eliminated and substantial commenting has been introduced. For detailed information see my report on the bioloid real time control software.
How to get started with the CM700:
- Unzip the zip file (2June2010ProjectFiles)
- Open AVR-Studio.
- Open the Project file (bioloid.aps)
- You may modify main.c to implement changes.
- Choose Build->Build and wait about 30 seconds
- On conclusion it should report “Build Succeeded”
- In your project directory you now have a file called “bioloid.hex”
- Open Robot Terminal
- Hold the # key.
- Power cycle the CM700
- The prompt “SYSTEM-O.K. CM700 BOOTLOADER 1.51) should appear
- Type LD
- Select Files->Transmit File and select your bioloid.hex file
- It will report “Transmitting Data” and should conclude after about 30 seconds with “Success”
Here is the main loop. (Now should be readable!)
-
//——————————————————————————
-
// Main Function called each time Micro is restarted
-
//——————————————————————————
-
int main(void)
-
{
-
//——————————————————————————
-
// Initialization (Done Once)
-
//——————————————————————————
-
InitializeRobot();
-
int Tick = 0;
-
RobotFlags = 0;
-
//——————————————————————————
-
// Main Loop (Never Terminates)
-
//——————————————————————————
-
for(;;)
-
{
-
if (RobotFlags & _BV(MSGRCV)) //Check to see if anything came in on the serial port
-
{
-
cli(); //Clear Interrupts
-
RobotFlags=RobotFlags & ~_BV(MSGRCV);
-
sei(); //Set Interupts
-
if(CheckProtocol())
-
OnGoodPacket(); //This function is in comms.c and is the main messaging function
-
}
-
if (RobotFlags & _BV(HBEAT)) //Check to see if a heartbeat happened, if it did, do the next Tick
-
{
-
cli(); //Clear Interrupts
-
RobotFlags=RobotFlags & ~_BV(HBEAT);
-
sei(); //Set Interupts
-
Set_LED(LED_RXD, LED_OFF);
-
ZigbeeHeartBeat();
-
if(Tick==0) //Ticks per pose is implemented so that the main motion only happens when Ticks is 0
-
{
-
IMUReport(IMU_Report_Flag); //Do IMU sensor reporting if set
-
ServoReport(Servo_Report_Flag); //Do Servo reporting if set
-
FootReport(Foot_Report_Flag); //Do foot sensor reporting if set
-
if (UsingPoseSystem==2) //If Usingposesystem = 2 then we are controlling servos directly
-
{
-
UpdateServosDirectly();
-
}
-
if (UsingPoseSystem==0) //The UsingPoseSystem is used to turn on and off the dynamic gait.
-
{
-
DynamicGait();
-
PoseNum++;
-
if (PoseNum >= NumPoses) PoseNum = 0;
-
}
-
}
-
Tick++;
-
if (Tick >= Ticks_Per_Pose) Tick = 0; //Restart the Tick Counter
-
}
-
}
-
}