Sadly, this great contest has come to an end. This leaves the SteadyClip project unfinished as of right now. I’ve had a great run, but I truly do need additional time to fully understand the microstepping of motors to get a complete design. Right now, the motor drivers are functional and I am capable of accessing the IMU. Eventually, this project will be complete. When that happens I cannot wait to show it to the element14 community, and the rest of the internet.
So, what is complete and what is left to do? Well the circuit is fully assembled and working. I am able to drive the motors arms at specific voltages. In order to get the microstepping of the 3 phase motor to work, I will need to input a 3 phase sine wave into each of the PWM modules. In order to do this, I will need 3 PWM outputs to each of the 3 motors. This requires 9 independent PWMs. Luckily, the PSoC 4 has JUST enough UDB to accomplish this (actually, it is short 2 UDB blocks; I had to use the hardened timer/PWM blocks to get all 9 outputs. The resulting structure is shown below.
The preferred structure would be to use the same PWM blocks as it would facilitate firmware development. As it stands right now, I need to make sure that using the two different PWM blocks actually results in the same output. If the two PWM block types are off by one clock cycle, then the resulting waveforms will eventually become offset by a varying phase. In such a case, the microstepping of the motors would no longer be accurate.
The 3 phase sine wave can be calculated in several ways, but depending on how fast the processor can calculate the sine function, it’ll have to be through calls to the “math.h” library or a look-up table.
One of the organizers also mentioned a library that allows access to the sensor fusion data on the MPU-9150 IMU. This is definitely worth looking into as it will alleviate the processing on the PSoC.
A final piece will need to be created to connect the IMU data to the motor outputs. This is the PID machine which will stabilize the platform with error feedback. I do have some previous projects with these control schemes, but they have always been quite time consuming to configure.
Finally, the big thing left to do is testing and tweaking. Obviously something like this must be used in the field, and adjusted accordingly. While I was unable to complete the project, this contest surely gave me a head start. I am very grateful that the organizers have allowed me to participate, and I hope to see more of these contests in the future. Big thanks to element14 and its engineering community for their support.