EMB-Electromagnet Module - Tutorial
Electromagnet Module
(updated on 3/25/2026)
General Information ​
This module is used to set a initial displacement condition on spring-based plants. The user manually sets the initial condition and the electro-magnet holds position. The electro-magnet is electronically controlled, allowing precise ON/OFF switching.
​
This module uses core components from APW, PA - USA and custom components manufactured by us.
​
For more information regarding each component check the resource below.
1) Link to manufacture's website for the Electromagnet driver: Link
2) Link to Electromagnet driver datasheet: Link​
3) Link to Electromagnet datasheet: Link
3) Link to Strike Plate datasheet: Link
​​
The electromagnet is controlled by a digital output from the DAQ. The module requires an external power supply, typically configured to 12 V with a maximum current of 1.5 A. Under normal operation, the electromagnet draws approximately 0.35 A. Care should be taken to avoid ground loops between the power supply and the DAQ.
​
Important safety note: Leaving the electromagnet continuously powered (indicated by the LED being on) for extended periods will cause it to heat up, which may create a hazardous condition. To prevent overheating, we strongly recommend energizing the electromagnet only for short durations — 20 seconds or less.
​
The drive board can be controlled in two ways:
​
- By switching the power supply output on and off to enable or disable the board, or
- By configuring the system so that the signal pin defaults to a high state, ensuring the electromagnet remains off even when the driver board is powered.
​​​​​

Picture of the Electromagnet driver connected to Channel 2 of a Rigol power supply (Maxon ESCON connected to Channel 1, via the Banana Plugs), be mindful of polarity (use a multimeter to identify +/- if needed):

As an example, the following picture shows the ground (Black) and signal (Brown) connected to the EMB-DAQ2 Port C pin 3 and pin 4:

The Electromagnet Module LED should illuminate when power is applied to the module and the signal pin is set to a low state, indicating that the electromagnet is active. Use extreme caution during operation, as the energized electromagnet generates a strong force. To prevent sudden impact and potential safety hazards, ensure that the strike plate is already in contact with the electromagnet before it is activated. Failure to do so may result in forceful snapping, which could cause injury such as finger pinching or equipment damage:

By default, the NI PCIe-6321 sets the digital outputs to low, resulting in the electromagnet being on by default. In software, a Digital Output block is used to trigger the Electromagnet. As an example of input signal, a Step input is shown here connected to the Digital Output, PortC, Pin4:



It is possible, and in many cases recommended, to change the default state of the NI PCIe-6321 to high for the pin used to drive the electromagnet. We believe this configuration makes more sense for laboratory use.
​
To make this change, open NI Max (NI Measurement & Automation Explorer), and select the NI PCIe-6321 card under "My System/ Devices and Interfaces":

Next, click on "Hardware Configuration Utility" in the middle tab, a new window should open:

Select the board, then click "Digital Channel States" under "Power Up States" on the left strip. A window should pop-up, change the "Line State" from Tristate to High for line2 port0 (this pin will be used to drive the electromagnet):


Close NI Max and restart the computer. Now, the NI PCIe-6321 should be configured for the Digital Output, PortC, Pin4 to be have a high state by default.
The operation of the electromagnet drive and Simulink is reversed from what we described earlier.
​
Now in Simulink, we need to make a change on the initial and final values of the Digital Output block (this is critical! for proper operation when set to high by default). We are setting the Initial and Final Values for the digital outputs as [0, 0, 1, 0]. We want the output channel 3 (Digital Output, PortC, Pin4) to be high in Simulink by default too:

To turn the electromagnet on we set the input to "0" after manually touching the carriage strike plate to the electromagnet, and then applying "1" to release (turn electromagnet off). This operation is typically done with a Step input to have repeatable experimental data:

The bracket included in this module is identical to the standard Spring Set bracket used throughout the system. The electromagnet is attached to the bracket using an M4 × 30 fastener, an M4 washer, and a thumb nut. During installation, take care not to pinch, bend sharply, or otherwise damage the electromagnet cable. To secure the bracket to the breadboard, use an M6 fastener and washer. When installing the washer, orient it so that the rounded edge faces away from the anodized surface to prevent potential surface damage caused by washer edge burrs.

The strike plate is mounted to the moving carriage side plate using an M5 × 12 fastener, an M5 washer, and a thumb nut. It is important to align the strike plate so that it is centered with the electromagnet. This alignment is easier to perform when no springs are attached to the carriage, allowing it to move freely. After alignment, ensure that the initial condition loading (spring preload) does not exceed the recommended specifications.




