Ooops, I wanted to edit my last post a bit, but ran out of time. So, here it is again with a few changes added.
John,
I'm baffled too. (In the following, though it looks weird, I've put every question I have for you in bold and on a separate line so that they can stand out.)
Thanks for posting the output of the simulator.
Was that with the controller connected? My guess is yes as that's the only hardware that can read the pulse input, but please confirm.
YESEverything zero is what you should get if the joystick is centered, or if there's no pulse input at all (Roboteq assigns zero values for pulse input if there is no device). In other words, it's acting as though the pulse input device is turned off. Which would make some sense if serial is getting in from somewhere and taking over input priority.
Was this simulator result with mute checked?
WHEN SCRIPT RUNS, MUTE DOESENT MAKE MUCH DIFFERENCE. TRIED IT BOTH WAYS. SEE THE VIDEO. Does one have to do something special in Roborun to enable the pulse joystick and tell the controller which pulse interpretation to use (I gather that there's more than one)?
NO. IT ASIGNS A PRIORITY, IN ANY ORDER YOU CHOOSE. IF I ONLY ENABLE PULSE, DISABLE ALL THE REST, IT STILL GOES TO SERIAL WHEN I RUN THE SCRIPT ON THE CONTROLLER...To trouble shoot further, I suggest that you run the script as a "pure" simulation, no controller and no joystick, getting input just from the keyboard to see if the script itself generates correct values. Put in say 300 and 300 when it asks for CIP,1 and CIP,2 (the little fill in window will have the long-form names), and 0 and 0 when it asks for AIC (the analog inputs for compensation).
DONT UNDERSTAND THIS. BUT WITH NO CONTROLLER YOU CANT REALLY RUN THE SCRIPT. IT ONLY RUNS ON THE CONTROLLER. IF YOU CHOOSE SIMULATE, INSTEAD, YOU GET A SCREEN OF STUFF I DO NOT UNDERSTAND. BUT THAT WILL WORK FOR YOU AS WELL?What numbers to you get for scaled speed and scaled turn?
You should get:
THROTTLE/STEER scaled speed = 270
THROTTLE/STEER scaled turn = 180
compensated THROTTLE = 270 compensated STEER = 180
DID YOU WATCH THE SCREEN CAPTURE MOVIE?If you don't get this even with no controller and no joystick connected, in "pure" simulation, there's something wrong with your MicroBasic compiler (that would also explain why it once said that some short-forum Roboteq variable wasn't recognized although you haven't seemed to have any further problem with that.) If so, you might want to try a fresh download and fresh install of the Roborun software.
DID THAT. AND ALSO AN UPDATED VERSION THAT GOES WITH THE UPDATED FIRMWARE.I don't think that Woody's suggestion to turn off Motor Compensation can make any difference. Compensating 0, with 0 amps, just gives no change. There's only one subroutine that actually reads the inputs - that's SetCommands (not a good name, probably should be something like SetScriptJoysticVariables) which reads _CIx, 1 and _CIx, 2 into script variables that will then get "massaged" by the other subroutines. (CIx is always CIP because you've forced vMode=1.) Those "massaged" values are eventually sent to the motors. There is NO part of the script that sends anything to ANY inputs.
You can see the CIP,1 and CIP,2 values before any algebra's been done if you add the following just below the GoSub SetCommands line:
PRINT ("Channel 1 input = " , vC1 , " Channel 2 input = " , vC2 , "\n")
These values should be 300 and 300 in pure simulation with keyboard input. If they are 300, 300 without the controller, BUT you get 0 and 0 when the controller is connected, the controller is NOT seeing the pulse source.
If you get the above values with pure simulation and input values of 300 and 300, then the script is running correctly and something about your setup is keeping the Roboteq from seeing the pulse input when the script is running. My suspicion, once again, is that the PC script engine (not the particular script) is trading information with the controller via serial and that it is this that is interfering, but I suppose there could be some "typo" in your configuration that makes pulse not get to the Roboteq even when there's a signal.
I DIDNT UNDERSTAND ANY OF THAT!
Another trouble shooting thing you could try is to just connect a pair of pots (or an analog joystick) as analog joystick input and force vMode = 3. If it responds OK to this, it would confirm that there is interference with the Pulse input. The script does not send anything at all to the pulse input, or any other input for that matter, so the problem's not in the script per se, but in some kind of interference with pulse input when the script is running.
Tested Analog input on, and pulse off, still goes to serial when script is run.When you tested the earlier (not mine) script that you were working on and got it to work, was that with pulse or analog input?
PULSE. I DO NOT HAVE ANYTHING CONNECTED VIA ANALOG. THAT WAS THE ROBOTEQ GUY COSMAS SCRIPT. IT WORKED FINE, AND SWITCHED TO PULSE INPUT SMOOTHLY WHEN THE MUTE WAS TICKED AS IT SHOULD. And it still does, I tried it.Lastly, another troubleshooting idea to track down the source of serial interference, but for this you'll have to connect something to the motor outputs. Either motors, or a couple volt meters. Get everything communicating with pulse input without the script; the motor outputs should track your pulse input. Run the script. I expect that all goes to pot at this point and that the outputs just stay at 0 because 0 speed + 0 steer means 0 output to both motors. NOW UNPLUG THE USB LEAD.
Do the outputs start tracking the pulse input?
If they do, the interference is coming from the PC. If they still don't track, the interference is within the controller and coming from the script. If the former, I guess you'll have to contact Roboteq to ask if there's any way to keep the PC connected while running a script that reads Pulse input. If the latter, I'd do a fresh install of Roborun, re-Build the script and download the rebuilt one to the controller and try again. If still no joy, I would ask Roboteq to try the script --- is it a bug in the script, a bug in the Roboteq or a bug in Roborun? If the script works with an analog joystick (and vMode=3), but not with a pulse joystick (and vMode=1), the problem's NOT the script, but somewhere in Roboteq (software, firmware or hardware).
Ciao,
Lenny
P.S. All Woody wanted you to do was add the one single quote mark in front of the GoSub MotorCompensationThrStr line.
P.P.S. In your VID was it still muted when you ran the script?
BOTH, I MUTED AND UNMUTED WHILE SCRIPT WAS RUNNING. IN BOTH CASES IT STAYED ON SERIAL, AND THE TRANSMITTER WAS IGNORED, AND THE SERIAL CONTROL DATA WAS INTERMITTENT AND THE GRAPH WAS SLOW AND JERKY. SOMETHING IN THE SCRIPT MAKES IT STAY ON SERIAL, WILL NOT ALLOW IT TO SWITCH TO PULSE, AND SLOWS DOWN THE GRAPHING MARKEDLY.