Embedded Prototypes for Control Engineering

Audience may observe that I normally use general-purpose PCBs to build prototypes since the schematics are not too complicated to do so. They look unprofessional, but most could satisfy the desired functionality. Time and budget are also major factors for consideration. Nevertheless, once a design crystallized, it becomes burdensome to construct more than one prototype. This is a good point in time to consider creating a customized PCB.

Figure 1 shows a experimental setup that I like to use as teaching aid in my control courses. It consists of a DC motor simulation board (called e-motor) and a control board connected together via ribbon cable. The e-motor and some part of the controller are soldered and wired on prototype areas. Even though this HIL setup is much lighter than a real DC motor, I still hate to carry the boards from my office to the classroom on another building.
e-motor old setup
Figure 1 a simulated DC motor control setup

The following improvements would make the boards more teacher-friendly

  • Reduce board sizes
  • Use more modern devices
  • Improve performance and add more functionality
  • Use male and female connectors in place of ribbon cable
  • Eliminate the power adaptor (use power supply from USB)
  • Increase resolution of shaft angle (more LEDs) on the e-motor

After a couple of weeks on serious board and PCB design with the aid of Eagle software from CadSoft, I come up with a new setup shown in Figure 2 for my class this semester, with all the improvements listed above.
CM1-EM1 connection
Figure 2 new experimental setup for simulated DC motor control

Board dimensions are small enough that the designs could be carried out using freeware version of Eagle. The prototypes are labeled CM1 and EM1 for the control and e-motor modules, respectively.

The Controller Module (CM1)

The Controller Module (CM1), shown in Figure 3, serves as a target board for controller implementation. The user can select standard PID structure and adjust the parameters, or using PID autotuning feature, or even design a custom controller using plant data from system identification process. To accommodate user communication, the CM1 executes a simplified real-time operating system called RED (Responsive Embedded Development), that utilizes a variant of cyclic executive scheduling.
controller module 1
Figure 3 The Controller Module (CM1)

Technical details for the CM1 board are as follows:

  • PIC24EP256MC202 MCU running at 70 MIPS
  • Number of ADC channels: 4
  • Number of DAC channels: 4
  • DAC external IC: MCP4728 with I2C interface
  • DAC channel buffer: MCP6004 quad opamp
  • EEPROM: 24LC128, 128 Kbits with I2C interface
  • USB to UART converter: FT230X from FTDI
  • Power supply: 5V from USB, adjusted to 3.3 V by LD1117 regulator
  • Other features: external UART communication and power supply selectable by jumpers. Prototype area.

The E-motor Module (EM1)

DC-motor simulation is implemented on the E-motor Module (EM1) in Figure 4, which can be coupled to the CM1 board via connectors along the board edges. In addition to the motor simulation part implemented on PIC24EP256EP202, this board also provides various status LEDs such as feedback loop open/closed, PID autotuning active, etc. using MCP23017 16-bit I/O expander. Output disturbance can be applied by pressing a push-button switch, just like the user presses on a motor shaft disc to drag the rotation.
e-motor module 1
Figure 4 the E-motor Module (EM1)

The software parts for these prototypes are still under development as they are planned for teaching aids this semester. Basic controller functions, and even some advanced implementation such as H control, were tested earlier with satisfactory results. In order to be used by a beginner with little knowledge in control engineering, the software must be improved for more user-friendliness. Progress will be posted later on dew.ninja.

Read dew.ninja Newsletter Embedded Control Design: experimental boards for control engineering study

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s