Faulhaber Serial Com Test  Version 1
A Qt interface to test Faulhaber MCBL 3006 motion controller
Public Slots | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
FaulhaberSerialComTestWidget Class Reference

Graphical interface for controlling Faulhaber MCBL 3006 Motion Controllers. More...

#include "FaulhaberSerialComTestWidget.h"

Inheritance diagram for FaulhaberSerialComTestWidget:

Public Slots

void sendCommand ()
 Send a command to a controller. More...
 
void checkParameters ()
 Check the controllers parameters. More...
 
void stopRobot ()
 Stop all the motors. More...
 

Public Member Functions

 FaulhaberSerialComTestWidget (QWidget *parent=NULL)
 Constructor. More...
 
virtual ~FaulhaberSerialComTestWidget ()
 

Protected Member Functions

bool sendRequest (QString pCommand)
 Send a command to a controller. More...
 
bool receiveRequest (int &pData)
 Read the COM port. More...
 
bool queryController (QString pQuery, int &pData)
 Send a command and get the answer. More...
 
int check (int motor, QString param, int expectedValue)
 Check the value of a parameter. More...
 

Private Attributes

Ui::FaulhaberSerialComTestWidget ui
 Graphical user interface. More...
 
QSharedPointer< FaulhaberSerialmCOMPort
 Serial COM port. More...
 
QSharedPointer< ErrorHandlermErrorHandler
 Error handler. More...
 

Detailed Description


This class creates a graphical interface to communicate with Faulhaber MCBL 3006 Motion Controllers. It is based on QWidget provided in Qt5. It provides simple methods for sending commands to Faulhaber motors. It allows to control a set of n motors through a unique serial COM port.

Constructor & Destructor Documentation

FaulhaberSerialComTestWidget::FaulhaberSerialComTestWidget ( QWidget *  parent = NULL)

Creates the graphical interface and open the COM port.

See also
mErrorHandler, mCOMPort, FaulhaberSerial::attachErrorHandler, FaulhaberSerial::initialize, FaulhaberSerial::open
FaulhaberSerialComTestWidget::~FaulhaberSerialComTestWidget ( )
virtual

Member Function Documentation

int FaulhaberSerialComTestWidget::check ( int  motor,
QString  param,
int  expectedValue 
)
protected

Verifies if the value saved in a controller for a given parameter corresponds to the expected value.

Parameters
[in]motorNode number of the motor.
[in]paramParameter to check.
[in]expectedValueExpected value of the parameter.
Returns
0 if the parameter is equal to the expected value, 1 otherwise.
void FaulhaberSerialComTestWidget::checkParameters ( )
slot

Check if the parameters saved in the controllers match with a set of predefined parameters. The following motor parameters are checked :

  • the mode (MOD),
  • the home speed (HOSP),
  • the speed constant (KN),
  • the resistance (RM),
  • the velocity proportional term (POR),
  • the velocity integral term (I),
  • the position proportional term (PP),
  • the position derivative term (PD),
  • the peak current limit (LPC),
  • the continuous current limit (LCC),
  • the motor acceleration (AC),
  • the motor deceleration (DEC),
  • the current integral term (CI),
  • the homing configuration (HOC),
  • the answer mode configuration (ANSW).
    Note
    The set of predefined parameters is currently hardcoded.
    See also
    check
bool FaulhaberSerialComTestWidget::queryController ( QString  pQuery,
int &  pData 
)
protected

Send a command to a controller and wait for its reply.

Parameters
[in]pQueryCommand to send.
[out]pDataData received from the controller.
See also
sendRequest, receiveRequest
bool FaulhaberSerialComTestWidget::receiveRequest ( int &  pData)
protected

Read the COM port to get data comming from a controller.

Parameters
[out]pDataData received from the controller.
See also
FaulhaberSerial::receivePacket
void FaulhaberSerialComTestWidget::sendCommand ( )
slot

Sends the command written in the interface to the controller and wait for a reply. When received, the reply is displayed in the interface.

See also
queryController
bool FaulhaberSerialComTestWidget::sendRequest ( QString  pCommand)
protected

Check the command syntax and send it the a controller through the COM port.

Parameters
[in]pCommandCommand to send to the controller.
See also
QRegExp::exactMatch, FaulhaberSerial::send
void FaulhaberSerialComTestWidget::stopRobot ( )
slot

Stop all the motors by sending a "nV0" command to each controller (with n the number of the motor).

See also
sendRequest

Member Data Documentation

QSharedPointer<FaulhaberSerial> FaulhaberSerialComTestWidget::mCOMPort
private
QSharedPointer<ErrorHandler> FaulhaberSerialComTestWidget::mErrorHandler
private
Ui::FaulhaberSerialComTestWidget FaulhaberSerialComTestWidget::ui
private

The documentation for this class was generated from the following files: