Пример #1
0
    def get_setvelocity(self, parameter = 'velocity'):
        '''
        reads the velocity that is currently set and returns it in rpm
        '''

        values = self.read(self.address, self.PARAMETER[parameter])

        pulses = translations.hextodec(values)
        rpm = constants.READ_SRPM/constants.RSPPS*pulses
        rpm = translations.rounding(rpm)
        if self.verbose: print 'The velocity is set at ' + str(rpm) + ' rpm'

        return rpm
Пример #2
0
    def get_setvelocity(self, parameter='velocity'):
        '''
        reads the velocity that is currently set and returns it in rpm
        '''

        values = self.read(self.address, self.PARAMETER[parameter])

        pulses = translations.hextodec(values)
        rpm = constants.READ_SRPM / constants.RSPPS * pulses
        rpm = translations.rounding(rpm)
        if self.verbose: print 'The velocity is set at ' + str(rpm) + ' rpm'

        return rpm
Пример #3
0
    def get_acceleration(self, parameter = 'acceleration'):
        '''
        Reads acceleration and returns the value in rpm/s
        '''

        values = self.read(self.address, self.PARAMETER[parameter])


        pulses = translations.hextodec(values)
        acc = constants.READ_ACC/constants.READ_PPSS*pulses
        acc = translations.rounding(acc)

        if self.verbose: print 'The acceleration is set at ' + str(acc) + ' rpm/s'

        return acc
Пример #4
0
    def get_acceleration(self, parameter='acceleration'):
        '''
        Reads acceleration and returns the value in rpm/s
        '''

        values = self.read(self.address, self.PARAMETER[parameter])

        pulses = translations.hextodec(values)
        acc = constants.READ_ACC / constants.READ_PPSS * pulses
        acc = translations.rounding(acc)

        if self.verbose:
            print 'The acceleration is set at ' + str(acc) + ' rpm/s'

        return acc
Пример #5
0
    def get_actualvelocity(self, parameter = 'actualvelocity'):
        '''
        reads the actual velocity that the motor is running and returns it in rpm, will return 0 if mode is set to 0
        '''

        values = self.read(self.address, self.PARAMETER[parameter])

        pulses = translations.hextodec(values)
        rpm = constants.READ_ARPM/constants.RAPPS*pulses

        rpm = translations.rounding(rpm)

        if self.verbose:
            if rpm == 0:
                print 'The motor is running at ' + str(rpm) + ' rpm, make sure the motor is on'

            else:
                print 'The motor is running at ' + str(rpm) + ' rpm'

        return rpm
Пример #6
0
    def get_actualvelocity(self, parameter='actualvelocity'):
        '''
        reads the actual velocity that the motor is running and returns it in rpm, will return 0 if mode is set to 0
        '''

        values = self.read(self.address, self.PARAMETER[parameter])

        pulses = translations.hextodec(values)
        rpm = constants.READ_ARPM / constants.RAPPS * pulses

        rpm = translations.rounding(rpm)

        if self.verbose:
            if rpm == 0:
                print 'The motor is running at ' + str(
                    rpm) + ' rpm, make sure the motor is on'

            else:
                print 'The motor is running at ' + str(rpm) + ' rpm'

        return rpm