Hi John,
Back from the dentist visit. Given that this involved about 2 hours each way to get there, and some waiting as well, I had lots of time to think about what's going on (or not going on) and to look at some of the Roboteq files and documentation.
I think that before we go any further, you have to make sure that the Roboteq software in your Roboteq and your PCs is working properly. There have just been too many, and increasingly troublesome, glitches.
First, we discovered that SetCommand (_ACCEL) and SetCommand (_DECEL) weren't doing anything, and the confused and partial messages on the Roboteq forum suggest that it's not just "broken" in your software (more about this below).
So, we substitute these with the nearly equivalent SetConfig (_MAC) and SetConfig (_MDEC) and find that these DO send acceleration and deceleration values to the controller, but then we find that the converse commands GetConfig(_MAC) and GetConfig(_MDEC) aren't reading acceleration and deceleration values from the controller (or are reading values that are far, far too low).
So I fixed the base acceleration and deceleration values at 300 instead of reading them from the controller, and we discover that when we sent them back to the controller with SetConfig (_MAC) and SetConfig (_MDEC) it acts as though they are 3 instead of 300.
Now, you can no longer download a new script without turning off the controller, and you can't upload a fresh copy of the firmware. (BTW, the USB upload firmware program DfuLoader.exe is part of the Roborun+ software, so the fact that your computer can't access it may suggest that the Roborun+ software has been corrupted - though it mystifies me that this happened on two computers (unless both were bollixed by a Windows update or a virus). Another possibility is that the controller's EEPROM has been corrupted - you might be able to clean that up by using the Reset Defaults button in the Roborun Configuration tab and then re-entering your configuration information - probably best to do that by hand rather than by loading a profile from disc.)
In any case, I think we need to know that the controller and Roboteq software are working at 100% before trying to fix what ails the script. If you can freshly install Roborun+ and freshly download the controller firmware, and find that the controller works properly without any script, I can then create some very simple scripts just to test _ACCEL, _MAC and so on and find out what values they are sending and receiving from the controller.
I have also decided to not write something to the Roboteq forum at this point, because thinking about the threads on this already there, I realized that there were either no answers or wrong answers coming from Griffin Baker (the Roboteq person who seems to handle forum queries). In particular, his advice to use SetConfig (_ACCEL) instead of SetCommand (_ACCEL) is just plain wrong, yet when the OP questioned this he didn't get any response. I know that it is wrong because I checked the Constants.h file in the Roboteq software where these things are defined. _ACCEL and _DECEL are defined (in the SetCommand section of the file) as:
- Code: Select all
#define _ACCEL 7
#define _DECEL 8
What this means is that every time the compiler sees the word "_ACCEL" in a script, it just puts in the number 7. So the "real", but not-human-readable, function call is SetCommand (7). Now if your script has:
- Code: Select all
SetConfig (_ACCEL)
this will be replaced with SetConfig (7,), but SetConfig (7) and SetConfig (8) already have meanings defined in constants.h and they have nothing to do with acceleration and deceleration:
- Code: Select all
(in the Get/SetConfig section of Constants.h)
#define _CPRI 7 = the command priorities setting
#define _RWD 8 = the serial watchdog setting
I think that we are going to have to figure out what's not working and then talk with Cosma Pabouctsidis, but before we can do that we need to know that your copies of their software, in the controller and in the PC, are OK.
Ciao,
Lenny
BTW: I realized that we can actually use PRINT lines where the script does GetConfig(_MAC) and GetConfig(_MDEC) -- that's just in initial setup, before the loop, so there's no sending of serial while the motors are running. We will be able to add a few lines there to see what we get from the controller with these and what arrives in the controller after we do SetConfig(_MAC) and SetConfig(_MDEC).