Skip to content

TrinamicException: Invalid Value but still moving #7

@nicksauerwein

Description

@nicksauerwein

When calling some functions the motor reacts as accepted, but the code trows an error.

For example:

motor.rotate_right(1600)

but if I call it again several times I sometimes get:

---------------------------------------------------------------------------
TrinamicException                         Traceback (most recent call last)
<ipython-input-38-1ab72c70bd37> in <module>()
----> 1 motor.rotate_right(1700)

~/anaconda3/lib/python3.6/site-packages/TMCL-1.2-py3.6.egg/TMCL/motor.py in rotate_right(self, velocity)
     69 
     70         def rotate_right(self, velocity):
---> 71                 reply = self.send(Command.ROR, 0, self.motor_id, velocity)
     72                 return reply.status
     73 

~/anaconda3/lib/python3.6/site-packages/TMCL-1.2-py3.6.egg/TMCL/motor.py in send(self, cmd, type, motorbank, value)
     51 
     52         def send( self, cmd, type, motorbank, value ):
---> 53                 return self.bus.send(self.module_id, cmd, type, motorbank, value)
     54 
     55         def stop( self ):

~/anaconda3/lib/python3.6/site-packages/TMCL-1.2-py3.6.egg/TMCL/bus.py in send(self, address, command, type, motorbank, value)
     54                         rep = self.serial.read(REPLY_LENGTH)
     55                         reply = Reply(struct.unpack(REPLY_STRUCTURE, rep))
---> 56                         return self._handle_reply(reply)
     57 
     58         def get_module( self, address=1 ):

~/anaconda3/lib/python3.6/site-packages/TMCL-1.2-py3.6.egg/TMCL/bus.py in _handle_reply(self, reply)
     92         def _handle_reply (self, reply):
     93                 if reply.status < Reply.Status.SUCCESS:
---> 94                         raise TrinamicException(reply)
     95                 return reply
     96 

TrinamicException: Invalid Value

This seems to be a timing issue.

Thanks for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions