This week I have been troubleshooting the simulink code. There were several errors regarding missing files that I was able to fix by creating my own with the proper text. After all of these issues were resolved I encountered another error that I was unable to resolve on my own. I had a conference call with Jonathan Farrell who was unable to recreate the error on his computer which ran Mac OS. I tested the simulink on a mac provided by Dr. McColgan and the program ran without any issues.
I have also contacted tech support from MathWorks and tried to troubleshoot the problem with them to no success. I am currently awaiting further feedback from them.
Currently the plan is to employ the simulink on a windows or mac and use the SRT software on the linux. I will test out the program on a smaller motor this week.
Tuesday, February 14, 2017
Tuesday, February 7, 2017
Familiarizing myself with the motor controls
I have been reviewing the code that Jonathon Farrell developed in the summer of 2016. Here is a picture of the simulink code from Jon's blog:

A basic understanding of angle encoders is necessary to understand this code. You can find this here: http://henrysbench.capnfatz.com/henrys-bench/arduino-sensors-and-input/keyes-ky-040-arduino-rotary-encoder-user-manual/
The basic idea is that there are two switches within the angle encoder each with different phases and the code identifies where the switches are and determines which direction the encoder is moving by the change in the two switches, Then, based on the desired input, the code determines the difference in the current angle and the desired angle and tells the motor to move in the correct direction and how far. The code has various outputs so you can observe in real time which direction and what angle the motor is at.
The MatLab code appears to only measure the angle encoder and does not control the motors as is the case with the simulink code. However, I have been unsuccessful thus far in connecting the arduino to simulink. I have been able to connect it to MatLab however and hopefully there are only minor discrepancies in the process.
Based on what Jon has left for me, it should be as simple as connecting the arduino to a laptop with the code, entering a desired angle, and running the program. I aim to test this with a small motor this week.
Once this is complete I can move onto the larger motors for VIPER. However, there have been changes to the control system that I had developed in the summer of 2015 and I will need to relearn how to use it. Once I can confidently power the motors I will attempt to use the motor controlling program with them.

A basic understanding of angle encoders is necessary to understand this code. You can find this here: http://henrysbench.capnfatz.com/henrys-bench/arduino-sensors-and-input/keyes-ky-040-arduino-rotary-encoder-user-manual/
The basic idea is that there are two switches within the angle encoder each with different phases and the code identifies where the switches are and determines which direction the encoder is moving by the change in the two switches, Then, based on the desired input, the code determines the difference in the current angle and the desired angle and tells the motor to move in the correct direction and how far. The code has various outputs so you can observe in real time which direction and what angle the motor is at.
The MatLab code appears to only measure the angle encoder and does not control the motors as is the case with the simulink code. However, I have been unsuccessful thus far in connecting the arduino to simulink. I have been able to connect it to MatLab however and hopefully there are only minor discrepancies in the process.
Based on what Jon has left for me, it should be as simple as connecting the arduino to a laptop with the code, entering a desired angle, and running the program. I aim to test this with a small motor this week.
Once this is complete I can move onto the larger motors for VIPER. However, there have been changes to the control system that I had developed in the summer of 2015 and I will need to relearn how to use it. Once I can confidently power the motors I will attempt to use the motor controlling program with them.
Subscribe to:
Comments (Atom)