Controlling Servos on FAST Expansion Boards¶
Understanding EXP board addressing
This command is used with FAST Expansion and FAST breakout boards via a FAST Serial Protocol (FSP) connection to the EXP Bus. Please read the EXP Overview to understand the operation of these commands and addresses.
The FAST Expansion board FP-EXP-0071
has four servo ports. This page provides an overview of how you control them via the FAST Serial Protocol.
Since servos connect to expansion boards, you need to address your commands to the particular expansion board the servo is connected to in order to communicate with it. This is covered in the EXP Overview.
The FAST Serial Protocol has several commands for controlling "motors", which include servos, steppers, traditional motors, etc. Only a subset of the motor commands will be used for a particular motor type.
EM: Configure Motor¶
Before a servo can be used, it should be configured. The EM:
command is used to do this.
EM:<INDEX>,1,<MAX_TIME_MS>,<MIN>,<MAX>,<NEUTRAL><CR>
- INDEX - Which servo on the board are you configuring? 1-4. (TODO confirm, or is this 0-3?)
- 1 - What type of motor is this? Servos use a value of
1
- MAX_TIME_MS - what's the maximum time this servo is allowed to run? Powers it down after this, acts like a safety limit. Valid range is 0 - FFFF (which is 0 to 65,535ms)
- MIN - pulse time, in µS, for the servo to move to its minimum position. Default is
3E8
(1000). - MIX - pulse time for the servo to move to its maximum position. Default is
7D0
(2000). - NEUTRAL - pulse time for the servo to move to its home position. Default is
5DC
(1500).
The default pulse times will most likely be fine for most servos. (Depending on what you bought, you might have access to a data sheet where you can see the exact values used.) In prac
servo pulse width trial and error, default is “standard”, 1 min, 2 max 1500 idle CM: command, address is what??
EM: index: servo port max_time_ms: max length of time it will allow, FFFF, what’s this for? Kinda like a failsafe? min, max, center, pulse in uS. 2 bytes each, 1000, 2000, 1500
Motors, which apply to servos? ML is highest value, MH is lowest MP: position is one byte 00-FF, time_ms is max
MH: Motor Home
MP: Motor Position
N or > jump the next page, P or < for previous, search with S or ?