CANopen electric motor drive integration into "Boat" page using Node-RED

Carrying on the discussion started in the V3.60 page…

Now that Venus-OS can display motor drive data so long as it can be imported, and Node-RED has a new virtual motor driver, I’d like to do this on my boat which has a SEVCON Gen4 motor driver (with CANopen interface) by connecting it to the VE.CAN port on the Cerbo GX, so that useful data for the steerer (e.g. motor rpm/power) can be displayed either on the Touch50 display or a phone/tablet – and also monitored/logged using VRM like all the other system info.

Jan @UpCycleElectric thinks that this should be possible using Node-RED with some existing software modules, and is interested in this too – and I would have thought there might be quite a few Victron customers (both boat and EV?) who would also like this, since the SEVCON is one of the most popular motor conrtrollers, and there are more and more electric boats around.

I’m sure my boatbuilder would be interested too but I know he’s up to his eyeballs in building boats right now so this isn’t high on his priority list. I’d love to get involved but as well as having no knowledge about Node-RED/CANopen (apart from what I’ve read) I’m lacking in spare time, especially since the boat is in a marina 150 miles away – and I suspect you need to be sitting next to the hardware to develop/debug something like this.

So if anyone with more experience/knowledge could make this happen, that would be a great service to the community – including me, of course… :slight_smile:

It would surely be interesting to feed the sevcon CANope data stream into the virtual motor. And should not even be too complicated but as with everything can-bus, sevcon and victron, the devil is in the detail. As with all open source ideas, first someone willing and able to put time in needs to take the lead.

It might be even possible and possibly less complicated, to feed rpm data to an analog output on the sevcon (or whatever output available to drive a tachometer) and then back into Cerbo to the virtual motor. Power data is already measured by BMV. For practical reasons I’m tempted to try that first.

But, yeah once a CANopen stream can be used, all other measurements come without further hardware needs (only one can-bus). Rpm, power, temperature are all relevant.

If you can get at least the can-bus part up and running on a hardware level I’d willing to dig into the CANopen decoding and Node-RED handling thereof.

It seems there is – or used to be? – an Oceanvolt driver “dbus_motordrive” built into the OS:

If true, this might work “off-the shelf”. Anyone know?

Aaargh – I just followed the link trail and it led to a 5-year-old post from me… :wink:

I think the availability of the virtual motor node makes all other ‘routes’ less attractive.

Here’s a more visible snapshot of the post from the Electric Narrowboats FB group…

There is a repository: Bitbucket

I’d love to, but the boat is 150 miles away… :frowning:

What’s a bit odd here is that there’s a standard option for the VE-CAN port of “Oceanvolt (250kb/s)” which is the “dbus-motordrive” referred to earlier, and which supposedly reads CANopen data – and presumably would then appear as a “motordrive” on the devices list.

You’d think this would then be picked up by the “Boat” display page as well as being readable via VRM (and any other display), not needing Node-RED and its virtual motor driver.

For sure, this is all part of the standard Victron package, so I don’t see why it wouldn’t work like any other attached device.

If I was on the boat (with a CANbus cable) I’d try this out, but I’m not… :frowning:

Can anyone from Victron say why this shouldn’t work? @mpvader ?

CAN-open is a very broad definition. That is the answer.

The Oceanvolt implementation is a specific implementation for their motordrive (-config), which works with a specific data format on can-open.

We, Victron, would love to have a more generic driver that can work with different motordrive’s that work on CANopen their data formats.

And be easily extendable / configurable for further motordrives, but have no capacity to start such project internally at the moment.

Thanks Matthijs – I understand that, but there was a post above suggesting that it works with the SEVCON Gen4 controller, which is what I have. That wouldn’t be surprising since there are standard message formats defined in CANopen for drive controllers, at least for the basic heartbeat parameters like rpm and power which are all I’m really interested in. More sophisticated data is likely to be manufacturer-specific, especially if you want to write to the controller to change settings or control it – but I don’t want/need to do that.

I guess the only thing to do is try it and see if it works.

If it does, I assume it will appear as just another device on the list for remote console/VRM? Will the Boat page then pick up and display the motordrive data?

Hi, ok understood.

The best answer I have is: probably :slight_smile:

Thanks… :wink:

What I meant was – if the Oceanvolt setting works and the data gets in (this is the unknown!) and the motordrive appears in the device list with valid rpm/power data attached, will the “Boat” page automatically pick this up like it would with an Oceanvolt motor controller?

Because as discussed earlier there’s currently no way to control/configure what appears on the “Boat” page, you get what the system decides to show you… :wink:

Only one way to find out whether both Oceanvolt and Sevcon adhere to the same CANopen standards to publish basic operational performance data: hook it up and see. Would be a gem to discover if they actually do so.

If not, we might be able to rewrite the Oceanvolt driver to do so after all, and once a proof of concept is available, convince Victron to update it.

1 Like

Hi Ian,

I can confirm it is possible to get the data from the sevcon gen4 on the CerboGX, I just got it working.

My setup:

Sevcon Gen4 → Custom board (CAN receiver + Microcontroller)

This talks to the sevcon controller using CANOpen.
SDOs are read every second. (There is probably a better way).

At index 0x5100, subindex 1, you’ve got the voltage.
At index 0x5100, subindex 2, you’ve got the current.
At index 0x606c, subindex 0, you’ve got the rpm.
At index 0x4600, subindex 3, you’ve got the engine temperature.

The program on the custom board just turns this data into a custom NMEA0183 sentence which is sent over ethernet to the CerboGX along with all the other sensors I have.

CerboGX - SignalK.+ NodeRED

SignalK enabled in Cerbo.
Then within SignalK you can install NodeRED. GitHub - SignalK/signalk-node-red: Node server plugin that embeds node red
Then within NodeRED you will have to install Victron’s nodes. GitHub - victronenergy/node-red-contrib-victron

I’ve got SignalK configured to get data using a TCP client to connect to my custom board over ethernet.
Then SignalK is configured to parse the NMEA sentences and make the data available at a given path.

Then in NodeRED I have:

  • A virtual motor drive.
  • A subscribe node for each value, connected to a custom control node.

The trigger nodes are optional, they are used to reset the value so that the boat page goes back to normal after the motor has been turned off.

I couldn’t get the temperature working, none of the measurements available in the custom control node do anything on the boat page, seems like there is something missing in the node.


All of this is a bit complex, but you could remove a lot of the complexity if you can get the sevcon controller directly connected to the Cerbo

2 Likes

Why the additional custom board while VenusOS Large has both Node-RED and SignalK? (I must admit, I have no clue about SignalK)

@citolen would you be willing to browse through the Oceanvolt code to see if there is a reasonable way forward to make it work with Sevcon?

The custom board does nothing more than extracting data from the Sevcon controller and forwarding it to the Cerbo.
Sevcon ← (CANOpen) → Custom Board ← (Ethernet) → Cerbo.

The custom board does not run SignalK or NodeRED.
If you can get the Cerbo to communicate directly with the Sevcon then you don’t need the custom board.

SignalK and NodeRED are running on the Cerbo, but on their own, it won’t help you get the data from the Sevcon.
You still need something whether software or hardware to talk to the Sevcon controller.

Thats a nice first post! Welcome @citolen !

Hear hear!