📄 drive.doc
字号:
driver unit will transfer more precise information on the actual percent error. Communication with the driver unit may take place during the test. Thismakes it possible for the master unit to periodically poll the driver for itscurrent status and to determine when the driver is finished with a test. Thedriver unit may also receive an abort command from the master over thecommunications line, telling it to stop the test, or telling it to changespeed or stop during jog mode. (C) Jog Mode When the driver receives the jog command, it will be set in the jog modefor all the following tests until it next receives a different specification.Each time a register is placed, the driver unit will automatically start thejog process. The motor will accelerate up to a relatively fast speed. Each time thedriver receives the change-speed command from the master, it will switch itsspeed between fast and slow (1750 RPM and 500 RPM). When it receives theabort command, it will stop the motor.(5) Communications and Commands (A) Overview. A RS-485 multidrop set-up is used to allow a master unit to communicate withthe driver, and possible several drivers in parallel. Communications are runwith 9 bits, no parity, 1 data bit and at 9600 baud. At the driver unit, it is assumed that T0 will be driving the transmitbuffer. When set, T0 enables transmissions over the RS-485, and when cleartransmissions are disabled. In general, at no time can more than one unit on a RS-485 line have itstransmission enabled. (B) Addresses and Address Matching. The 9th bit can be used by a master unit to distinguish between an addressand data. If the unit had one master and 4 drivers, then each driver can begiven a different address, particularily, f7, fb, fd, and fe (hexadecimal).In this setup there can also be one broadcast address (ff). When these addresses are represented in binary, the look like this: First Driver f7: 1 1 1 1 0 1 1 1 Second Driver fb: 1 1 1 1 1 0 1 1 Third Driver fd: 1 1 1 1 1 1 0 1 Fourth Driver fe: 1 1 1 1 1 1 1 0 Broadcast ff: 1 1 1 1 1 1 1 1A driver will respond to any addresses that "matches" its own address. A matchoccurs with any address is sent out with 1's occurring in AT LEAST the positionsthat the driver's address has 1's in. As an example that has nothing to do with the above, if the address to bematched was 33 in hexadecimal (00110011 binary), then the following 16addresses would match it: 0 0 1 1 0 0 1 1 0 0 1 1 0 1 1 1 0 0 1 1 1 0 1 1 0 0 1 1 1 1 1 1 0 1 1 1 0 0 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 0 1 1 0 0 1 1 1 0 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1which have hexadecimal values: 33, 37, 3b, 3f, 73, 77, 7b, 7f, b3, b7, bb, bf,f3, f7, fb, and ff. In the above cases, the only thing that matches addressf7, fb, fd, or fe is the address itself and ff. This justifies calling ff thebroadcast address. When the 9th bit is set to 0, then it is assumed that data is being sent.Only the units that have just been addressed will accept the data, the otherswill simply ignore it. A master does not need an address, so each driver will only send data withthe 9th bit set to 0. No driver ever sends an address. The software for thesecommunication routines is contained in RX9.lib. (C) Polling A master unit can periodically poll each driver unit to determine when eachhas just completed a test. At that time, it will request more information onthe test results from the driver. (D) Command summary These are the possible commands that can be sent to the driver. Thecommands TEST, JOG, CHANGE, and ABORT can be sent with a broadcast address.The others, STATUS, and DATA can only be send to individual addresses. The format of a command must be: Address (9th bit set to 1), Command (9th bit set to 0)as described above. The values of the commands are respectively: 0 ... TEST 1 ... JOG 2 ... CHANGE 3 ... STATUS 4 ... ABORT 5 ... DATAThe following is a summary of the commands: STATUS: To poll the driver's status: The driver will respond with two bytes: Speed ... the current speed of the motor in 25 RPM units, represented iu Binary-Coded Decimal format. Status ... the byte containing the status flags: Bit 0 = 1 if the motor is currently active, 0 else. Bit 1 = 1 if the Client is in testing mode, 0 for jogging. Bits 2 to 7 are all 0. The values of Status are thus: 0 = Motor off. Waiting to begin jog. This is the initial state. 1 = Motor running. Currently in jog mode. 2 = Motor off. Waiting to begin a test. 3 = Motor running. Currently in a test. The Speed is represented as a Binary-Coded Decimal taking on values 00 for (0 RPM), 01 (25 RPM), 02 (50 RPM), up to 70 (1750 RPM). DATA: To query the driver's measurement of register accuracy. The master unit should sent this command immediately after it detects a transition out of state 3. The driver will respond by sending the following bytes: Sensors ... the number of sensors recorded (0, 1, or 2). Results ... the byte containing the results of the test: Bit 0 = 1 if the test passed, 0 if it failed. Bit 1 = 1 for a pulse match or over-count, 0 for a pulse-undercount. Bits 2 to 7 are all 0. Percentage ... a absolute value of the percent error. The value of Results are thus: 0 = Test failed. Pulse under-count. 1 = Test passed. Measured pulse count < Calculated pulse count. 2 = Test failed. Pulse over-count. 3 = Test passed. Measured pulse count >= Calculated pulse count. A test is considered to have passed if it falls within the accuracy control limit (currently set at 0.4%). The last two items are only valid if the sensor count is two. During a test, the Results and Percentage variables are set to 0. Percentage is represented as a Binary-Coded-Decimal, taking on values 00h (0.0%), 01h (0.1%), all the way up to 99h (9.9%). Any percent error exceeding 9.9% is truncated to 9.9%. TEST: To enable the test mode for the driver. Data will be sent to indicate the theoretical number of pulses the motor requires to rotate the register dial one full rotation. The driver will use it to measure the register's accuracy against. It will switch on Bit 1 obtained from the STATUS command. The pulse number is sent to the driver as a 3 byte integer with the lowest order byte first. JOG: To enable the jog mode for the driver. The driver will switch off Bit 1, as read in the STATUS command. CHANGE: To change the current jog speed. The driver responds by switching between fast jog and slow jog. This only has effect in state 1 (jog mode active). ABORT: To abort a test, or to stop the jog mode. This only takes effect when Bit 0 of the STATUS command is on (motor active).DATA is always responded to, but is only meaningful after a test has completed.The values returned reflect the status of the last test run, or are meaninglessif no previous test has been run. For obvious reasons, STATUS is also alwaysresponded to.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -