Hi folks, We developed a single module that performs the tasks of dual motor control and thereby making it simpler by implementing auto-tuning and motor control algorithms that support high current drive applications. The module is designed to support UART communication for IoT based industrial applications. The concept proposes the idea of implementing motor control by real-time simulation to obtain accurate run-time control parameters. The module is designed to communicate with other similar modules by creating a network that is connected over a single UART channel and controlled by a single master micro-controller. Further, it explains the functions that are built to process the constants resulting from the model and executing on the hardware we built.
The motor-controller is developed using STM VNH5019A-E and Arduino Micro ATMega32u4. The basic purpose of integrating the micro-controller was for the auto-tuning of motors and for establishing communication with external controllers.
The Arduino Micro performs the auto-tuning task when interfaced with MATLAB Simulink in external mode. The main purpose of considering Arduino Micro as the on-board micro-controller is because there is an Arduino Hardware add-on that Simulink supports which is lucid to develop and deploy. Also, Arduino Micro has the provision of UART communication and five external interrupt pins that are required to interface with incremental encoders. The onboard micro-controller is also fed with different drive functions which makes the motor controlling task very easy for naive users. We have built functions including acceleration, de-acceleration, 2-wheel drive equation, position tuning which are used for embedded robotics applications.
This are the schematics of the boards that were designed
This are the board images before manufacturing.
Control system:
We used MATLAB which supports an add-on system-identification app that helps in such physical hardware-based model tuning. This system-identification app develops a transfer function based on the input and output response provided. Motor-controller tuning is done with the help of encoder feedback. The encoder output is in the form of high-low pulses, these pulses are converted to ticks and then to determine the speed in RPM. A Simulink model is deployed to determine the output speed response at a particular input. This model is developed with the help of Arduino Hardware Add-on. The Arduino Hardware add-on features various blocks with different functions like digital input, digital output, PWM, External interrupt, etc. These blocks along with other Simulink blocks are used to generate the output speed response in real-time running on external mode.
To control and drive the hardware according to the need, the algorithms are built and the codes are executed on ATMega32u4. UART is used to communicate between the other master micro-controller and the motor-controller unit that we built. Each instruction to be fed is broken down and packed together in a block before transmission.
A MATLAB Simulink model is deployed on the onboard ATMega32u4 to obtain the auto-tuned PID constants to control the motor. These constants are then fed to the motor control equations to perform the desired operation. PID tuning is possible in two ways 1) Physical tuning 2) Model-based tuning. Physical tuning is the manually tweaking of constants by running the trial and error approach on physical hardware, whereas the model-based tuning is creating a mathematical model of the system by different equations and then simulating the model to obtain the PID constants[8]. The physical tuning is rather time-consuming and tedious; also the model-based tuning requires a lot of mathematics. In order to overcome these problems,system-identification is implemented on the motor driver unit. This process is building the mathematical structure of dynamic systems by knowing the input and output response of the system.
MATLAB supports an add-on system-identification app that helps in such physical hardware-based model tuning. This system-identification app develops a transfer function based on the input and output response provided. Motor-controller tuning is done with the help of encoder feedback. The encoder output is in the form of high-low pulses, these pulses are converted to ticks and then to determine the speed in RPM. A Simulink model is deployed to determine the output speed response at a particular input. This model is developed with the help of Arduino Hardware Add-on which is also an external hardware add-on available in MATLAB Simulink. The Arduino Hardware add-on features various blocks with different functions like digital input, digital output, PWM, External interrupt, etc. These blocks along with other Simulink blocks are used to generate the output speed response in real-time running on external mode. The matlab models are shown below:
The transfer function is then put in as a model and the PID constants are developed by the auto-tune PID block of Matlab as shown in the figure. The PID constants are then obtained as a result of the auto-tuning process[8]. The resultant constants are then passed to the drive functions as parameters to perform the motor control applications.
To control and drive the hardware according to the need, the algorithms are built and the codes are executed in ATMega32u4. UART is used to communicate between the other master microcontroller and the motor-controller unit that we built. Each instruction is broken down and packed together in a block before transmission.
Length of Block (8-bits) |
Address (8-bits) |
Instruction Code (8-bits) |
Parameters (0-64 bits) |
Checksum (8-bits) |
We made drive_M1 (Address, PWM) and drive_M2 (Address, PWM) are used to rotate the channel 1 motor and channel 2 motor respectively, the address of the particular motor-controller is given, along with the PWM. At PWM 0 the motor stops and at PWM 1 to 127 the motor moves in a clockwise direction and PWM -1 to -127 the motor moves in an anti-clockwise direction. Block received by the motor-controller.
Thus , We have implemented a dual-channel motor-controller unit which is successfully auto-tuned for both loads using the system-Identification process and controlled using the drive control algorithms. It is inferred that the PID tuning is possible in a simpler yet accurate approach using the system-identification on MATLAB Simulink as compared to the physical and model-based tuning. Also, it is feasible in robotics and industrial automation for high current application . It is practically concluded that the motor-controller efficiently satisfies the high-current load requirements and it can be further developed to be controlled using IoT applications.
The output of RPM response was for 24V 40A MOTOR LOAD.
However, earlier the hardware is in the workshop so i wasn't able to shoot a video , as covid-19 Lockdown is strict.
The complete article was also submitted to an Indian Journal we can check it on the link below: https://www.researchgate.net/publication/340528203_Auto-Tuning_High_Current_Dual-Channel_Motor_Control_Unit_with_Communi…
UPDATE : UPLOADED VIDEO LINK
https://drive.google.com/file/d/1tX5lXtLoJsmnmvKpQF2POsZBqqqhumIL/view?usp=sharing
Thanks Regards !
Shreyas Borse