Solve the control problem for a motion platform which is a part of a 4D show demonstration system.
Our Client is a provider of the equipment for 4D cinemas. We have been in a tight cooperation with the Client while developing software and implementing hardware for the electronic components of their cinema management system.
In an earlier stage of our cooperation, the Client approached CPCS with the request to design and implement a controller for their cinema motion platform with 2 degrees of freedom (2DOF) and equipped with two servo motors and two servo drivers.
The project’s technical requirements included the request to feed the controller of the platform with its roll-and-pitch trajectory in real time. The motion controller was also required to be synchronized both with movie demonstrations and relevant physical effects not to outrun or fall behind the cinema shows.
To meet the Client’s need of solving the problem of asynchronous equipment motion and 4D show demonstrations, we were investigating all available operation modes of the system’s servo drivers.
CPCS’s experts started with figuring out the optimal speed and position of the motion platform’s elements and these parameters’ control options. This was needed to analyse all possible drawbacks of each mode.
The project was defined by the Client’s system characteristics:
One of our first findings revealed that simultaneous real-time control of speed and position can be achieved by feeding the servo drivers with pulse train and direction signals. Based on the incremental encoder feedback, we implemented a proportional controller. The controller aims to calculate speed at each discrete time step, taking into account the acceleration and speed limits, which in turn convert user input into reasonable mechanical motions.
Our experts applied transcendental trigonometric equations to solve the inverse kinematics problem of the optimal parameters for the motion platform’s elements. The analytic solution below describes the states of crank-rod mechanisms based on the platform’s needed modes.
Here’s how our mathematical model looks like for the given 2DOF platform:
Measured by oscilloscope, its precision was sufficient enough to provide interval of tens of microseconds corresponding to speed up to 3000 resolutions per minute.
During the next stage of our investigation, we dived into detecting the reasons for strange vibrations which could be observed in the motion platform’s work.
One of our unexpected findings was that the servo motors used to work with an irregular speed. Our analysis proved that microsleep and nanosleep C++ functions provide delays for values under 1 millisecond. We selected Raspbian as our OS. However, regular Linux OS cannot be considered to be a real-time one, whereas any system interruption or the CPU load may cause unpredictable delays for the time scale. That finding was the game changer for the project.
The first obvious solution to eliminate the delays was to use additional integrated circuits to generate precise pulses. However, the solution was limited by the Client’s hardware and our engineers decided to use a DMA (Direct Memory Access) module aboard Raspberry’s BCM controller. In general, a DMA allows for a fast data exchange between memory cells, which happens independently from a CPU.
A separate DMA channel was used for each servo driver to allow the generation of simultaneous pulses with different intervals. Each DMA channel was configured to process four control blocks in a loop. Two of them were copying logic 1 or 0 to memory addresses mapped to certain GPIO outputs. The needed precise intervals between these operations were achieved by copying the data to certain registers of PCM and PWM modules. Due to the fact that the DMA controller is a separate module, CPCS’s engineers got a clear series of pulses with desired interval.
As the result of our work, the Client’s system started to work 100 percent flawlessly regardless of the processor workloads.
CPCS’s decision to use DMA channels to communicate with the system’s OS solved the control problem for the Client’s motion platform. The solution proved to be effective and independent from the embedded system loads.
Our Client benefited a great deal from the expertise of our engineers. The motion platform experienced no more vibrations and its precise motion controller – robust to disturbances – allowed the Client’s 4D-cinema business to work with no downtimes and its end users, 4D-cinema fans, to get an amazing experience while watching the shows!