Asked
— Edited
Can you show me some examples in Javascript of how to Setashome for V21? Can you also show me some examples in Javascript of how to Calibrate V22?
Related Hardware EZ-B v4
Related Controls
Stepper Servo
Inverse Kinematic Arm
Yes but for some reason it is not receiving it in the Arduino as the debug led never turned on when I had it under cmd==0. Wonder why it is not accepting it.
Is the Arduino connected to the PC via USB?
are there multiple arduinos chained together?
are you sending the SetAsHome command while it is calibrating? You cannot send a command while another command is executing. The arduino does not have a significant input buffer on the RX for UART. That means it might get lost if it's doing something and you send a command.
In the Arduino, the data arriving in the UART from USB sits in a small buffer until it is read by the code (Serial.ReadByte). I'm not sure about the size of the input buffer on an Arduino, but I know it's tiny. In fact, it might only be 1 or 2 bytes. So there's a chance the SetAtHome command is lost if you send it while it's doing something else, such as calibrating.
Yes the Arduino is connected to the PC via USB. For testing purposes have only 2 connected- a master and a slave. They work as expected going to positions. No I am not sending SetAsHome while calibrating. I am going to a position 10000 ariving then SetAsHome it mentions Done then checking it by putting position 1 and it moves 10000 steps which means int never Homed. I then ping both V1 and V8 individually and it returns 20230223 which is fine. I then put in position 10000, send script to calibrate, it mentions Done, then I send position 1 and it moves 10000 steps which means it never calibarated. If I ping it and it works doesn't that mean the cmd variable is not overloaded or lost?
From your description and the size of the buffer that Dave provided, I don't think it's exceeding the buffer. So, my last thought is void.
I can't understand how the CMD == 0 condition isn't being hit. I will have to load our setup later today and see if there's any way I can reproduce this - maybe it'll give me thoughts on how it can happen to you.
Yes it's very strange, have been poking around the code for possibilities. How can I buy your drinks tonight? It's all appreciated. Here are a few things that I saw which are probably off base but it may trigger a side thought. In the photo -if stepper current pos = the target position then void calibrate.Well current position already is where I told it to go (target position). In another area it states stepper1.setcurrentposition(0) but you already said that was off base but it looks like you are setting it to 0. Another possible clue is that it states that it is Done very quickly .02 seconds which means the code went somewhere and completed but did not give me proper results. Maybe something in here will help.
Oh geez, this is so simple. I just wasted 4 hours on this because I didn't notice your command vs the manual haha...
Here's the manual...
The manual states the "ID," not the servo port. So you would pass an 8, not a V8. That being said, I think it makes more sense to use the servo port than the ID.
We have been using the ID in our tests because that's what the manual states. We didn't notice you have been using the servo port.
The robot skill should be changed to use the servo port to avoid future confusion. Until it is changed, use this...
Version 21 of the robot skill has been updated to accept the virtual servo port and NOT the id: synthiam.com/Support/Skills/Servo/Stepper-Servo?id=21134