amtec_commands.h
Go to the documentation of this file.
00001 /*********************************************************************
00002  *
00003  * Software License Agreement (BSD License)
00004  *
00005  *  Copyright (c) 2008, Robert Bosch LLC.
00006  *  All rights reserved.
00007  *
00008  *  Redistribution and use in source and binary forms, with or without
00009  *  modification, are permitted provided that the following conditions
00010  *  are met:
00011  *
00012  *   * Redistributions of source code must retain the above copyright
00013  *     notice, this list of conditions and the following disclaimer.
00014  *   * Redistributions in binary form must reproduce the above
00015  *     copyright notice, this list of conditions and the following
00016  *     disclaimer in the documentation and/or other materials provided
00017  *     with the distribution.
00018  *   * Neither the name of the Robert Bosch nor the names of its
00019  *     contributors may be used to endorse or promote products derived
00020  *     from this software without specific prior written permission.
00021  *
00022  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00023  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00024  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00025  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00026  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00027  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00028  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00029  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00030  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00031  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00032  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00033  *  POSSIBILITY OF SUCH DAMAGE.
00034  *
00035  *********************************************************************/
00036  
00037 #ifndef AMTEC_COMMANDS
00038 #define AMTEC_COMMANDS
00039 
00040 #include "amtec_base.h"
00041 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045 
00046 /*
00047  * General Commands
00048  */
00049 int amtecReset(amtec_powercube_device_p dev, int id);                        /* Clear error state */
00050 int amtecHome(amtec_powercube_device_p dev, int id);                         /* Start Homing procedure */
00051 int amtecHalt(amtec_powercube_device_p dev, int id);                         /* Stop immediately */
00052 int amtecRecalcPIDParam(amtec_powercube_device_p dev, int id);               /* Recalculate the PID loop parameters */
00053 int amtecResetTime(amtec_powercube_device_p dev, int id);                    /* Reset internal clock to zero */
00054 
00055 /*
00056  * Motion Commands
00057  */
00058 int amtecMotionFRamp(amtec_powercube_device_p dev, int id, float position);   /* Target position in rad */
00059 int amtecMotionFStep(amtec_powercube_device_p dev, int id, float position,    /* Target position in rad */
00060                                                     unsigned short time);      /* Target time in ms */
00061 int amtecMotionFVel(amtec_powercube_device_p dev, int id, float velocity);    /* Target velocity in rad/s */
00062 int amtecMotionFCur(amtec_powercube_device_p dev, int id, float current);     /* Target current in amp */
00063 int amtecMotionIRamp(amtec_powercube_device_p dev, int id, int ticks);        /* Target position in encoder ticks */
00064 int amtecMotionIStep(amtec_powercube_device_p dev, int id, int ticks,         /* Target position in encoder ticks */
00065                                                     unsigned short time);      /* Target time in ms */
00066 int amtecMotionIVel(amtec_powercube_device_p dev, int id, int val);           /* Target velocity in encoder ticks/s */
00067 int amtecMotionICur(amtec_powercube_device_p dev, int id, short val);         /* Target current in digits */
00068 int amtecMotionFCosLoop(amtec_powercube_device_p dev, int id, float pos,      /* Target position in rad */
00069                                                     unsigned short period);    /* Target period in ms */
00070 int amtecMotionFRampLoop(amtec_powercube_device_p dev, int id, float val);    /* Target position in rad/s */
00071 
00072 /*
00073  * Retrieve Module Parameters
00074  */
00075 float          amtecGetDefHomeOffset(amtec_powercube_device_p dev, int id);
00076 float          amtecGetDefGearRatio(amtec_powercube_device_p dev, int id);
00077 float          amtecGetDefLinRatio(amtec_powercube_device_p dev, int id);
00078 float          amtecGetDefMinPos(amtec_powercube_device_p dev, int id);
00079 float          amtecGetDefMaxPos(amtec_powercube_device_p dev, int id);
00080 float          amtecGetDefMaxDeltaPos(amtec_powercube_device_p dev, int id);
00081 float          amtecGetDefMaxDeltaVel(amtec_powercube_device_p dev, int id);
00082 float          amtecGetDefTorqueRatio(amtec_powercube_device_p dev, int id);
00083 float          amtecGetDefCurRatio(amtec_powercube_device_p dev, int id);
00084 float          amtecGetDefMaxVel(amtec_powercube_device_p dev, int id);
00085 float          amtecGetDefMaxAcc(amtec_powercube_device_p dev, int id);
00086 float          amtecGetDefMaxCur(amtec_powercube_device_p dev, int id);
00087 float          amtecGetDefHomeVel(amtec_powercube_device_p dev, int id);
00088 float          amtecGetDefHomeAcc(amtec_powercube_device_p dev, int id);
00089 unsigned int   amtecGetDefCubeSerial(amtec_powercube_device_p dev, int id);
00090 unsigned int   amtecGetDefPulsesPerTurn(amtec_powercube_device_p dev, int id);
00091 unsigned int   amtecGetDefConfig(amtec_powercube_device_p dev, int id);
00092 unsigned short amtecGetDefCubeVersion(amtec_powercube_device_p dev, int id);
00093 unsigned short amtecGetDefServiceInterval(amtec_powercube_device_p dev, int id);
00094 unsigned short amtecGetDefBrakeTimeOut (amtec_powercube_device_p dev, int id);
00095 unsigned char  amtecGetDefAddress(amtec_powercube_device_p dev, int id);
00096 unsigned char  amtecGetDefPrimBaud(amtec_powercube_device_p dev, int id);
00097 unsigned char  amtecGetDefScndBaud(amtec_powercube_device_p dev, int id);
00098 int            amtecGetPosCount(amtec_powercube_device_p dev, int id);
00099 int            amtecGetRefPosCount(amtec_powercube_device_p dev, int id);
00100 unsigned int   amtecGetDioSetup(amtec_powercube_device_p dev, int id);
00101 unsigned int   amtecGetCubeState(amtec_powercube_device_p dev, int id);
00102 unsigned int   amtecGetTargetPosInc(amtec_powercube_device_p dev, int id);
00103 unsigned int   amtecGetTargetVelInc(amtec_powercube_device_p dev, int id);
00104 unsigned int   amtecGetTargetAccInc(amtec_powercube_device_p dev, int id);
00105 unsigned int   amtecGetStepInc(amtec_powercube_device_p dev, int id);
00106 
00107 float          amtecGetMinPos(amtec_powercube_device_p dev, int id);
00108 float          amtecGetMaxPos(amtec_powercube_device_p dev, int id);
00109 float          amtecGetMaxVel(amtec_powercube_device_p dev, int id);
00110 float          amtecGetMaxAcc(amtec_powercube_device_p dev, int id);
00111 float          amtecGetMaxCur(amtec_powercube_device_p dev, int id);
00112 float          amtecGetActPos(amtec_powercube_device_p dev, int id);
00113 unsigned int   amtecGetConfig(amtec_powercube_device_p dev, int id);
00114 float          amtecGetActVel(amtec_powercube_device_p dev, int id);
00115 float          amtecGetTargetVel(amtec_powercube_device_p dev, int id);
00116 float          amtecGetTargetAcc(amtec_powercube_device_p dev, int id);
00117 float          amtecGetCur(amtec_powercube_device_p dev, int id);
00118 short          amtecGetActC0(amtec_powercube_device_p dev, int id);
00119 short          amtecGetActDamp(amtec_powercube_device_p dev, int id);
00120 short          amtecGetActA0(amtec_powercube_device_p dev, int id);
00121 
00122 /*
00123  * Set Powercube Module Parameters
00124  */
00125 void           amtecSetMinPos(amtec_powercube_device_p dev, int id, float val);
00126 void           amtecSetMaxPos(amtec_powercube_device_p dev, int id, float val);
00127 void           amtecSetMaxAcc(amtec_powercube_device_p dev, int id, float val);
00128 void           amtecSetMaxVel(amtec_powercube_device_p dev, int id, float val);
00129 void           amtecSetTargetAcc(amtec_powercube_device_p dev, int id, float val);
00130 void           amtecSetTargetVel(amtec_powercube_device_p dev, int id, float val);
00131 void           amtecSetMaxCur(amtec_powercube_device_p dev, int id, float val);
00132 void           amtecSetConfig(amtec_powercube_device_p dev, int id, unsigned int val);
00133 void           amtecSetActC0(amtec_powercube_device_p dev, int id, short val);
00134 void           amtecSetActDamp(amtec_powercube_device_p dev, int id, short val);
00135 void           amtecSetActA0(amtec_powercube_device_p dev, int id, short val);
00136 
00138 // * Special commands
00139 // */
00140 //void           AMTEC_vel_cmd(amtec_powercube_device_p dev, int id, float val);
00141 //void           AMTEC_exec_move(amtec_powercube_device_p dev, int id, float val);
00142 //void           AMTEC_exec_reset(amtec_powercube_device_p dev, int id);
00143 //void           AMTEC_exec_home(amtec_powercube_device_p dev, int id);
00144 //void           AMTEC_exec_halt(amtec_powercube_device_p dev, int id);
00145 //void           AMTEC_recalc_pid(amtec_powercube_device_p dev, int id);
00146 //void           AMTEC_set_velocity(amtec_powercube_device_p dev, int id, float val);
00147 //void           AMTEC_set_acceleration(amtec_powercube_device_p dev, int id, float val);
00148 
00149 #ifdef __cplusplus
00150 }
00151 #endif
00152 
00153 #endif


amtec
Author(s): Charles DuHadway, Benjamin Pitzer (Maintained by Benjamin Pitzer)
autogenerated on Sat Dec 28 2013 16:49:55