Hello Waijung (Part III : Feedback Control)

Hello Waijung

Part III : Feedback Control

Previously in the Hello Waijung series.

At the end of part II, we have a working platform to continue our experiment. From the open-loop response, as the capacitor is charging/discharging, the output voltage gradually changes towards the input, though we can see it could not reach Vin level in 5 seconds. If we need to steer the output to the desired command level within some shorter interval, a controller is needed. Output voltage feedback is also required for precise regulation. In this part we investigate two schemes of real-time feedback control simulation using MATLAB/SIMULINK, Waijung, and STM32F4DISCOVERY board that could help reducing development time and effort. In the first structure, a controller is constructed as a SIMULINK block and interacts with the real plant via USB-to-serial communication*. The second structure is a standalone embedded application where a controller is implemented on the target processor connected to the real plant. In both cases, a theoretical output response is simulated for comparison.
Continue reading

Hello Waijung (Part II : Open-Loop Test)

Hello Waijung

Part II: Open-Loop Test

Before you read on, make sure you at least glimpse on our previous artile in the Hello Waijung series.

From part I, with the required hardware set up properly, we are now ready to run our first experiment. To make sure that all the connections and communication work, we will start with a simple model consisting of only the plant; i.e., our RC network.

If you have not done so, install the ST-Link utility and WaiJung. Consult the developer’s website for details. On my computer, I experienced during WaiJung installation that the setup file complained it couldn’t find ST-Link, but after I continued by ignoring that warning, the tool worked fine.
Continue reading

Hello Waijung (Part I : Hardware Setup)

Hello Waijung

This is the first article in our Hello Waijung series.

Part I: Hardware Setup

Waijung (means “so fast” in Thai), developed by Aimagin, is a software product to be used with MATLAB/SIMULINK and some supported processor board such as STM32F4DISCOVERY from STMicroelectronics. This software, available for free download from Aimagin website, is particularly useful for control system design and simulation. It supports modern design approaches using MATLAB powerful computing engine and user-friendliness of SIMULINK. Rapid prototyping and hardware-in-the-loop simulation are among the techniques already familiar to experienced MATLAB users. Nevertheless, the necessary hardware and software setups are not so trivial to a novice. The purpose of this article series is to help introduce the audience to this development tool.
Continue reading

Alternate eMotor Speed Calcuation Scheme



This article is a supplement to my previous eMotor Phones Home, which discussed PID control of the eMotor angular velocity. There the QEI module of dsPIC was initialized to reset POSCNT by the index pulse. Then the angles were sampled and velocity was calculated from the difference between new angle value and previous one. Some drawbacks of such approach are

  1. Angle read timing must somehow be synchronized with the rotation speed; i.e., overflow should not happen between readouts. This imposes constraints on the interrupt period of the timer used to capture angles (we have used timer 2). This works reliably when the timing is calibrated to some fixed angular velocity, but becomes problematic when the velocity varies significantly.
  2. The scheme does not suit applications that require encoder count accumulation, such as CNC linear axes or robot joints with gear ratio, for example.

Continue reading

eMotor Phones Home



Since our last discussion on building an electronic motor simulator a couple of weeks ago, I didn’t expect having something to write more within a short time. It turned out that experimenting with the prototype was so fun that I couldn’t wait to share it with the audience. And I did learn more about control from this baby when it started talking.

I put the module under test by connecting it to another embedded system, in this case my old dsPIC30F4011 development board (JX-dsPIC40) from Innovative Experiment Co.,Ltd . The board provides some basic components such as push-button switches and LEDs, though I solder a few more. The setup is shown in Figure 1.



Figure 1: Connecting the eMotor to another DSC

Continue reading