(Rev 0: 12/26/91 Rough draft of ROBI proposal covering SMC interface) (Rev 1: 4/3/93 This draft adds DMC interface signal defs. It also includes proposed additions to the secondary signal set and a method for distiguishing interface types. This draft supercedes all previous drafts.) ROBI SMC & DMC V1.0 By Bob Nansel The proposed ROBI Motor Channel allows simple interfacing to DC motors with device independence. One Motor Driver might use relays to control direction and a power transistor for PWM speed control of a 20 Amp motor; another might use sophisticated MOSFET H-bridges for a 20 mA motor. With the ROBI SMC the same Motor Controller (MC) can be used to control either. It's the partition of the functions of Control and Drive that makes this possible. ROBI Motor Channel interfaces come in Single Motor Channel (SMC) and Dual Motor Channel (DMC) varieties. The SMC uses a 16-pin IDC ribbon connector, while the DMC uses a 34-pin IDC ribbon connector. The ROBI SMC is comprised of eight signals: four outputs from the Motor Controller give bidirectional control of a DC motor and optional brake, and four inputs to monitor speed, direction and limit status (see table 2). The DMC (34-pin) interface includes two more signals, T0 & T1 to let the Controller determine Driver interface type (see table 3). Motor Channel Pin Primary Function summary: PWM A pulse width modulation signal is used to control speed DIR 1 for CW motion, 0 for CCW EN Enable = 0 selects Primary pin functions, Enable = 1 selects Secondary pin functions. The Secondary pin functions consist of three configuration lines C0ÐC2 used to control MD config- uration and four status lines R0ÐR3 to read MD status. This will allow future enhancements, such as the ability to con- trol stepper motors with a ROBI Motor Channel. To ensure compatibility with future versions of ROBI, when EN is high,the MD shall tristate TACH, SDIR, LP & LN with the MC optionally pulling those corresponding lines high. Also, PWM, DIR and BRK shall be isolated on MD from their corresponding MC pins and will be pulled low on the Motor Driver. This way future ROBI Motor Controllers will be able to place configur- ation data on C0ÐC2, and read configuration status on R0ÐR3. BRK This signal supports two different styles of braking: shunt and clutch. Shunt braking involves shorting the motor ter- minals together which slows the motor. Shunt braking occurs when the PWM and BRK signals are both low or both high (See table four). Clutch braking is active only when BRK is high, regardless of the state of PWM. This function is optional, and can be used in addition to shunt braking or alone. If no clutch brake is implemented on the motor controller (MC), this line shall be tied to ground. TACH This signal is used to monitor motor shaft output speed. The speed is determined from TACH by dividing its pulse frequency by the number of pulses the tachometer generates per revolu- tion. Optical, magneto and Hall Effect type tachometers nat- urally generate pulse outputs which can be used directly for TACH; tachometers that create analog outputs, say a voltage proportional to speed of rotation, may be used with suitable signal conditioning (i.e. voltage to frequency conversion). If a tachometer is not used, this line shall be pulled high by MD. SDIR The Sensed Direction signal can be derived from quadrature decoding in a discrete encoder or from the voltage polarity of an analog tachometer. For quadrature decoding, this signal may lag a few pulse times behind the TACH signal. LP, LN These signals act as limit condition sense lines where one or the otherÑbut not bothÑlines dropping low informs the con- troller that a limit of travel has been reached in the cor- responding direction. If both signals are low simultaneously the interpretation changes to that of an index or home posi- tion pulse. LP and LN will normally be held high by the motor driver. If MD doesnÕt implement limit and index functions, these lines shall be tied to +5 V. T0, T1 These signals are found only in the 34-pin signal set. They would normally be held high or low at the Driver end so the Controller can determine the type of interface connected. To allow more flexibility, when EN is high, these lines may change state to reflect the nature of the interface type the secondary pin function represent. ----------------- Table 1 ----------------- T1 T0 Interface Type ------------------------------------------- 0 0 DMC, Dual Motor Channel 0 1 TIC, biT Interface Channel 1 0 BIC, Byte Interface Channel 1 1 (reserved for future upgrade) When Enable is high, a rich set of secondary functions to allow reading and writing DMC configuration data becomes available. These Secondary DMC interface signal definitions are preliminary. They are essentially TIC or BIC type interfaces. They aren't fully defined, so your comments are invited. With the primary signals most DC motors can be controlled. The rest of the lines available in the channel are all ground lines. This may seem a waste, but the ground lines are important. Robots are electrically noisy creatures. Arcing commutator brushes, high current circuits, poor shielding and layout can make the difference between robots that work flawlessly and robots that donÕt work at all. Fortunately we can do a great deal about shielding and layout. There are two main types of electrical interference. One is capacitively coupled, the other is inductively coupled. For inductive coupling, reduction of loop area is the name of the game. A ground between every signal in a ROBI channel ensures that each signal has the minimum possible loop area to pick up inductively coupled noise. The ground lines also provide a modest amount of electrostatic shielding between signals. Whenever two wires run close to each other they form a capacitance through which signals can be capacitively coupled. This is known as crosstalk. With a ground between two signal lines, the capacitors formed are between each signal and ground, rather than from signal to signal. This substantially reduces crosstalk. Finally, having a dedicated ground for each signal allows the return current for each signal to flow through that ground. In a way, this is a restatement of the reduction in loop area principle, but this also has the effect of reducing differences in ground potential between the two ends of the cable. Ground potential differences are more commonly known as the dreaded Ground Loop. Note that a loop in a ground does not a ground loop make; a ground loop is specifically a current loop created by differences in ground potential existing in the circuit. The goal is to reduce ground potential differences as much as possible. One way to do that is to provide dedicated grounds for every signal. An excellent introduction to the causes and cures of electromagnetic interference can be found in IntelÕs Embedded Control Applications manual, specifically in Intel Applications Note AP-125 "Designing Microcontroller Systems for Electrically Noisy Environments," and Article Reprint AR-102, "PC Layout Techniques for Minimizing Noise." I recommend both articles. A note on terminology: Positive is defined for the above signals according to the natural function of the limit involved. If these are limits applied to propulsion motors, then for a left motor, positive is CCW, negative CW; for a right hand motor, positive would then be CW, negative CCW. The rule is to pick what direction is positive for the actuator in its normal operation, reversing the wiring to the actuator if necessary to maintain positive sense. -------------------------------- Table 2 ---------------------------------- 1st 2nd Pin # Func Func Description Interpretation Source --------------------------------------------------------------------------- 2-16 GND (same) Even # pins grounded 1 PWM C0 Pulse Width Modulation 0 = Motor OFF MC 1 = Motor ON 3 DIR C1 Direction of Motion 0 = CCW/Positive MC 1 = CW/Negative 5 EN (same) Enable Primary 0 = Primary functions MC 1 = Secondary functions 7 BRK C2 Brake 0 = Brake OFF MC 1 = Brake ON 9 TACH S0 Tachometer Pulse PFM signal, freq. f0 MD Rev/Sec = f0/(counts/rev) 11 SDIR S1 Sensed DIR of Motion 0 = CCW/Positive MD 1 = CW/Negative 13 LP S2 Limit Sense, Pos DIR (see text) MD 15 LN S3 Limit Sense, Neg DIR (see text) MD -------------------------------- Table 3 ---------------------------------- 1st 2nd Pin # Func Func Description Interpretation Source --------------------------------------------------------------------------- 2-32 GND (same) Even # pins grounded 1 -- -- (reserved for future upgrade) 3 PWMA Pulse Width Modulation 0 = Motor OFF MC 1 = Motor ON 3 SCK Data clock MC 5 DIRA Direction of Motion 0 = CCW/Positive MC 1 = CW/Negative 1 = Secondary functions 5 SDIO Serial Data In/Out MC,MD 7 BRKA Brake 0 = Brake OFF MC 1 = Brake ON 7 AS Address strobe MC 9 PWMB Pulse Width Modulation 0 = Motor OFF MC 1 = Motor ON 9 SRQ Service Request MD 11 DIRB Direction of Motion 0 = CCW/Positive MC 1 = CW/Negative 11 RESET Reset interace 13 BRKB Brake 0 = Brake OFF MC 1 = Brake ON 13 R/W\ Read/Write NOT 15 EN=0 EN=1 Enable Primary 0 = Primary functions MC 1 = Secondary functions 17 TACHA Tachometer Pulse A PFM signal, freq. f0 MD Rev/Sec = f0/(counts/rev) 17 AD0 Multiplexed Bidirectional Address & Data 19 SDIRA AD1 Sensed DIR of Motion 0 = CCW/Positive MD 1 = CW/Negative 21 LPA AD2 Limit Sense, Pos DIR (see text) MD 23 LNA AD3 Limit Sense, Neg DIR (see text) MD 25 TACHB AD4 Tachometer Pulse PFM signal, freq. f0 MD Rev/Sec = f0/(counts/rev) 27 SDIRB AD5 Sensed DIR of Motion 0 = CCW/Positive MD 1 = CW/Negative 29 LPB AD6 Limit Sense, Pos DIR (see text) MD 31 LNB AD7 Limit Sense, Neg DIR (see text) MD 33 T0 (same) Interface Type bit 0 (see Table 1) 34 T1 (same) Interface Type bit 1 (see Table 1) -------------------------------- Table 4 ---------------------------------- PWM DIR BRK MOSFET H-Bridge Relay H-Bridge Brake --------------------------------------------------------------------------- H H L Src 1, Sink 2 Src 1, Sink 2 OFF H L L Sink 1, Source 2 Sink 1, Src 2 OFF L X L Back EMF current Back EMF current OFF flows in Src1, Src 2 flows in diodes (see fig 1) H H H Braking current flows Braking current flows ON in Src 1, Src 2 in Src 1, Src 2 H L H Braking current flows Braking current flows ON in Sink 1, Sink 2 in Sink 1, Sink 2 L X H NONE (controlled by DIR) ON -------------------------------- Figure 1 --------------------------------- Partial Schematic of Relay H-Bridge Motor Driver --------------------------------------------------------------------------- (K1: Src1=NO & Sink1=NC) (K2: Src2=NO & Sink2=NC) K1 K2 > /< >\ < Bat+ | / | | \ | Bat+ Relay | | / | | \ | | H-Bridge | | / | | \ | | +---O O O-------O O O---+ | | | | | | K1 = Dir +----|--------+ | K2 = NOT(Dir XOR Brk) | | | | | | ||--+ | | | | | ||<-+ | | | | | | PWM ---------------------+|--+ | | Q1 | | | (N-chan power MOSFET) _|_ | | Gnd | | | | Batt+ | | | | | | D1 | | D3 O-------|<|---------|---O---------|<|------+ | + | | + | | | | | +-------|<|---------O---|---------|<|------O D2 + | | D4 + | | | _|_ These diodes conduct motor recir- | | Gnd culating current during Q1 OFF time | | and when relays switch | | +---------+ | +-----+ | | | DC +-----+ | | Motor | | | | +-----+ +---------+ | +---------+ --------------------------------------------------------------------------- Comments & suggestions can be sent to: Bob Nansel 816 N 105 Seattle, WA 98133 (206) 782-5989 (8 to 5 Pacific Time)