Topics

WiThrottle MultiThrottle V settings

david zuhn
 

I'm working with the WiThrottle protocol (with recent releases, including 4.14) and have seen some anomalies, and I'll be asking a few questions over the next little while.

Today's question:  using the MultiThrottle M command, I'm seeing initial speed reports back from JMRI with a value of -126.    Does this value have special meaning?   The protocol documentation suggests that this value should range from 0 through 126 only.   

2018-12-27 19:52:53,305 withrottle.DeviceServer               DEBUG - Sent: MTAS23<;>F026         to  mini clipboard/192.168.22.24:58988 [DeviceServer-2]
2018-12-27 19:52:53,307 withrottle.DeviceServer               DEBUG - Sent: MTAS23<;>F027         to  mini clipboard/192.168.22.24:58988 [DeviceServer-2]
2018-12-27 19:52:53,307 withrottle.DeviceServer               DEBUG - Sent: MTAS23<;>F028         to  mini clipboard/192.168.22.24:58988 [DeviceServer-2]
2018-12-27 19:52:53,308 withrottle.DeviceServer               DEBUG - Sent: MTAS23<;>V-126        to  mini clipboard/192.168.22.24:58988 [DeviceServer-2]
2018-12-27 19:52:53,309 withrottle.DeviceServer               DEBUG - Sent: MTAS23<;>R0           to  mini clipboard/192.168.22.24:58988 [DeviceServer-2]

The JMRI throttle window shows the slider all the way down at "Stop" , and I expected a value of 0 (zero) here.

I don't see anything in the code that leads me to believe that -126 is special.   If there is a meaning, I'll be happy to update the protocol documentation to suit.


david zuhn



--
The State Belt Railway of California
zoo @ statebeltrailway.org

Steve Todd
 

David,
That value is always sent to WiThrottle for addresses that have been "eStopped", not sure if that value shows up elsewhere in JMRI. AbstractThrottle says "Negative means emergency stop".
You can create that situation by sending an eStop ('X') command from a WiThrottle client. Or by losing contact and having JMRI send the eStop. Or by pressing Stop! on a JMRI throttle.

It is created by this math, at several places:
               Math.round(currentSpeed / speedMultiplier)
when currentSpeed is -1 (special value for eStop). speedMultiplier is always 1/126

When displaying the value, EngineDriver bumps any negative up to 0.

--SteveT


--SteveT


On Thu, Dec 27, 2018 at 3:20 PM david zuhn <zoo@...> wrote:
I'm working with the WiThrottle protocol (with recent releases, including 4.14) and have seen some anomalies, and I'll be asking a few questions over the next little while.

Today's question:  using the MultiThrottle M command, I'm seeing initial speed reports back from JMRI with a value of -126.    Does this value have special meaning?   The protocol documentation suggests that this value should range from 0 through 126 only.   

2018-12-27 19:52:53,305 withrottle.DeviceServer               DEBUG - Sent: MTAS23<;>F026         to  mini clipboard/192.168.22.24:58988 [DeviceServer-2]
2018-12-27 19:52:53,307 withrottle.DeviceServer               DEBUG - Sent: MTAS23<;>F027         to  mini clipboard/192.168.22.24:58988 [DeviceServer-2]
2018-12-27 19:52:53,307 withrottle.DeviceServer               DEBUG - Sent: MTAS23<;>F028         to  mini clipboard/192.168.22.24:58988 [DeviceServer-2]
2018-12-27 19:52:53,308 withrottle.DeviceServer               DEBUG - Sent: MTAS23<;>V-126        to  mini clipboard/192.168.22.24:58988 [DeviceServer-2]
2018-12-27 19:52:53,309 withrottle.DeviceServer               DEBUG - Sent: MTAS23<;>R0           to  mini clipboard/192.168.22.24:58988 [DeviceServer-2]

The JMRI throttle window shows the slider all the way down at "Stop" , and I expected a value of 0 (zero) here.

I don't see anything in the code that leads me to believe that -126 is special.   If there is a meaning, I'll be happy to update the protocol documentation to suit.


david zuhn



--
The State Belt Railway of California
zoo @ statebeltrailway.org

Paul Bender
 

On Dec 27, 2018, at 3:20 PM, david zuhn <@zoo> wrote:
Today's question: using the MultiThrottle M command, I'm seeing initial speed reports back from JMRI with a value of -126. Does this value have special meaning? The protocol documentation suggests that this value should range from 0 through 126 only.
I know where that is coming from. Negative speed values represent emergency stop, and the property change listener for WiThrottle is just converting the speed percentage to speed steps without looking at the sign. This property change listener should be receiving the initial speed from the throttle.

From what I can tell, this behavior is identical to what happens if the WiThrottle device asks for the current speed and the speed is set to -1.0.

Paul

david zuhn
 

Thanks Paul & Steve,
  A pull request is now open for updating the docs with this information.   https://github.com/JMRI/JMRI/pull/6367


--
The State Belt Railway of California
zoo @ statebeltrailway.org

RadSolution
 

I’m sure more knowledgeable MERGists will correct me if I’m wrong, but IIRC MERG CBUS sends a value of 1 for eSTOP - this is the same as the DCC protocol requires, so needs no conversion.... (0 is ‘normal’ stop viz. decelerate gracefully to a halt).

Compliments of The Season to one and all.

Dave R M3666

Steve Todd
 

On Fri, Dec 28, 2018 at 03:15 AM, RadSolution wrote:
I’m sure more knowledgeable MERGists will correct me if I’m wrong, but IIRC MERG CBUS sends a value of 1 for eSTOP - this is the same as the DCC protocol requires, so needs no conversion.... (0 is ‘normal’ stop viz. decelerate gracefully to a halt).
The -126 is only sent between the WiThrottle server and its clients. Any communication between JMRI and the various command stations are separate and different.

--SteveT

steve young
 

Hi Dave,
Seasons greeting to all.

The conversion from an incoming CBUS speed decimal 1 to JMRI internal estop speed float -1 is handled in floatSpeed(), 
https://github.com/JMRI/JMRI/blob/master/java/src/jmri/jmrix/can/cbus/CbusThrottle.java line 159

For JMRI sending an e-stop over CBUS, see stopAll() within
https://github.com/JMRI/JMRI/blob/master/java/src/jmri/jmrix/can/cbus/CbusThrottleManager.java line 88

This actually sets the JMRI throttle speed to JMRI internal speed 0F, though should probably be -1.f to properly reflect the e-stop state?
This hasn't caused an issue AFAIK, however may well change to -1.f for JMRI consistency after I've tested.

Have also been meaning to add sending the CBUS e-stop OPC to within stopAll() so that clicking Stop-All in JMRI will notify ALL throttles,
not just JMRI-managed, however no-one seems to have reported this as an issue yet!

Also checked that a single JMRI throttle sends CBUS speed as 1, ( whichever direction ) after a click on STOP! , working fine,

Steve