Script and serial watchdog
In the Serial mode, the mode is considered as active if commands (starting with “!”)
arrive within the watchdog timeout period via the RS232 or USB ports. The mode will
be considered inactive, and the next lower priority level will be selected as soon as the
watchdog timer expires.
Script commands are also subject to the serial Watchdog timer and share the same
priority level as Serial commands. Use the “Command Priorities” configuration to
set the priority of commands issued from the script vs commands received from the
Pulse Inputs or Analog Inputs.
However:
implies that only Motor or Digital Output commands reset the watchdog.Script Command Priorities
When sending a Motor or Digital Output command from the script, it will be interpreted
by the controller the same way as a serial command (RS232 or USB). This means that the
RS232 watchdog timer will trigger in if no commands are sent from the script within the watchdog timeout.
Which is it - all SetCommand or only some of them? And, does Motor command mean only commands that Roborun, for example, would graph as MotorCommand (e.g. _G) or also commands such as SetCommand (_DECEL,cc,var)?
Please Log in or Create an account to join the conversation.
- Gabriel_Isko
For now, the behavior seems to be, as far as I can test, that unless you command a new motor command, position, or a digital output change, the watchdog timer will continue counting down. I will be sure to bring up the watchdog timer at our next engineering meeting however. If there is a clear methodology to which commands do and do not reset the watchdog timer I will let you know, and have our documentation changed.
Please Log in or Create an account to join the conversation.
- Gabriel_Isko
Please Log in or Create an account to join the conversation.
This person is testing the current analog version of my script for wheelchair control with an FBL series controller. The problem he's run into is this. If the joystick is moving, behavior seems to be correct, but if it's held in a fixed position at 1000 he gets a sawtooth (Roborun+) Motor Command oscillation from 0 to 1000 and back to 0 with a period of about 7-800 msec. Another user, who has an HDC controller, has not run into this.
The script sends _G only IF the joystick output changes, whether because the stick is moved or because of noise, and I wondered if lack of this motor command was causing the watchdog (set at 500 msec) to trigger. Given the lack of a definitive answer to my question, I will have him test this hypothesis by increasing the watchdog time, and if it is a watchdog problem I will have the script get the watchdog configuration from the controller and send an otherwise-unneeded _G at a somewhat shorter interval, doing it this way so that different users don't have set a particular watchdog time in the profile.
BTW, I think having the watchdog reset only with motor-affecting script commands is actually a good way to do things. It's aberrations in motor behavior from which we want protection. Loss of information for other functions is less likely to affect safety. Even more important from a user's standpoint would be clarity in the manual.
Could it be that there's been an "oscillation" in your engineers' thinking between the firmware for different controllers as well as from one firmware version to another?
Please Log in or Create an account to join the conversation.
- Gabriel_Isko
One workaround I would recommend if you want to enforce the watchdog is to use a User Variable as a Comm status value, and then continually update it. This creates an impromptu heatbeat that should continually reset the watchdog timer in 1.8. The only downside to this approach is that it shouldn't work in 2.0 when we release it. I will ask at an engineering meeting to add some sort of dedicated heartbeat command in 2.0. We will also update our documentation to specify whether the command does or does not reset the watchdog timer.
Here is an example snippet that displays what I am talking about:
setcommand(_G, 1, 300)
top:
setcommand(_var, 1, 0) 'send heartbeat
wait(50)
goto top
Please Log in or Create an account to join the conversation.
'before MainLoop ...
...
Watchdog = GetConfig (_RWD)
DIM CommandInterval AS Integer
CommandInterval = Watchdog/8
...
MainLoop:
LoopCycles = LoopCycles + 1
...
IF (Throttle <> lastThrottle) OR (LoopCycles MOD CommandInterval)=0 THEN
SetCommand (_G, 1, Throttle)
lastThrottle = Throttle
END IF
IF (Steering <> lastSteering) OR (LoopCycles MOD CommandInterval)=0 THEN
SetCommand (_G, 2, Steering)
lastSteering = Steering
END IF
...
GoTo MainLoop
Please Log in or Create an account to join the conversation.
- Gabriel_Isko
You can also always disable the serial watchdog by setting it to 0.
Please Log in or Create an account to join the conversation.
- Gabriel_Isko
You can also always disable the serial watchdog by setting it to 0.
Please Log in or Create an account to join the conversation.