Reshaping the Future of Power Generation through Software
We’re helping our global manufacturing client streamline its motor management workflows for improved cost and efficiency
Web Application Development
Our client is a US-based global manufacturer of motors, bearings, gearing, conveying, blowers, electric components, and couplings. The company had a desktop application, written in Visual Basic, that was used to manage its wide array of motors across multiple industries ranging from automotive to food to industrial solutions.
This application was designed to sync with each motor’s microchip to provide a number of optimization tasks:
- Configure the optimal torque and speed for each motor application
- Run tests on each device
- Monitor the PWM (pulse width modification – a fancy way to increase motor efficiency)
In addition, the application also served as a “label editor” to print the correct manufacturer specifications for a particular motor.
The client needed us to completely “refactor” the application into a more efficient, reliable, and maintainable program that could easily scale to new motors. We jumped headfirst into the project, in collaboration with a team member from the client side who served as project lead.
Spoiler alert! The outcome was that we delivered a completely revamped application with 6-7 newly added motors. The resulting application was much easier to use, provided a better user experience, and could easily access configurations from previous projects – saving the company money and time.
This project was one of our first exposures to hardware devices. We inhabit a world of software but this project required us to shift our mindset. Now in addition to loops and functions, each team member had motor parts at their desk busily syncing code with the microchip to integrate the correct motor control response into the application.
Motors are everywhere and it’s likely that we daily interact with dozens of motors in everything from food preparation to driving to the store to washing our clothes. While we take them for granted, motors are complicated devices that come in all shapes and sizes. No one knows this better than our client, who has been producing motors across a growing variety of industries for over six decades. Refactoring our client’s “motor management” application required us to address a number of formidable challenges along the way.
Soon into our introduction to motor control and dynamics, we realized that motors have different memory structures that must be considered in refactoring the code.
For example, in the hexadecimal system, a byte 0x85 (as an example) might represent “set motor forward” command while the last two bytes 0x00 and 0x64 may represents the speed of the device. These communication bytes all differ by the particular motor and application and must be individually built into the code.
Diverse Memory Schemas
Another challenge we faced was a general lack of documentation from the previous application about the memory types for each motor. This project again required us to learn something about motor control systems. What we found was a lack of uniformity on what each byte meant. For example, sometimes the information we had read as follows:
- First byte = protocol name
- Second byte = model name
- Third/fourth byte = firmware size/length (when in reality, the second/third byte was the model name)
In other cases, the documentation might specify that motor X and motor Z have the same memory. But, in reality, the motors turned out to be 95% identical and our team needed to figure out the 5% difference.
Another challenge we faced was developer retention. Our team experienced an unusual degree of turnover during this project in a few critical roles including our technical project lead (TPL). While this was unexpected and required a lot of knowledge transfer, we fortunately had a process in place to mitigate the situation and maintain project stability more below.
Internal Retention & Team Dynamics
This was a challenging but invigorating project. It was one of our first forays into understanding the dynamics of motor control. There were some obviously new technical challenges that we had to overcome, including a general lack of documentation.
On top of that, we faced some developer retention issues. But despite these hurdles we ultimately delivered a refactored application that made the client very happy and saved the company money and time while increasing performance efficiencies. Here are some best practices and solutions that describe how we succeeded!
One of our biggest strengths on this project was an innovative and insightful approach to reverse engineering the refactoring process. One thing we addressed was the importance of increasing maintainability by grouping together similarities in code across multiple motors to make it easier to identify future issues.
We also had to be agile and efficient on this project by leveraging the resources at our disposal. The original project was written in Visual Basic version 6 (accessed via Windows XP) which we refactored into C#.
To expedite this conversion process, we tried to find a code generator to transform some of the VB code to C#. It worked partially and did save us about 40% of the time. But the generator was not exact and didn’t always convert the code into the most readable manner, which meant we still needed to make modifications.
Another best practice the team adopted was developing a logging tool to measure the responses coming from the motor. This helped us to more efficiently report the memory bytes sent/received by the motors so we could monitor any data transmission issues.
We also adopted what we call “defensive coding” to ensure the code works under all unforeseen circumstances. Here are several techniques we adopted to make the application failproof:
- Quality control checks to ensure the configuration we documented matched what was written to the motor
- Retrieving the motor memory again to double-check that the memory sent was correctly written to the motor – this served as a critical safety mechanism
- A final test comparison between the memory sent and the actual memory on the motor
A project of this nature and scope of course required a lot of old-fashioned “trial and error.” Since we were working in a completely new area of motor control, our coding knowledge and intuition only took us so far.
Since each motor had its unique set of challenges, sometimes we simply had to apply a lot of “grit” to decipher and reverse engineer the correct motor memory bytes and communications. The client would be able to provide occasional insights if two motors shared similarities. Or, if we noticed a motor was supported in VB, we could analyze the older versions of the application to decipher the correct memory information. But nothing about this project was ever straightforward.
Trial and Error + True Grit
It goes without saying that one of the keys to success on this project was a strong Technical Project Lead (TPL) and Team Lead (TL). Their attentiveness and detailed communications were like a direct line to the client. Things were clear and transparent. It also helped that our team of quality engineers had access to the client. This made it easy to ask frequent questions and to ensure our work was precisely what the client expected.
Strong TPL & TL
One of the hallmarks of our success on this project was our 4Plus1 Shadow Engineering initiative. This program adds an additional engineer to a project for every four billable engineers, so they can “shadow” and become easily integrated into an existing workflow.
4Plus1 (Shadow Engineering) Program
When we took on this refactoring project for our global manufacturing client, we knew it entailed some formidable challenges. Our team was completely new to motor control and there was no clear roadmap for how to facilitate seamless communications between the app and the motors.
There was also a general lack of documentation from the original application. But what we lacked in background experience on this project, we compensated for by applying “true grit” in hammering out a solution. We managed to develop a refactored motor management application that was much easier to use, offered a better user experience, and ultimately led the client to improved performance efficiencies resulting in true cost and time savings.
It was a win-win for everyone!
Ready to punch your win today? Contact us to learn more about our winning strategies for software project success.
Ready to see what kind of solutions we can create for you?
Contact us today!
Copyright © 2020. All rights reserved.