YouBotJointParameterPasswordProtected.hpp

Go to the documentation of this file.
00001 #ifndef YOUBOT_YOUBOTJOINTPARAMETERPASSWORDPROTECTED_H
00002 #define YOUBOT_YOUBOTJOINTPARAMETERPASSWORDPROTECTED_H
00003 
00004 /****************************************************************
00005  *
00006  * Copyright (c) 2011
00007  * All rights reserved.
00008  *
00009  * Hochschule Bonn-Rhein-Sieg
00010  * University of Applied Sciences
00011  * Computer Science Department
00012  *
00013  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00014  *
00015  * Author:
00016  * Jan Paulus, Nico Hochgeschwender, Michael Reckhaus, Azamat Shakhimardanov
00017  * Supervised by:
00018  * Gerhard K. Kraetzschmar
00019  *
00020  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00021  *
00022  * This sofware is published under a dual-license: GNU Lesser General Public 
00023  * License LGPL 2.1 and BSD license. The dual-license implies that users of this
00024  * code may choose which terms they prefer.
00025  *
00026  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00027  *
00028  * Redistribution and use in source and binary forms, with or without
00029  * modification, are permitted provided that the following conditions are met:
00030  *
00031  *     * Redistributions of source code must retain the above copyright
00032  *       notice, this list of conditions and the following disclaimer.
00033  *     * Redistributions in binary form must reproduce the above copyright
00034  *       notice, this list of conditions and the following disclaimer in the
00035  *       documentation and/or other materials provided with the distribution.
00036  *     * Neither the name of the Hochschule Bonn-Rhein-Sieg nor the names of its
00037  *       contributors may be used to endorse or promote products derived from
00038  *       this software without specific prior written permission.
00039  *
00040  * This program is free software: you can redistribute it and/or modify
00041  * it under the terms of the GNU Lesser General Public License LGPL as
00042  * published by the Free Software Foundation, either version 2.1 of the
00043  * License, or (at your option) any later version or the BSD license.
00044  *
00045  * This program is distributed in the hope that it will be useful,
00046  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00047  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00048  * GNU Lesser General Public License LGPL and the BSD license for more details.
00049  *
00050  * You should have received a copy of the GNU Lesser General Public
00051  * License LGPL and BSD license along with this program.
00052  *
00053  ****************************************************************/
00054 #include <vector>
00055 #include <sstream>
00056 #include <boost/limits.hpp>
00057 #include "generic/Logger.hpp"
00058 #include "generic/Units.hpp"
00059 #include "generic/Time.hpp"
00060 #include "generic/Exceptions.hpp"
00061 #include "generic-joint/JointParameter.hpp"
00062 #include "youbot/YouBotJointParameter.hpp"
00063 #include "youbot/ProtocolDefinitions.hpp"
00064 #include "youbot/YouBotSlaveMsg.hpp"
00065 #include "youbot/YouBotSlaveMailboxMsg.hpp"
00066 #include "youbot/YouBotJointStorage.hpp"
00067 namespace youbot {
00068 
00069 ///////////////////////////////////////////////////////////////////////////////
00070 /// abstract youBot joint parameter
00071 ///////////////////////////////////////////////////////////////////////////////
00072 class YouBotJointParameterPasswordProtected : public YouBotJointParameter {
00073 friend class YouBotJoint;
00074   protected:
00075     YouBotJointParameterPasswordProtected();
00076 
00077 
00078   public:
00079     virtual ~YouBotJointParameterPasswordProtected();
00080 
00081     virtual void toString(std::string& value) = 0;
00082 
00083 
00084   protected:
00085     virtual void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const = 0;
00086 
00087     virtual void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) = 0;
00088 
00089     virtual std::string getName() const = 0;
00090 
00091     virtual ParameterType getType() const = 0;
00092 
00093     std::string name;
00094 
00095     ParameterType parameterType;
00096 
00097 };
00098 ///////////////////////////////////////////////////////////////////////////////
00099 /// Enable overvoltage protection. 
00100 ///////////////////////////////////////////////////////////////////////////////
00101 class ActivateOvervoltageProtection : public YouBotJointParameterPasswordProtected {
00102 friend class YouBotJoint;
00103   public:
00104     ActivateOvervoltageProtection();
00105 
00106     virtual ~ActivateOvervoltageProtection();
00107 
00108     void getParameter(bool& parameter) const;
00109 
00110     void setParameter(const bool parameter);
00111 
00112     void toString(std::string& value);
00113 
00114 
00115   private:
00116     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00117 
00118     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00119 
00120     std::string getName() const {return this->name;};
00121 
00122     ParameterType getType() const {return this->parameterType;};
00123 
00124     bool value;
00125 
00126     std::string name;
00127 
00128     ParameterType parameterType;
00129 
00130 };
00131 ///////////////////////////////////////////////////////////////////////////////
00132 /// This value represents the internal commutation offset. (0 ... max. Encoder steps per rotation)
00133 ///////////////////////////////////////////////////////////////////////////////
00134 class ActualCommutationOffset : public YouBotJointParameterPasswordProtected {
00135 friend class YouBotJoint;
00136   public:
00137     ActualCommutationOffset();
00138 
00139     virtual ~ActualCommutationOffset();
00140 
00141     void getParameter(int& parameter) const;
00142 
00143     void setParameter(const int parameter);
00144 
00145     void toString(std::string& value);
00146 
00147 
00148   private:
00149     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00150 
00151     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00152 
00153     std::string getName() const {return this->name;};
00154 
00155     ParameterType getType() const {return this->parameterType;};
00156 
00157     int upperLimit;
00158 
00159     int lowerLimit;
00160 
00161     int value;
00162 
00163     std::string name;
00164 
00165     ParameterType parameterType;
00166 
00167 };
00168 ///////////////////////////////////////////////////////////////////////////////
00169 /// Enter a password to approve the change of protected parameters.
00170 ///////////////////////////////////////////////////////////////////////////////
00171 class ApproveProtectedParameters : public YouBotJointParameterPasswordProtected {
00172 friend class YouBotJoint;
00173   public:
00174     ApproveProtectedParameters();
00175 
00176     virtual ~ApproveProtectedParameters();
00177 
00178     void getParameter(int& parameter) const;
00179 
00180     void setParameter(const int parameter);
00181 
00182     void toString(std::string& value);
00183 
00184 
00185   private:
00186     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00187 
00188     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00189 
00190     std::string getName() const {return this->name;};
00191 
00192     ParameterType getType() const {return this->parameterType;};
00193 
00194     int upperLimit;
00195 
00196     int lowerLimit;
00197 
00198     int value;
00199 
00200     std::string name;
00201 
00202     ParameterType parameterType;
00203 
00204 };
00205 ///////////////////////////////////////////////////////////////////////////////
00206 /// BEMF constant of motor. Used for current regulation, position regulation and velocity regulation. Feed forward control for current regulation, position regulation and velocity regulation is disabled if BEMF constant is set to zero.
00207 ///////////////////////////////////////////////////////////////////////////////
00208 class BEMFConstant : public YouBotJointParameterPasswordProtected {
00209 friend class YouBotJoint;
00210   public:
00211     BEMFConstant();
00212 
00213     virtual ~BEMFConstant();
00214 
00215     void getParameter(int& parameter) const;
00216 
00217     void setParameter(const int parameter);
00218 
00219     void toString(std::string& value);
00220 
00221 
00222   private:
00223     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00224 
00225     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00226 
00227     std::string getName() const {return this->name;};
00228 
00229     ParameterType getType() const {return this->parameterType;};
00230 
00231     int upperLimit;
00232 
00233     int lowerLimit;
00234 
00235     int value;
00236 
00237     std::string name;
00238 
00239     ParameterType parameterType;
00240 
00241 };
00242 ///////////////////////////////////////////////////////////////////////////////
00243 /// The Commutation Mode.
00244 /// 0: Block commutation with hall sensors mode \n
00245 /// 1: Sensorless block commutation (hallFX) \n
00246 /// 2: Sine commutation with hall sensors \n
00247 /// 3: Sine commutation with encoder \n
00248 /// 4: Controlled block commutation \n
00249 /// 5: Controlled sine commutation \n
00250 ///////////////////////////////////////////////////////////////////////////////
00251 class CommutationMode : public YouBotJointParameterPasswordProtected {
00252 friend class YouBotJoint;
00253   public:
00254     CommutationMode();
00255 
00256     virtual ~CommutationMode();
00257 
00258     void getParameter(unsigned int& parameter) const;
00259 
00260     void setParameter(const unsigned int parameter);
00261 
00262     void toString(std::string& value);
00263 
00264 
00265   private:
00266     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00267 
00268     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00269 
00270     std::string getName() const {return this->name;};
00271 
00272     ParameterType getType() const {return this->parameterType;};
00273 
00274     unsigned int upperLimit;
00275 
00276     unsigned int lowerLimit;
00277 
00278     unsigned int value;
00279 
00280     std::string name;
00281 
00282     ParameterType parameterType;
00283 
00284 };
00285 ///////////////////////////////////////////////////////////////////////////////
00286 /// Motor current for controlled commutation. This parameter is used in commutation mode 1, 4, 5 and in initialization of sine.
00287 ///////////////////////////////////////////////////////////////////////////////
00288 class CommutationMotorCurrent : public YouBotJointParameterPasswordProtected {
00289 friend class YouBotJoint;
00290   public:
00291     CommutationMotorCurrent();
00292 
00293     virtual ~CommutationMotorCurrent();
00294 
00295     void getParameter(quantity<current>& parameter) const;
00296 
00297     void setParameter(const quantity<current>& parameter);
00298 
00299     void toString(std::string& value);
00300 
00301 
00302   private:
00303     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00304 
00305     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00306 
00307     std::string getName() const {return this->name;};
00308 
00309     ParameterType getType() const {return this->parameterType;};
00310 
00311     quantity<current> upperLimit;
00312 
00313     quantity<current> lowerLimit;
00314 
00315     quantity<current> value;
00316 
00317     std::string name;
00318 
00319     ParameterType parameterType;
00320 
00321 };
00322 ///////////////////////////////////////////////////////////////////////////////
00323 /// Delay of current limitation algorithm / PID current regulator. 
00324 ///////////////////////////////////////////////////////////////////////////////
00325 class CurrentControlLoopDelay : public YouBotJointParameterPasswordProtected {
00326 friend class YouBotJoint;
00327   public:
00328     CurrentControlLoopDelay();
00329 
00330     virtual ~CurrentControlLoopDelay();
00331 
00332     void getParameter(quantity<si::time>& parameter) const;
00333 
00334     void setParameter(const quantity<si::time>& parameter);
00335 
00336     void toString(std::string& value);
00337 
00338 
00339   private:
00340     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00341 
00342     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00343 
00344     std::string getName() const {return this->name;};
00345 
00346     ParameterType getType() const {return this->parameterType;};
00347 
00348     quantity<si::time> upperLimit;
00349 
00350     quantity<si::time> lowerLimit;
00351 
00352     quantity<si::time> value;
00353 
00354     std::string name;
00355 
00356     ParameterType parameterType;
00357 
00358 };
00359 ///////////////////////////////////////////////////////////////////////////////
00360 /// Encoder Steps per Rotation.
00361 ///////////////////////////////////////////////////////////////////////////////
00362 class EncoderResolution : public YouBotJointParameterPasswordProtected {
00363 friend class YouBotJoint;
00364   public:
00365     EncoderResolution();
00366 
00367     virtual ~EncoderResolution();
00368 
00369     void getParameter(unsigned int& parameter) const;
00370 
00371     void setParameter(const unsigned int parameter);
00372 
00373     void toString(std::string& value);
00374 
00375 
00376   private:
00377     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00378 
00379     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00380 
00381     std::string getName() const {return this->name;};
00382 
00383     ParameterType getType() const {return this->parameterType;};
00384 
00385     unsigned int upperLimit;
00386 
00387     unsigned int lowerLimit;
00388 
00389     unsigned int value;
00390 
00391     std::string name;
00392 
00393     ParameterType parameterType;
00394 
00395 };
00396 ///////////////////////////////////////////////////////////////////////////////
00397 /// Encoder stop switch.
00398 /// Bit 0: Left stop switch enable \n
00399 /// When this bit is set the motor will be stopped if it is moving in negative direction and the left stop switch input becomes active.\n\n
00400 /// Bit 1: Right stop switch enable \n
00401 /// When this bit is set the motor will be stopped if it is moving in positive direction and the right stop switch input becomes active\n\n
00402 /// Please see StopSwitchPolarity for selecting the stop switch input polarity.
00403 ///////////////////////////////////////////////////////////////////////////////
00404 class EncoderStopSwitch : public YouBotJointParameterPasswordProtected {
00405 friend class YouBotJoint;
00406   public:
00407     EncoderStopSwitch();
00408 
00409     virtual ~EncoderStopSwitch();
00410 
00411     void getParameter(unsigned int& parameter) const;
00412 
00413     void setParameter(const unsigned int parameter);
00414 
00415     void toString(std::string& value);
00416 
00417 
00418   private:
00419     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00420 
00421     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00422 
00423     std::string getName() const {return this->name;};
00424 
00425     ParameterType getType() const {return this->parameterType;};
00426 
00427     unsigned int upperLimit;
00428 
00429     unsigned int lowerLimit;
00430 
00431     unsigned int value;
00432 
00433     std::string name;
00434 
00435     ParameterType parameterType;
00436 
00437 };
00438 ///////////////////////////////////////////////////////////////////////////////
00439 /// Hall sensor invert. Sets one of the motors invert with inverted hall scheme, e.g. some Maxon motors
00440 ///////////////////////////////////////////////////////////////////////////////
00441 class HallSensorPolarityReversal : public YouBotJointParameterPasswordProtected {
00442 friend class YouBotJoint;
00443   public:
00444     HallSensorPolarityReversal();
00445 
00446     virtual ~HallSensorPolarityReversal();
00447 
00448     void getParameter(bool& parameter) const;
00449 
00450     void setParameter(const bool parameter);
00451 
00452     void toString(std::string& value);
00453 
00454 
00455   private:
00456     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00457 
00458     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00459 
00460     std::string getName() const {return this->name;};
00461 
00462     ParameterType getType() const {return this->parameterType;};
00463 
00464     bool value;
00465 
00466     std::string name;
00467 
00468     ParameterType parameterType;
00469 
00470 };
00471 ///////////////////////////////////////////////////////////////////////////////
00472 /// Counts how often an I2t sum was higher than the I2t limit.
00473 ///////////////////////////////////////////////////////////////////////////////
00474 class I2tExceedCounter : public YouBotJointParameterPasswordProtected {
00475 friend class YouBotJoint;
00476   public:
00477     I2tExceedCounter();
00478 
00479     virtual ~I2tExceedCounter();
00480 
00481     void getParameter(unsigned int& parameter) const;
00482 
00483     void setParameter(const unsigned int parameter);
00484 
00485     void toString(std::string& value);
00486 
00487 
00488   private:
00489     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00490 
00491     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00492 
00493     std::string getName() const {return this->name;};
00494 
00495     ParameterType getType() const {return this->parameterType;};
00496 
00497     unsigned int upperLimit;
00498 
00499     unsigned int lowerLimit;
00500 
00501     unsigned int value;
00502 
00503     std::string name;
00504 
00505     ParameterType parameterType;
00506 
00507 };
00508 ///////////////////////////////////////////////////////////////////////////////
00509 /// An actual I2t sum that exceeds this limit leads to increasing the I2t exceed counter.
00510 ///////////////////////////////////////////////////////////////////////////////
00511 class I2tLimit : public YouBotJointParameterPasswordProtected {
00512 friend class YouBotJoint;
00513   public:
00514     I2tLimit();
00515 
00516     virtual ~I2tLimit();
00517 
00518     void getParameter(unsigned int& parameter) const;
00519 
00520     void setParameter(const unsigned int parameter);
00521 
00522     void toString(std::string& value);
00523 
00524 
00525   private:
00526     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00527 
00528     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00529 
00530     std::string getName() const {return this->name;};
00531 
00532     ParameterType getType() const {return this->parameterType;};
00533 
00534     unsigned int upperLimit;
00535 
00536     unsigned int lowerLimit;
00537 
00538     unsigned int value;
00539 
00540     std::string name;
00541 
00542     ParameterType parameterType;
00543 
00544 };
00545 ///////////////////////////////////////////////////////////////////////////////
00546 /// Initialization Mode.
00547 /// 0: Initialization in controlled sine commutation \n
00548 /// 1: Initialization in block commutation by using hall sensors \n 
00549 ///////////////////////////////////////////////////////////////////////////////
00550 class InitializationMode : public YouBotJointParameterPasswordProtected {
00551 friend class YouBotJoint;
00552   public:
00553     InitializationMode();
00554 
00555     virtual ~InitializationMode();
00556 
00557     void getParameter(int& parameter) const;
00558 
00559     void setParameter(const int parameter);
00560 
00561     void toString(std::string& value);
00562 
00563 
00564   private:
00565     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00566 
00567     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00568 
00569     std::string getName() const {return this->name;};
00570 
00571     ParameterType getType() const {return this->parameterType;};
00572 
00573     int upperLimit;
00574 
00575     int lowerLimit;
00576 
00577     int value;
00578 
00579     std::string name;
00580 
00581     ParameterType parameterType;
00582 
00583 };
00584 ///////////////////////////////////////////////////////////////////////////////
00585 /// Duration for sine initialization sequence. This parameter should be set in a way, that the motor has stopped mechanical oscillations after the specified time. 
00586 ///////////////////////////////////////////////////////////////////////////////
00587 class InitSineDelay : public YouBotJointParameterPasswordProtected {
00588 friend class YouBotJoint;
00589   public:
00590     InitSineDelay();
00591 
00592     virtual ~InitSineDelay();
00593 
00594     void getParameter(quantity<si::time>& parameter) const;
00595 
00596     void setParameter(const quantity<si::time>& parameter);
00597 
00598     void toString(std::string& value);
00599 
00600 
00601   private:
00602     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00603 
00604     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00605 
00606     std::string getName() const {return this->name;};
00607 
00608     ParameterType getType() const {return this->parameterType;};
00609 
00610     quantity<si::time> upperLimit;
00611 
00612     quantity<si::time> lowerLimit;
00613 
00614     quantity<si::time> value;
00615 
00616     std::string name;
00617 
00618     ParameterType parameterType;
00619 
00620 };
00621 ///////////////////////////////////////////////////////////////////////////////
00622 /// Mass inertia constant for position regulation. Compensates mass moment of inertia of rotor.
00623 ///////////////////////////////////////////////////////////////////////////////
00624 class MassInertiaConstant : public YouBotJointParameterPasswordProtected {
00625 friend class YouBotJoint;
00626   public:
00627     MassInertiaConstant();
00628 
00629     virtual ~MassInertiaConstant();
00630 
00631     void getParameter(int& parameter) const;
00632 
00633     void setParameter(const int parameter);
00634 
00635     void toString(std::string& value);
00636 
00637 
00638   private:
00639     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00640 
00641     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00642 
00643     std::string getName() const {return this->name;};
00644 
00645     ParameterType getType() const {return this->parameterType;};
00646 
00647     int upperLimit;
00648 
00649     int lowerLimit;
00650 
00651     int value;
00652 
00653     std::string name;
00654 
00655     ParameterType parameterType;
00656 
00657 };
00658 ///////////////////////////////////////////////////////////////////////////////
00659 /// maximum allowed current
00660 ///////////////////////////////////////////////////////////////////////////////
00661 class MaximumMotorCurrent : public YouBotJointParameterPasswordProtected {
00662 friend class YouBotJoint;
00663   public:
00664     MaximumMotorCurrent();
00665 
00666     virtual ~MaximumMotorCurrent();
00667 
00668     void getParameter(quantity<current>& parameter) const;
00669 
00670     void setParameter(const quantity<current>& parameter);
00671 
00672     void toString(std::string& value);
00673 
00674 
00675   private:
00676     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00677 
00678     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00679 
00680     std::string getName() const {return this->name;};
00681 
00682     ParameterType getType() const {return this->parameterType;};
00683 
00684     quantity<current> upperLimit;
00685 
00686     quantity<current> lowerLimit;
00687 
00688     quantity<current> value;
00689 
00690     std::string name;
00691 
00692     ParameterType parameterType;
00693 
00694 };
00695 ///////////////////////////////////////////////////////////////////////////////
00696 /// Resistance of motor coil. Used for current resistance regulation, position regulation and velocity regulation.
00697 ///////////////////////////////////////////////////////////////////////////////
00698 class MotorCoilResistance : public YouBotJointParameterPasswordProtected {
00699 friend class YouBotJoint;
00700   public:
00701     MotorCoilResistance();
00702 
00703     virtual ~MotorCoilResistance();
00704 
00705     void getParameter(quantity<resistance>& parameter) const;
00706 
00707     void setParameter(const quantity<resistance>& parameter);
00708 
00709     void toString(std::string& value);
00710 
00711 
00712   private:
00713     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00714 
00715     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00716 
00717     std::string getName() const {return this->name;};
00718 
00719     ParameterType getType() const {return this->parameterType;};
00720 
00721     quantity<resistance> upperLimit;
00722 
00723     quantity<resistance> lowerLimit;
00724 
00725     quantity<resistance> value;
00726 
00727     std::string name;
00728 
00729     ParameterType parameterType;
00730 
00731 };
00732 ///////////////////////////////////////////////////////////////////////////////
00733 /// Set/Get Timeout to determine an interrupted communication with the EtherCAT master. (automatically stored in EEProm)
00734 ///////////////////////////////////////////////////////////////////////////////
00735 class MotorControllerTimeout : public YouBotJointParameterPasswordProtected {
00736 friend class YouBotJoint;
00737   public:
00738     MotorControllerTimeout();
00739 
00740     virtual ~MotorControllerTimeout();
00741 
00742     void getParameter(quantity<si::time>& parameter) const;
00743 
00744     void setParameter(const quantity<si::time>& parameter);
00745 
00746     void toString(std::string& value);
00747 
00748 
00749   private:
00750     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00751 
00752     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00753 
00754     std::string getName() const {return this->name;};
00755 
00756     ParameterType getType() const {return this->parameterType;};
00757 
00758     quantity<si::time> upperLimit;
00759 
00760     quantity<si::time> lowerLimit;
00761 
00762     quantity<si::time> value;
00763 
00764     std::string name;
00765 
00766     ParameterType parameterType;
00767 
00768 };
00769 ///////////////////////////////////////////////////////////////////////////////
00770 /// Number of motor poles.
00771 ///////////////////////////////////////////////////////////////////////////////
00772 class MotorPoles : public YouBotJointParameterPasswordProtected {
00773 friend class YouBotJoint;
00774   public:
00775     MotorPoles();
00776 
00777     virtual ~MotorPoles();
00778 
00779     void getParameter(unsigned int& parameter) const;
00780 
00781     void setParameter(const unsigned int parameter);
00782 
00783     void toString(std::string& value);
00784 
00785 
00786   private:
00787     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00788 
00789     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00790 
00791     std::string getName() const {return this->name;};
00792 
00793     ParameterType getType() const {return this->parameterType;};
00794 
00795     unsigned int upperLimit;
00796 
00797     unsigned int lowerLimit;
00798 
00799     unsigned int value;
00800 
00801     std::string name;
00802 
00803     ParameterType parameterType;
00804 
00805 };
00806 ///////////////////////////////////////////////////////////////////////////////
00807 /// Counts the module operational time.
00808 ///////////////////////////////////////////////////////////////////////////////
00809 class OperationalTime : public YouBotJointParameterPasswordProtected {
00810 friend class YouBotJoint;
00811   public:
00812     OperationalTime();
00813 
00814     virtual ~OperationalTime();
00815 
00816     void getParameter(quantity<si::time>& parameter) const;
00817 
00818     void setParameter(const quantity<si::time>& parameter);
00819 
00820     void toString(std::string& value);
00821 
00822 
00823   private:
00824     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00825 
00826     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00827 
00828     std::string getName() const {return this->name;};
00829 
00830     ParameterType getType() const {return this->parameterType;};
00831 
00832     quantity<si::time> upperLimit;
00833 
00834     quantity<si::time> lowerLimit;
00835 
00836     quantity<si::time> value;
00837 
00838     std::string name;
00839 
00840     ParameterType parameterType;
00841 
00842 };
00843 ///////////////////////////////////////////////////////////////////////////////
00844 /// PID calculation delay: Set operational frequency PID
00845 ///////////////////////////////////////////////////////////////////////////////
00846 class PIDControlTime : public YouBotJointParameterPasswordProtected {
00847 friend class YouBotJoint;
00848   public:
00849     PIDControlTime();
00850 
00851     virtual ~PIDControlTime();
00852 
00853     void getParameter(quantity<si::time>& parameter) const;
00854 
00855     void setParameter(const quantity<si::time>& parameter);
00856 
00857     void toString(std::string& value);
00858 
00859 
00860   private:
00861     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00862 
00863     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00864 
00865     std::string getName() const {return this->name;};
00866 
00867     ParameterType getType() const {return this->parameterType;};
00868 
00869     quantity<si::time> upperLimit;
00870 
00871     quantity<si::time> lowerLimit;
00872 
00873     quantity<si::time> value;
00874 
00875     std::string name;
00876 
00877     ParameterType parameterType;
00878 
00879 };
00880 ///////////////////////////////////////////////////////////////////////////////
00881 /// Encoder direction Set this flag in a way, that turn right increases position counter.
00882 ///////////////////////////////////////////////////////////////////////////////
00883 class ReversingEncoderDirection : public YouBotJointParameterPasswordProtected {
00884 friend class YouBotJoint;
00885   public:
00886     ReversingEncoderDirection();
00887 
00888     virtual ~ReversingEncoderDirection();
00889 
00890     bool getParameter(bool& parameter) const;
00891 
00892     void setParameter(const bool parameter);
00893 
00894     void toString(std::string& value);
00895 
00896 
00897   private:
00898     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00899 
00900     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00901 
00902     std::string getName() const {return this->name;};
00903 
00904     ParameterType getType() const {return this->parameterType;};
00905 
00906     bool value;
00907 
00908     std::string name;
00909 
00910     ParameterType parameterType;
00911 
00912 };
00913 ///////////////////////////////////////////////////////////////////////////////
00914 /// Set Encoder counter to zero at next N channel event.
00915 ///////////////////////////////////////////////////////////////////////////////
00916 class SetEncoderCounterZeroAtNextNChannel : public YouBotJointParameterPasswordProtected {
00917 friend class YouBotJoint;
00918   public:
00919     SetEncoderCounterZeroAtNextNChannel();
00920 
00921     virtual ~SetEncoderCounterZeroAtNextNChannel();
00922 
00923     void getParameter(bool& parameter) const;
00924 
00925     void setParameter(const bool parameter);
00926 
00927     void toString(std::string& value);
00928 
00929 
00930   private:
00931     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00932 
00933     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00934 
00935     std::string getName() const {return this->name;};
00936 
00937     ParameterType getType() const {return this->parameterType;};
00938 
00939     bool value;
00940 
00941     std::string name;
00942 
00943     ParameterType parameterType;
00944 
00945 };
00946 ///////////////////////////////////////////////////////////////////////////////
00947 /// Set encoder counter to zero at next switch event.
00948 ///////////////////////////////////////////////////////////////////////////////
00949 class SetEncoderCounterZeroAtNextSwitch : public YouBotJointParameterPasswordProtected {
00950 friend class YouBotJoint;
00951   public:
00952     SetEncoderCounterZeroAtNextSwitch();
00953 
00954     virtual ~SetEncoderCounterZeroAtNextSwitch();
00955 
00956     void getParameter(bool& parameter) const;
00957 
00958     void setParameter(const bool parameter);
00959 
00960     void toString(std::string& value);
00961 
00962 
00963   private:
00964     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00965 
00966     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00967 
00968     std::string getName() const {return this->name;};
00969 
00970     ParameterType getType() const {return this->parameterType;};
00971 
00972     bool value;
00973 
00974     std::string name;
00975 
00976     ParameterType parameterType;
00977 
00978 };
00979 ///////////////////////////////////////////////////////////////////////////////
00980 /// 1: Set encoder counter zero only once NULL
00981 /// 0: always at an N channel event, respectively switch event.
00982 ///////////////////////////////////////////////////////////////////////////////
00983 class SetEncoderCounterZeroOnlyOnce : public YouBotJointParameterPasswordProtected {
00984 friend class YouBotJoint;
00985   public:
00986     SetEncoderCounterZeroOnlyOnce();
00987 
00988     virtual ~SetEncoderCounterZeroOnlyOnce();
00989 
00990     void getParameter(bool& parameter) const;
00991 
00992     void setParameter(const bool parameter);
00993 
00994     void toString(std::string& value);
00995 
00996 
00997   private:
00998     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
00999 
01000     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
01001 
01002     std::string getName() const {return this->name;};
01003 
01004     ParameterType getType() const {return this->parameterType;};
01005 
01006     bool value;
01007 
01008     std::string name;
01009 
01010     ParameterType parameterType;
01011 
01012 };
01013 ///////////////////////////////////////////////////////////////////////////////
01014 /// Velocity for sine initialization. [rpm]
01015 ///////////////////////////////////////////////////////////////////////////////
01016 class SineInitializationVelocity : public YouBotJointParameterPasswordProtected {
01017 friend class YouBotJoint;
01018   public:
01019     SineInitializationVelocity();
01020 
01021     virtual ~SineInitializationVelocity();
01022 
01023     void getParameter(int& parameter) const;
01024 
01025     void setParameter(const int parameter);
01026 
01027     void toString(std::string& value);
01028 
01029 
01030   private:
01031     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
01032 
01033     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
01034 
01035     std::string getName() const {return this->name;};
01036 
01037     ParameterType getType() const {return this->parameterType;};
01038 
01039     int upperLimit;
01040 
01041     int lowerLimit;
01042 
01043     int value;
01044 
01045     std::string name;
01046 
01047     ParameterType parameterType;
01048 
01049 };
01050 ///////////////////////////////////////////////////////////////////////////////
01051 /// Stop switch polarity.
01052 /// Bit 0: Left stop switch polarity\n
01053 /// Bit set: Left stop switch input is high active \n
01054 /// Bit clear: Left stop switch input is low active\n\n
01055 /// Bit 1: Right stop switch polarity\n
01056 /// Bit set: Right stop switch input is high active\n
01057 /// Bit clear: Right stop switch input is low active
01058 ///////////////////////////////////////////////////////////////////////////////
01059 class StopSwitchPolarity : public YouBotJointParameterPasswordProtected {
01060 friend class YouBotJoint;
01061   public:
01062     StopSwitchPolarity();
01063 
01064     virtual ~StopSwitchPolarity();
01065 
01066     void getParameter(unsigned int& parameter) const;
01067 
01068     void setParameter(const unsigned int parameter);
01069 
01070     void toString(std::string& value);
01071 
01072 
01073   private:
01074     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
01075 
01076     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
01077 
01078     std::string getName() const {return this->name;};
01079 
01080     ParameterType getType() const {return this->parameterType;};
01081 
01082     unsigned int upperLimit;
01083 
01084     unsigned int lowerLimit;
01085 
01086     unsigned int value;
01087 
01088     std::string name;
01089 
01090     ParameterType parameterType;
01091 
01092 };
01093 ///////////////////////////////////////////////////////////////////////////////
01094 /// Thermal winding time constant for the used motor. Used for I2t monitoring.
01095 ///////////////////////////////////////////////////////////////////////////////
01096 class ThermalWindingTimeConstant : public YouBotJointParameterPasswordProtected {
01097 friend class YouBotJoint;
01098   public:
01099     ThermalWindingTimeConstant();
01100 
01101     virtual ~ThermalWindingTimeConstant();
01102 
01103     void getParameter(quantity<si::time>& parameter) const;
01104 
01105     void setParameter(const quantity<si::time>& parameter);
01106 
01107     void toString(std::string& value);
01108 
01109 
01110   private:
01111     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
01112 
01113     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
01114 
01115     std::string getName() const {return this->name;};
01116 
01117     ParameterType getType() const {return this->parameterType;};
01118 
01119     quantity<si::time> upperLimit;
01120 
01121     quantity<si::time> lowerLimit;
01122 
01123     quantity<si::time> value;
01124 
01125     std::string name;
01126 
01127     ParameterType parameterType;
01128 
01129 };
01130 ///////////////////////////////////////////////////////////////////////////////
01131 /// If the actual speed is below this value the motor halted flag will be set. [rpm]
01132 
01133 ///////////////////////////////////////////////////////////////////////////////
01134 class MotorHaltedVelocity : public YouBotJointParameterPasswordProtected {
01135 friend class YouBotJoint;
01136   public:
01137     MotorHaltedVelocity();
01138 
01139     virtual ~MotorHaltedVelocity();
01140 
01141     void getParameter(int& parameter) const;
01142 
01143     void setParameter(const int parameter);
01144 
01145     void toString(std::string& value);
01146 
01147 
01148   private:
01149     void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType, const YouBotJointStorage& storage) const;
01150 
01151     void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
01152 
01153     std::string getName() const {return this->name;};
01154 
01155     ParameterType getType() const {return this->parameterType;};
01156 
01157     int upperLimit;
01158 
01159     int lowerLimit;
01160 
01161     int value;
01162 
01163     std::string name;
01164 
01165     ParameterType parameterType;
01166 
01167 };
01168 
01169 } // namespace youbot
01170 #endif
Generated by  doxygen 1.6.3