Skip to main content

6 Channel Output Module

The 6 Channel Output Module is a GOcontroll Moduline compatible expansion card that adds six independently controllable output channels to your Moduline controller.

GOcontroll 6 Channel Output Module, front view

Every channel is configured on its own and drives its load in the way you choose: switched to the module supply or to ground, on and off or duty cycle controlled, with a current limit and a current measurement of its own. The module fits every module slot of a Moduline L4, Moduline M1, Moduline S1 or Moduline HMI1. The article number is 202002 followed by two digits for the hardware version. For the electrical specifications see the product page.

On this page


Channels and configuration

You set the function of each channel. The function determines how the channel drives its load, and what the value you send to it means:

  • Output channel disabled: the driver of the channel is switched off. This is the default for every channel, so a module that has just been scanned drives nothing.
  • Half bridge duty cycle controlled: the channel drives its load through a half bridge. A value from 0 to 1000 sets a duty cycle from 0 to 100%, and that percentage is the part of the period the output is connected to the supply; for the rest of the period it is connected to ground. At 650 the load is on the supply for 65% of the period and on ground for 35%.
  • Low side switch duty cycle controlled: the channel switches the load to ground with a duty cycle, on the same scale of 0 to 1000. At 0 the low side is floating, at 1000 the load is connected to ground for the whole period.
  • High side switch duty cycle controlled: the channel switches the module supply to the load with a duty cycle, again from 0 to 1000. At 0 the high side is floating, at 1000 the load is connected to the supply for the whole period.
  • Low side switch on – off: the channel switches the load to ground. A value of 1 or higher switches it on, 0 switches it off.
  • High side switch on – off: the same, switching the load to the module supply.
  • Peak and hold current mode: the channel energises the load with a high duty cycle for a short period and then falls back to a lower duty cycle that keeps it energised without dissipating much energy, through the half bridge. Two extra settings belong to this function: a peak current and a peak time.
  • Frequency output: the channel puts out a frequency. Here the value is the frequency itself, from 0 to 500 Hz.

All six channels have the same eight options. For ten channels of plain high side switching on one module, use the 10 Channel Output Module; for two channels with a higher current rating per channel, the 2 Channel Power Bridge Module.

Every channel also has a current limit of its own, from 0 to 4000 mA. Two things to keep in mind when you set it: 4000 mA is the highest current a channel can carry, not a current it can hold continuously, and the total current of all six channels together is bound by the maximum current of the module – six channels at their limit is more than the module can deliver. The product page lists the current ratings.

When a channel is duty cycle controlled, in peak and hold mode or in frequency output mode, the switching frequency is set per channel pair: 1 with 2, 3 with 4, and 5 with 6. Both channels of a pair therefore always run at the same frequency. The module supports 100 Hz, 200 Hz, 500 Hz, 1 kHz, 2 kHz, 5 kHz and 10 kHz.

The module protects itself in two ways that your program has to take into account. It measures the shift on its own power ground and switches the channels off once that shift passes a threshold, until the module is reset; the value should stay below 50 mV. And it expects a valid message from the controller at least every 600 ms: if none arrives it switches all outputs off as a fail-safe, so an application loop that stalls or pauses drops the loads.

With every message it answers, the module reports back the current of each channel in mA, its own temperature, the shift on its ground in mV, and a status value that carries fault flags, listed under Module status. The sign of the channel current follows the configuration: a channel that switches high side reports a positive current, a channel that switches low side a negative one. A channel in peak and hold mode also reports the duty cycle it actually runs, which needs module firmware 2.1.0 or newer. Modules with hardware version 1.07 or newer report their supply voltage in mV as well; older modules report 0 for it. The module does not report a total module current – add up the six channel currents if you need it.


Connections and pinout

The module presents three supply pins, the six output signals OUT1 to OUT6, three ground pins and one pin without a function. The supply and ground pins carry the power that the outputs switch through to your loads. Which connector pin carries which signal depends on the controller and on the slot.

Connect all supply and ground pins before you drive an actuator: without them the module and the processor board can be permanently damaged. Never fuse the ground and never interrupt it – if a safety relay removes the module power, switch the positive supply only. And connectors may never be hot-plugged: remove power before you remove or install a connector.

Give every output module its own fused supply. This module has three supply pins; splice them into a single wire that runs to the fuse. Size the fuse for your application, and never above the maximum current the module can handle.

Pinout Moduline L4

Eight module slots on 26-position connectors. Connector A carries slots 1 and 2, connector B slots 3 and 4, connector D slots 5 and 6, and connector E slots 7 and 8. The pin numbers are the same on all four. Slots 1, 3, 5 and 7 use the uneven layout, slots 2, 4, 6 and 8 the even one.

26-position connector, module in an uneven slot
26-position connector, module in an even slot
SignalDescriptionUneven slotEven slot
SUPPLY 1Module supply71
SUPPLY 2Module supply62
SUPPLY 3Module supply53
OUT1Signal out 1138
OUT2Signal out 21914
OUT3Signal out 3129
OUT4Signal out 41815
OUT5Signal out 51110
OUT6Signal out 61716
GROUNDModule ground2620
GROUNDModule ground2521
GROUNDModule ground2422
NCNo functionality423

Pinout Moduline M1

Four module slots on 34-position connectors. Connector A carries slots 1 and 2, connector B slots 3 and 4. The pin numbers are the same on both. Slots 1 and 3 use the uneven layout, slots 2 and 4 the even one.

34-position connector, module in an uneven slot
34-position connector, module in an even slot
SignalDescriptionUneven slotEven slot
SUPPLY 1Module supply71
SUPPLY 2Module supply62
SUPPLY 3Module supply53
OUT1Signal out 11510
OUT2Signal out 22318
OUT3Signal out 31411
OUT4Signal out 42219
OUT5Signal out 51312
OUT6Signal out 62120
GROUNDModule ground3226
GROUNDModule ground3127
GROUNDModule ground3028
NCNo functionality429

Pinout Moduline S1

Two module slots on a single 34-position connector.

34-position connector, module in slot 1
34-position connector, module in slot 2
SignalDescriptionSlot 1Slot 2
SUPPLY 1Module supply71
SUPPLY 2Module supply62
SUPPLY 3Module supply53
OUT1Signal out 11510
OUT2Signal out 22318
OUT3Signal out 31411
OUT4Signal out 42219
OUT5Signal out 51312
OUT6Signal out 62120
GROUNDModule ground3226
GROUNDModule ground3127
GROUNDModule ground3028
NCNo functionality429

Pinout Moduline HMI1

Two module slots on a single 34-position connector.

34-position connector, module in slot 1
34-position connector, module in slot 2
SignalDescriptionSlot 1Slot 2
SUPPLY 1Module supply71
SUPPLY 2Module supply62
SUPPLY 3Module supply53
OUT1Signal out 11510
OUT2Signal out 22318
OUT3Signal out 31411
OUT4Signal out 42219
OUT5Signal out 51312
OUT6Signal out 62120
GROUNDModule ground3226
GROUNDModule ground3127
GROUNDModule ground3028
NCNo functionality429

Note: only one application may claim the modules. If a second program initialises the same module – most often a compiled Simulink model next to a Node-RED flow – it causes strange behaviour. Use the CodeBase, Simulink or Node-RED, not two of them at the same time.


Programming with the CodeBase

The GOcontroll CodeBase is the C library for writing your own program. The module is handled through GO_module_output.h and one _outputModule instance. Configure it before you drive it, and initialise the communication before you assign the slot:

static _outputModule outputModule;

GO_board_get_hardware_version();
GO_module_output_set_module_type(&outputModule, OUTPUTMODULE6CHANNEL);
GO_communication_modules_initialize(MODULESLOT1);
GO_module_output_set_module_slot(&outputModule, MODULESLOT1);

for (uint8_t ch = OUTPUTCHANNEL1; ch <= OUTPUTCHANNEL6; ch++) {
    GO_module_output_6ch_configure_channel(&outputModule, ch,
                                           OUTPUTFUNC_6CH_HIGHSIDEDUTY,
                                           2000,  /* current limit in mA */
                                           0,     /* peak current, peak and hold only */
                                           0);    /* peak time, peak and hold only */
}

GO_module_output_configure_frequency(&outputModule,
                                     OUTPUTFREQCHANNEL1AND2,
                                     OUTPUTFREQ_1KHZ);

GO_module_output_configuration(&outputModule);

The channel call takes the current limit in mA and, for peak and hold, a peak current and a peak time; pass 0 for those two on every other function. The frequency call takes a channel pair, OUTPUTFREQCHANNEL1AND2, OUTPUTFREQCHANNEL3AND4 or OUTPUTFREQCHANNEL5AND6, and both calls have to happen before GO_module_output_configuration(), which is the single call that ships the configuration to the module.

Use the OUTPUTFUNC_6CH_ macros. The OUTPUTFUNC_10CH_ macros belong to the 10 Channel Output Module and their numeric values overlap with the ones here: OUTPUTFUNC_10CH_HIGHSIDEDUTY carries the same number as OUTPUTFUNC_6CH_HALFBRIDGE and OUTPUTFUNC_10CH_HIGHSIDEBOOL the same as OUTPUTFUNC_6CH_LOWSIDEDUTY, so the wrong macro is accepted without an error and the channel switches the other way round than you asked for.

Be aware that GO_communication_modules_initialize() must be called before GO_module_output_set_module_slot(). The initialize call fills the module occupancy data that set_module_slot uses to verify the module is really present. In the other order you get a contested slot error at runtime.

Driving the module is one call in your application loop, which also brings the feedback back:

outputModule.value[OUTPUTCHANNEL1] = 500;

GO_module_output_send_values(&outputModule);

/* outputModule.current[], .dutyCycle[], .temperature, .ground,
   .supply and .errorCode now hold what the module sent back */

Keep that call between 10 ms and 400 ms apart: faster than 10 ms overdrives the module, and once 600 ms pass without a message the fail-safe switches the outputs off. The 400 ms ceiling keeps a margin against that threshold; ten milliseconds is the usual loop time. The complete example is in examples/output_module_6ch/ of the CodeBase; it also shows a shutdown callback that disables every channel before the program exits.


The GOcontroll blockset for MATLAB Simulink holds the block Output Module (6 channel), in the Modules group of the library browser. See using the blockset and create model to get started.

The block has six uint16 inputs, one per channel, and no outputs. The input labels show the connector pin that belongs to the controller type and slot you selected, so you can trace a channel from the model back to the wiring.

Its mask holds the sample time, the controller type and the module slot, a frequency per channel pair, and per channel its function and its current limit in mA. Selecting peak and hold on a channel adds the peak current and the peak time for that channel. Use a sample time of 100 ms or lower.

The feedback from the module has its own block, Output Module Monitor (6 channel), with ten outputs: the module temperature, the ground shift in mV, the supply voltage in mV, the module status, and the current of each of the six channels in mA. Every channel you set to peak and hold adds one more output with the duty cycle of that channel. The ground shift should stay below 50 mV.


Programming with Node-RED

The GOcontroll nodes are installed on the controller by default. The node for this module is 6 Ch Output Mod, in the GOcontroll section of the palette. See first flow for building a flow.

Note: the Moduline S1 does not run Node-RED.

In the node you set the module slot, the sample time (200 ms, 100 ms or 50 ms), the frequency per channel pair, and per channel its function and its current limit in mA. A channel set to peak and hold gets two more fields, for the peak current and the peak time. Each channel also gets a key: the name you use to address it, and the name its feedback carries. Use a descriptive name, it makes the rest of the flow readable.

You drive the outputs by sending a message into the node that carries those keys. The default names are outputSignal1 to outputSignal6:

{"outputSignal1": 500}

You may combine as many channels in one message as you like, and a channel you leave out keeps the value it already had. Values run from 0 to 1000; anything outside that range is ignored.

Every sample period the node sends out a message with the feedback from the module:

{"moduleTemperature": 28,
 "moduleGroundShift": 0,
 "moduleStatus": 0,
 "outputSignal1Current": 135,
 "outputSignal2Current": 122,
 "outputSignal3Current": 254,
 "outputSignal4Current": 126,
 "outputSignal5Current": 450,
 "outputSignal6Current": 655}

The current keys are built from the key of the channel, so they follow the names you gave. A channel in peak and hold mode adds a key with the duty cycle it runs, and a module with hardware version 1.07 or newer adds moduleSupply with its supply voltage in mV.

The Object I/O (legacy shape) checkbox determines where those keys end up. Enabled, they sit directly on the message. Disabled, they sit in msg.payload, which is the Node-RED convention. The same choice applies to the messages you send into the node.

The node shows the article number and the firmware version of the module as its status. If the slot holds a different module type, the status turns red and reports that the selected module does not match the module present in this slot.


Module status

The status value the module returns is a 32 bit field in which every bit that is set stands for one fault. A bit that is not in the table below is reserved.

BitFault
0Overcurrent on channel 1
1Short circuit on channel 1
4Overcurrent on channel 2
5Short circuit on channel 2
8Overcurrent on channel 3
9Short circuit on channel 3
12Overcurrent on channel 4
13Short circuit on channel 4
16Overcurrent on channel 5
17Short circuit on channel 5
20Overcurrent on channel 6
21Short circuit on channel 6
24Ground shift above the limit
25Module temperature above the limit
26Total module current above the limit
27Module communication timeout
29Module supply voltage below the minimum

Module firmware

The module runs its own firmware, which drives the output stages according to the configuration your application sends and reports the module measurements back. Use go-modules to check the installed version and to update it, and identify to list the modules the controller detects.


Also see