Magnetic Field Generation System

Compactly generating arbitrary 2DOF magnetic fields by precise positioning of permanent magnets

SolidWorks, KiCAD, Arduino C++, Python, Qt, MATLAB

Overview

 

Magnetic field generation system in the test environment with other equipment.

 

I researched magnetically-actuated microrobots in pursuit of my master’s degree at the University of Toronto. We developed submillimetre microrobotic grippers which could be controlled wirelessly using magnetic fields. However, in order to generate the magnetic fields, an entirely new system needed to be designed and built.

 

Image sources:
https://asset.conrad.com/media10/isa/160267/c1/-/en/505941_LB_00_FB/image.jpg?x=&y=
http://www.jantzen-audio.com/wp-content/uploads/2013/04/wire-air-cored-coil-450.jpg

 

Magnetic field generation systems typically come in two flavours.
The first strategy is to use electromagnetic coils, where the workspace is surrounded by loops of wire and the magnetic field can be controlled by modulating the current running through the wires. This approach is precise, and the magnetic field can be switched at high frequencies. However, it is sometimes difficult to generate strong magnetic fields using this approach due to geometric constraints and heat generation.
The second strategy is to use strong permanent magnets, which are often known as “rare-earth” or neodynium magnets. Permanent magnets emanate strong magnetic fields with no heat generation, and the desired magnetic field can be locally generated by precise positioning of the magnets around the workspace. However, because the magnets must be physically moved in order to adjust the magnetic field, the magnetic field cannot be switched at high frequency.

Alongside the magnetic field generation system, other test equipment is necessary in order to perform experiments. These include:

  • A microscope, as the devices are too small to visualize otherwise;

  • A force probe, for characterization experiments

  • A sample holder to contain the test sample.

Ultimately, I decided to use permanent magnets to generate the magnetic field. Not only is the design of a permanent magnet system less complicated, but the resulting design can achieve a level of compactness that is compatible with the microscope system.

 

Mechanical Design

 

Actuation schematic

 

The system uses two permanent magnets positioned symmetrically about the workspace in order to produce arbitrary uniform magnetic fields on the Y-Z plane. Two of the motors control linear motion along the X axis by using lead screws, which adjusts the distance from the workspace to the magnets and allows the strength of the magnetic field to be adjusted. The other two motors control the rotation of the magnets about the X axis, which adjusts the orientation of the magnetic field in the Y-Z plane.

 

SolidWorks Model

 
 

Exploded SolidWorks model, one side

 

Two T-slot aluminum extrusions form the skeleton of the system. These extrusions are nonmagnetic, provide ample mounting options, and provide convenient sliding surfaces for linear motion. Laser cut plates on the ends simultaneously space the extrusions and provide a mounting location for stepper motors A/D.

A simple carriage consisting of a laser cut plate provides mounting points for stepper motors B/C, rail guides, and a lead nut. One of the rail guides is extended and provides a ramp surface to trigger a limit switch. The magnet is held inside a 3D printed holder (printed using SLS, ordered from Shapeways), and mounted to the motor shaft using laser cut and purchased couplers.

 

Electrical and Software Design

 

GUI developed using Python and Qt, running on the host PC

 

I wrote a Python application with a GUI using Qt, which runs on the host PC and allows the user to access the following functionality:

  • Select the desired magnetic field conditions, from which the software calculates the necessary magnet positions to replicate the field condition.

  • Move each motor individually using software buttons (useful for calibration and initial setup)

  • Start and stop recording of field generation data for later analysis (motor positions, commanded field conditions, etc.)

 

Control schematic

 

The host PC control application communicates bidirectionally via USB with an Arduino. Target motor positions are sent to the Arduino, which uses the AccelStepper library to smoothly move the motors to the target positions. Because the actual motor position can differ from the commanded motor position while motion is in progress, the Arduino will also report the motor position back to the host PC. The Arduino sends signals to four motor drivers, which each drive a stepper motor. I used the Easy Driver by Brian Schmalz since it is cheap and compatible with the electrical requirements of the stepper motors I chose. The driver provides 1/8 microstepping, which combined with the motors 200 steps/rev results in 1600 microsteps per revolution.

To convert between desired field conditions and magnet positions, I precalculated a mapping using a MATLAB script. The permanent magnets are approximated as a number of subdomains, where each subdomain is modelled using the dipole magnetic model. The total magnetic field can then be solved as the sum of contributions from each dipole. While permanent magnets can be approximated as a single dipole for locations far from the magnet, in this case the workspace can approach the magnet within a relatively close distance and the subdomain method is necessary to maintain accuracy. I also performed additional calibration steps using a gaussprobe to ensure that the produced magnetic fields are accurate.

 

Arduino and self-designed motor driver breakout PCB. The breakout PCB features screw terminals for Arduino and motor hookups, header pins to provide locations to simply plug in the EasyDriver boards (red), a DC power jack, and LED’s to visually indicate the motion signals.

 

To integrate the electronics, I designed a PCB using KiCAD which includes headers to plug in EasyDriver boards, a DC power jack, LED’s to indicate motion signals, and screw terminals to create secure connections with the Arduino and stepper motors. I ordered the bare boards from JLCPCB, components from Digikey, and I assembled the boards myself.

All code is available on my GitHub.

 

Final Thoughts

This project went through a fair number of revisions. The original concept was completely manual, using dials to turn a belt and pulley system to move sliders. This was quickly replaced in the next revision with electrical actuation of the translational axis using linear actuators. However, the linear actuators had a very limited stroke, and insufficient precision. It was at that point that I realized the benefits of designing precise actuation of both axes, and settled on the current design. Even after coming to that conclusion, the final design would not be realized without several part prototypes and minor modifications.

Of course, there is always room for improvement. Here are some:

  • The stiffness and position repeatability of the system could be improved by using higher quality linear guide rails.

  • The system produces undesirable vibrations, which can impact experiments in some circumstances. The effect can be reduced with isolation measures.

  • The motion rate is limited by the number of steps per second that the Arduino can handle. A future design could improve the speed of response by using something like brushless DC motors with encoders, and alternate drivers/microcontrollers. Alternatively, an electromagnetic coil system could be designed.

  • The motor driver breakout board could have integrated an Arduino nano to drastically reduce the number of external connections. However, by designing it the way I did, the breakout board is controller agnostic.

Overall, the system performed to requirements and allowed me to undertake the necessary experiments for my research. This project was fantastic exposure to functional designs with motion components, further electrical design challenges, and GUI development.