-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TrinamicException: Invalid Value but still moving #7
Comments
Response status codes are mapped in accordance with the TMCL docs (http://www.mctechnology.nl/pdf/TMCL_reference_2015.pdf#page=7) . Possible workaroundI assume the purpose of multiple high-speed calls to the
It might be that repeated high-speed attempts to put the module into 'velocity mode' is what is causing the issue (I'm totally guessing here though). You could try calling |
It seems that every second call I get this error. But the strange thing is that the motor reacts as expected. This error actually arises in all functions that I call. (STOP, ROL, ROR, ...) |
I solved this issue. The problem arises when more then one motor is connected. When you send a message at one motor, all the motors are answering. The status byte of the messages of the wrong motors is always 4 ('wrong value'). I modified the bus class so is works fine now. checksum = self._binaryadd(address, command, type, motorbank, value)
msg = struct.pack(MSG_STRUCTURE, address, command, type, motorbank, value, checksum)
self.serial.write(msg)
while True:
rep = self.serial.read(REPLY_LENGTH)
if len(rep) < 9:
raise ValueError('increase the waiting time!!!')
reply = Reply(struct.unpack(REPLY_STRUCTURE, rep))
if reply.status == 100 and reply.module_address != address:
raise ValueError('two messages interfered: only send one message at the time!')
if reply.module_address == address:
break
#print ('Status: ',reply.status, 'Motor: ',reply.module_address,'Command: ',reply.command,'Value: ',reply.value)
time.sleep(0.01)
return self._handle_reply(reply) |
When calling some functions the motor reacts as accepted, but the code trows an error.
For example:
but if I call it again several times I sometimes get:
This seems to be a timing issue.
Thanks for your help.
The text was updated successfully, but these errors were encountered: