3

As a computer science with limited Electrical Engineering Knowledge, I wonder what the VLT L and VLT S modes (and the Current counterparts) in the TechnicMediumHub (Control+ Hub) Voltage device are?

I am in process of writing a .NET library for PoweredUp where I want to present a human readable interpretation of it.

Below the dump of the Port(Mode)Information messages.

Port: 60
    IOTypeId: Voltage
    HardwareRevision: 1.0.0.0
    SoftwareRevision: 1.0.0.0
    OutputCapability: True
    InputCapability: False
    LogicalCombinableCapability: True
    LogicalSynchronizableCapability: False
    ModeCombinations: []
    UsedCombinationIndex: 0
    MultiUpdateEnabled: False
    ConfiguredModeDataSetIndex: []
    Mode: 0
      Name: VLT L
      IsInput: True
      IsOutput: False
      RawMin: 0
      RawMax: 4095
      PctMin: 0
      PctMax: 100
      SIMin: 0
      SIMax: 9615
      Symbol: mV
      InputSupportsNull: False
      InputSupportFunctionalMapping20: False
      InputAbsolute: True
      InputRelative: False
      InputDiscrete: False
      OutputSupportsNull: False
      OutputSupportFunctionalMapping20: False
      OutputAbsolute: False
      OutputRelative: False
      OutputDiscrete: False
      NumberOfDatasets: 1
      DatasetType: Int16
      TotalFigures: 4
      Decimals: 0
      DeltaInterval: 0
      NotificationEnabled: False
    Mode: 1
      Name: VLT S
      IsInput: True
      IsOutput: False
      RawMin: 0
      RawMax: 4095
      PctMin: 0
      PctMax: 100
      SIMin: 0
      SIMax: 9615
      Symbol: mV
      InputSupportsNull: False
      InputSupportFunctionalMapping20: False
      InputAbsolute: True
      InputRelative: False
      InputDiscrete: False
      OutputSupportsNull: False
      OutputSupportFunctionalMapping20: False
      OutputAbsolute: False
      OutputRelative: False
      OutputDiscrete: False
      NumberOfDatasets: 1
      DatasetType: Int16
      TotalFigures: 4
      Decimals: 0
      DeltaInterval: 0
      NotificationEnabled: False
2

L and S very probably refer to load and supply voltage. See https://en.wikipedia.org/wiki/Electrical_load for details.

Experimentally, I have not observed any significant differences between these values in use (possibly because the source resistance is small).

| improve this answer | |
  • I think you could be right with that... But I cannot set the answer yet to correct. Since it is speculation I guess. – Thomas Jul 14 at 13:06
  • There are LowVoltage = 0x01, HighCurrent = 0x02, and OverPowerCondition = 0x04 hub alerts. I could imagine there is a direct relation between these exposed alerts and the voltage / current modes. – Thomas Jul 14 at 13:09
1

There doesn't appear to be an obvious difference between these two according to a comment in the bricknil source:

Voltage Sensor

Returns the raw mV value (0-3893) which probably needs to be scaled to 0-9600.

It contains two capabilities, although they both appear to do the same thing:

  • sense_l
  • sense_s

They appear to both return the same results in the same way.

There are some low-level ways that these could be different, but I'm not aware of efforts to reverse engineer the firmware and/or boards to that degree, and I'm not aware of documentation that covers this. The official LEGO BLE docs don't go into this level of detail about the voltage sensor.

Here are a couple speculative possibilities:

  • It is common for analog to digital converters to have different modes of operation that trade off speed and accuracy. VLT L and VLT S could make use of different sampling modes and/or averaging. For example, ST discusses using averaging to improve their ADC accuracy here for the ST32 chips used in Powered Up parts.
  • L and S could represent values at different stages in the power subsystem (e.g. regulated voltage vs battery voltage).
  • These could be reserved for use in devices with multiple monitored cells. SPIKE Prime and Mindstorms both use 2 lithium cells in series. These cells are monitored individually, and it could be useful to access their values separately. This doesn't necessarily apply to Control+, but parts of the firmware are likely shared across devices.

I wish I had a better answer for you, but that's the best I could find from digging around. I hope that someone here knows more about this than I do. I'll certainly update this answer if I figure out anything more about this.

| improve this answer | |
  • Bricknil source understanding is the same as mine. I think the different stages as outlined in the other comment is the best guess we might have. – Thomas Jul 14 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.