ADwin-Gold Data Acquisition System
CAS DataLoggers Sales Manager Pete Martin impresses exhibition attendees with a unique ADwin demonstration of balancing a highly unstable inverted pendulum. The demo highlights how to achieve microsecond response times with a measurement and control system while operating in the Microsoft Windows environment. At the start of the demonstration, the inverted pendulum is knocked off-balance so that its weight causes it to fall. Almost immediately, however, the pendulum starts to swing and return itself to its original inverted position. The demonstration video is available online on YouTube at https://www.youtube.com/watch?v=87sD1TI7Ujc.
The Demonstration Hardware
A variety of hardware was used to implement this demonstration, including a stepper motor controlled by an ADwin real-time data acquisition system. By means of a toothed belt, the stepper motor moves a metallic plate (carriage) on which a quadrature encoder is mounted. The pendulum itself is an aluminum weight at the end of a carbon-fiber arm, which is attached in turn to the axis of the quadrature encoder.
ADwin: Real-Time Performance Independent Of A PC
The ADwin line of data acquisition systems are equipped with their own local processors, running at up to 1 GHz of internal memory, digital and analog inputs/outputs, as well as an external trigger input. ADwin systems are suitable for a diverse range of applications demanding deterministic response times of a microsecond or less, including control of complex, high-speed test stands.
When viewing the pendulum demo online, note that an inherent real-time operating system and a control program arranged in several processes for the demo model are running on the ADwin system. The real-time operating system manages running each process simultaneously and guarantees short and reliable response times in order to accurately balance the pendulum.
Programming The Real-Time Control Loop
The control program for the demonstration is programmed in ADbasic, a user-friendly development environment under Windows. This environment allows users to program in a BASIC-like programming language so that various control and measurement applications can be carried out easily. Moreover, ADbasic offers the opportunity for online debugging and data transfer with the PC.
ADbasic compiles the control program and transfers it to the local ADwin processor, where it runs completely independent of the PC operating system. As the process is being compiled, great care is taken to ensure the shortest possible runtime. The PC is only needed for operating, visualization, and logging the measurement values.
A constantly-running communication process allows for continuous data transfer between the system and the PC, even during the highest speed acquisition, without any effect on the ADwin system’s reaction time.
Operation and Control of the Pendulum Program
The TestPoint application development package was used to create the graphical user interface for the operating program that starts, stops, and monitors the movements of the stepper motor. Users view a window monitoring the carriage position over a chosen period, showing the actual status of the carriage (blue line) and the target status (red line), independent of time.
A look behind the scenes shows that several individual processes run once the ADbasic pendulum program begins. To establish a reference position for the pendulum, the pendulum is brought to a standstill. After this, a reference run is made to find the zero point of the carriage. Only then will the pendulum begin to swing up and balance. The carriage is moved around the target position as long as the pendulum arm is above the carriage. After approximately 13 seconds, the pendulum is balanced above the carriage.
During balancing, two processes are running simultaneously on the ADwin system:
- Measurement and control of the pendulum: Runs at a repetition rate of 10 ms, a fairly modest rate for the ADwin system.
- Control of the stepper motor: This requires exact timing of several microseconds and is divided into two sub-processes. One prevents the pendulum arm from falling down, while the other, which overlies the first, helps to keep the carriage in its target position.
The target position of the carriage can be adjusted with the scrollbar on the right side of the dialog window. The ADwin system reacts immediately to any change of the target position, moving the carriage to the specified position. In the demonstration model, the control process is made more visible and obvious by slowing it down—the new target position, roughly 1000 units away from the original one, is reached after five seconds.
Concurrent Operation With Windows
Dynamic Link Libraries (DLLs) are available for all Windows operating systems (Windows 10/11) for transferring data between the ADwin and the operating program on the PC.
When using an ADwin system, neither the choice of Windows operating system nor the control application on the PC has any influence on the real-time capability of the system. Given that the control application need not meet any real-time requirements, it can be developed very easily with any of a number of common Windows development systems, such as Visual Basic, Delphi, Visual C++, or with programs like TestPoint, MATLAB, DIAdem, or LabVIEW.
ADwin Applications In Industry And Engineering
While ADwin systems can easily handle simplistic applications like this pendulum demonstration, they were expressly developed for applications in industry and engineering, where they’ve long been popular choices. Typical ADwin applications in this field generally require very short response times, such as:
- Vibration Test Stands: Control of vibration test stands for testing exhaust pipes, motor bearings, couplings, car seats, steering wheels, etc. For example, a fast digital controller moves a hydraulic cylinder along a track and acquires and evaluates the response signals. Cycle times of less than 20 microseconds are necessary here.
- Scanning Tunneling Microscopes: Control and monitoring of scanning tunneling microscopes. The X-Y coordinates of a very thin needle are precisely and quickly controlled via two analog outputs, while the distance (Z-coordinate) of the needle is controlled via an analog input and held at a constant height above the sample. The cycle frequency for this application must be several hundred kilohertz.
- High-Speed Controllers and Filters: Implementation of applications requiring very fast digital controllers and filters up to 400 kHz. These are similar to digital P, PI, and PID controllers, allowing for observation of process deviations and real-time adjustment of control parameters.
Large amounts of data can be acquired and distilled by the ADwin processor, and only the calculated result is sent back to the PC to free up resources. Once a value is calculated, the ADwin system can react intelligently by changing the test sequence accordingly.
Although it may seem like a novelty, the pendulum demonstration is also instructive for the way it spotlights ADwin’s capabilities more clearly than any words or figures. It demonstrates how system response times of less than 1 microsecond are possible while using the Windows environment for the human-machine interface.
For more information on sophisticated data acquisition and control solutions from ADwin, or to find the ideal solution for your application-specific needs, contact a CAS Data Logger Applications Specialist at (800) 956-4437 or request more information.

