In Program mode, positions, speed, and accelerations are called and executed inside predefined programs called program banks and logic banks. The logic and program bank systems are independent, but can offer enormous flexibility when used together. Advantages and use cases for each bank type will be discussed in the following sections.

Banks allow for intelligent operation of the cool muscle motor. The banks can be programmed and stored in the motors memory and executed in a number of ways. Programming the motor in this way eliminates the need for an external control mechanism, and as such improves the performance and timing of the system.

The Cool Muscle can store up to 30 different program banks, and 30 different logic banks, but there can only be a combined total of 200 program steps. You can check the current number of program steps by sending the motor a ?1000 command which will reply with all of the programming in the motor as well as the number of steps currently used.

 

CML

The cool muscle motors are programmed using a language called Cool Muscle Language, or CML. Both logic and program banks have access to all CML commands, registers, and states.

Syntax

Syntax in logic and program banks is similar. If there is an error in syntax, the bank will cease to load from that point on. If you read back the bank from the motor, you can compare this to what is expected to assist in pinpointing any syntax errors. It is always good practice to read back the programmed banks in a motor using the ?1000 command to verify that everything has loaded correctly.

Start and End

Each bank must begin with the start command, B# for program banks, and L# for logic banks where # is the bank number. Each bank must be ended by the END command. Anything between these statements is taken to be a part of that bank.

Separating Commands

All commands on the same line are grouped; these may be part of an equation or branch operation. Commands to be called consecutively should be placed on a new line, separated by a carriage return. You can place some consecutive commands on the same line, separated by a comma but the maximum number of characters allowed before a carriage return is 40.

  • No labels