The second byte specifies the lowest channel number in the block. The first byte specifies how many channels are in the contiguous block this is the number of target values you will need to send. This command simultaneously sets the targets for a contiguous block of channels. Pololu protocol: 0xAA, device number, 0x1F, number of targets, first channel number, first target low bits, first target high bits, second target low bits, second target high bits, … Set Multiple Targets (Mini Maestro 12, 18, and 24 only)Ĭompact protocol: 0x9F, number of targets, first channel number, first target low bits, first target high bits, second target low bits, second target high bits, … For example, a Micro Maestro 6-channel servo controller with a Mini SSC Offset of 12 will obey Mini-SSC commands whose address is within 12–17. The Mini SSC Offset is added to the channel number to compute the correct channel address to use with this command. To allow multiple Maestros to be controlled on the same serial line, set the Mini SSC Offset parameter to different values for each Maestro. By default, the channel address is equal to the channel number, so it should be from 0 to 23. The channel address is a value in the range 0–254. These settings can be useful for calibrating motion without changing the program sending serial commands. Specifically, an 8-bit target of 127 corresponds to the neutral setting for that channel, while 0 or 254 correspond to the neutral setting minus or plus the range setting. The 8-bit target value is converted to a full-resolution target value according to the range and neutral settings stored on the Maestro for that channel. This command sets the target of a channel to a value specified by an 8-bit target value from 0 to 254. Mini-SSC protocol: 0xFF, channel address, 8-bit target If you want a shorter and lower-resolution set of commands for setting the target you can use the Mini-SSC command below. Many servo control applications do not need quarter-microsecond target resolution. SerialBytes = (target > 7) & 0x7F // Third data byte holds the bits 7-13 of target. SerialBytes = target & 0x7F // Second byte holds the lower 7 bits of target. SerialBytes = channel // First data byte holds channel number. SerialBytes = 0x84 // Command byte: Set Target. Here is some example C code that will generate the correct serial bytes, given an integer “channel” that holds the channel number, an integer “target” that holds the desired target (in units of quarter microseconds if this is a servo channel) and an array called serialBytes: If the channel is configured as a digital output, values less than 6000 tell the Maestro to drive the line low, while values of 6000 or greater tell the Maestro to drive the line high.įor example, if channel 2 is configured as a servo and you want to set its target to 1500 µs (1500×4 = 6000 = 0101110 1110000 in binary), you could send the following byte sequence: A target value of 0 tells the Maestro to stop sending pulses to the servo. If the channel is configured as a servo, then the target represents the pulse width to transmit in units of quarter-microseconds. The lower 7 bits of the third data byte represent bits 0–6 of the target (the lower 7 bits), while the lower 7 bits of the fourth data byte represent bits 7–13 of the target. Pololu protocol: 0xAA, device number, 0x04, channel number, target low bits, target high bits Set Target (Pololu/Compact protocol)Ĭompact protocol: 0x84, channel number, target low bits, target high bits The Maestro has several serial commands for setting the target of a channel, getting its current position, and setting its speed and acceleration limits.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |