INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

NONFRAMEWORK CODE
Driver Interfaces
Drivers
Libraries
Utilities

FRAMEWORK CODE
Interfaces
Components
Libraries
Utilities

Full Software Listings

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

mhidefs.h

00001 /*************************************************************************
00002         
00003         date            : August 2008
00004         copyright       : (C) 2005 J.D. Yamokoski
00005         email   : yamokosk+gnu at gmail dot com
00006 
00007  This library is free software; you can redistribute it and/or
00008  modify it under the terms of the GNU Lesser General Public License as
00009  published by the Free Software Foundation; either version 2.1 of the License,
00010  or (at your option) any later version. The text of the GNU Lesser General
00011  Public License is included with this library in the file LICENSE.TXT.
00012  
00013  This library is distributed in the hope that it will be useful, but WITHOUT
00014  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00015  or FITNESS FOR A PARTICULAR PURPOSE. See the file LICENSE.TXT for
00016  more details.
00017  
00018  *************************************************************************/
00019  
00020 #ifndef HYDRO_MHI_PA10_CONFIGURATION_H
00021 #define HYDRO_MHI_PA10_CONFIGURATION_H
00022 
00023 #include <string>
00024 
00025 /*
00026  * author yamokosk
00027  *
00028  * Definition of PA10 status bits. The creation of the enum and char arrays may look
00029  * a bit odd. Its using a little known and rarely used C-preprocessor technique called X-macros.
00030  * See http://en.wikipedia.org/wiki/C_preprocessor#X-Macros for more information on them.
00031  */
00032 #define SERVO_STATUS    FIELD(0x0001, PositiveAngleLimit, "Positive angle limit reached.")      \
00033                                                 FIELD(0x0002, NegativeAngleLimit, "Negative angle limit reached.")      \
00034                                                 FIELD(0x4000, ModeUncontrollable, "Servo is uncontrollable.")           \
00035                                                 FIELD(0x8000, PowerOff, "Servo power OFF.")
00036 
00037 #define SERVO_ALARMS    FIELD(0x0010, AlarmSharedMemory, "Shared memory anomaly. (A)")                                                                          \
00038                                                 FIELD(0x0020, AlarmEEPROM, "EEPROM anomaly. (A)")                                                                                                       \
00039                                                 FIELD(0x0050, AlarmCPU, "CPU anomaly. (A)")                                                                                                                     \
00040                                                 FIELD(0x0060, AlarmVelocityDeviation, "Velocity deviation anomaly. (A)")                                                        \
00041                                                 FIELD(0x0070, AlarmResolverDeviation, "Resolver deviation anomaly. (A)")                                                        \
00042                                                 FIELD(0x0080, AlarmPositionLimit, "Position limit exceeded. (A)")                                                                       \
00043                                                 FIELD(0x0090, AlarmMotorTorque, "Motor torque anomaly. (A)")                                                                            \
00044                                                 FIELD(0x00A0, AlarmIPM, "IPM anomaly. (A)")                                                                                                                     \
00045                                                 FIELD(0x00B0, AlarmBrakeShrtCircuit, "Brake short circuit detected. (A)")                                                       \
00046                                                 FIELD(0x00C0, AlarmMtrSideResolverShrtCircuit, "Motor side resolver short circuit detected. (A)")       \
00047                                                 FIELD(0x00D0, AlarmGrSideResolverShrtCircuit, "Gear side resolver short circuit detected. (A)")         \
00048                                                 FIELD(0x00E0, AlarmOverCurrent, "Current limit exceeded. (A)")                                                                          \
00049                                                 FIELD(0x00F0, AlarmOverVelocity, "Velocity limit exceeded. (A)")                                                                        \
00050                                                 FIELD(0x0100, AlarmUnknown, "Unknown CPU anomaly. (A)")                                                                                         \
00051                                                 FIELD(0x0110, AlarmEStopSwOn, "E-stop switch closed. (A)")                                                                                      \
00052                                                 FIELD(0x0120, AlarmDeadmanSwOff, "Dead-man switch opened. (A)")                                                                         \
00053                                                 FIELD(0x0130, AlarmLimitSwOn, "Limit switch closed. (A)")                                                                                       \
00054                                                 FIELD(0x0FF0, AlarmCommTimeout, "Communication timeout. (A)")
00055 
00056 #define COMM_STATUS             FIELD(0x0001, DeadmanSwOn, "Dead-man switch closed.")                                   \
00057                                                 FIELD(0x0002, PowerTempAnomaly, "Power source temperature anomaly.")    \
00058                                                 FIELD(0x0004, 100VOutputOn, "100V power output ON.")                                    \
00059                                                 FIELD(0x0008, EStopSwOff, "E-stop switch open.")                                                \
00060                                                 FIELD(0x1000, TeachingSwOn, "Teaching switch closed.")                                  \
00061                                                 FIELD(0x2000, LimitSwOff, "Limit switch open.")                                                 \
00062                                                 FIELD(0x4000, ModeUncontrollable, "PA10 is uncontrollable.")
00063 
00064 #define COMM_ALARMS             FIELD(0x0020, AlarmEEPROM, "EEPROM anomaly. (A)")                                                                               \
00065                                                 FIELD(0x0030, AlarmArcnetInit, "ARCNET initialization error. (A)")                                              \
00066                                                 FIELD(0x0040, AlarmCPU, "CPU anomaly. (A)")                                                                                             \
00067                                                 FIELD(0x0050, AlarmCommTimeout, "Communication with upper controller timed out. (A)")   \
00068                                                 FIELD(0x0060, AlarmPowerTemp, "Power source temperature anomaly. (A)")                                  \
00069                                                 FIELD(0x0070, Alarm100VOutput, "100V output anomaly. (A)")                                                              \
00070                                                 FIELD(0x0100, AlarmUnknown, "Unknown anomaly occured. (A)")                                                             \
00071                                                 FIELD(0x0110, AlarmEStopSwOn, "E-stop switch closed. (A)")                                                              \
00072                                                 FIELD(0x0120, AlarmDeadmanSwOff, "Dead-man switch opened. (A)")                                                 \
00073                                                 FIELD(0x0130, AlarmLimitSwOn, "Limit switch closed. (A)")
00074 
00075 namespace mhipa10arc
00076 {
00077 
00078 enum ServoFlags
00079 {
00080         ServoFlagPlaceholder=-1,
00081 #define FIELD(flag, ID, desc) Servo##ID = flag,
00082         SERVO_STATUS
00083         SERVO_ALARMS
00084 #undef FIELD
00085 };
00086 
00087 static const unsigned int NumServoFlags = 22;
00088 
00089 static const int ServoBitMasks[] = 
00090 {
00091 #define FIELD(flag, ID, desc) flag,
00092         SERVO_STATUS
00093         SERVO_ALARMS
00094 #undef FIELD
00095 };
00096 
00097 static const char* ServoFlagDesc[] = 
00098 {
00099 #define FIELD(flag, ID, desc) desc,
00100         SERVO_STATUS
00101         SERVO_ALARMS
00102 #undef FIELD
00103 };
00104 
00105 enum CommCPUFlags
00106 {
00107 #define FIELD(flag, ID, desc) Comm##ID = flag,
00108         COMM_STATUS
00109         COMM_ALARMS
00110 #undef FIELD
00111 };
00112 
00113 static const unsigned int NumCommCPUFlags = 17;
00114 
00115 static const int CommBitMasks[] = 
00116 {
00117 #define FIELD(flag, ID, desc) flag,
00118         COMM_STATUS
00119         COMM_ALARMS
00120 #undef FIELD
00121 };
00122 
00123 static const char* CommFlagDesc[] = 
00124 {
00125 #define FIELD(flag, ID, desc) desc,
00126         COMM_STATUS
00127         COMM_ALARMS
00128 #undef FIELD
00129 };
00130 
00131 // Conversion constants
00132 static const float      SPEED_TO_COUNT = 5000.0;
00133 static const float      TORQUE_TO_COUNT = 4096.0;
00134 static const float      COUNT_TO_SPEED = 2e-4;
00135 static const float      COUNT_TO_TORQUE = 0.244140625e-3;
00136 static const double COUNT_TO_DEGREE = 0.439453125e-3;
00137 
00138 
00139 } // End namespace
00140 
00141 #endif
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5