Week 8: October 16 23 - ngetachew/Portfolio GitHub Wiki
I spent the first part of last week continuing to comment and step through main.py
in the Robotic Arm code. This made me realize what a powerful tool PyCharm is. This tool would've been extremely useful when I was working on the Perpetual Motion Machine and the Robotic Arm because the only way we could debug those was to put print statements in all of the loops. The debugging console that PyCharm has allows us to to track the value of variables without having to edit the code.
This came in handy when I worked with Doug to figure out why certain microstepping values didn't work. We found that when 256 was passed in for micro_steps
, it would have the same effect as passing in zero. After looking through the code, we found that the mask that was used only allowed for 8 bits, so 256, which is 100000000, became 00000000, which equals zero.
Here is the code for microstepping.
`
def setMicroSteps(self, microSteps):
self.free()
stepVal = 0
for stepVal in range(0, 8):
if microSteps == 1:
break
microSteps = microSteps >> 1;
self.setParam(LReg.STEP_MODE, (0x00 | stepVal | LReg.SYNC_SEL_1))
` After this, I was gone for two days at a cross country race, so I couldn't do anything until this past Monday. I was finally assigned a project to work on. It's a board game where the goal is to move a penguin through a map to get to a goal. The map is displayed on a large screen, but the penguin is moved by a delta arm, which is just three motors working in union. The code for this was hastily prepared, but well done. However, none of it works. Our first step was rewiring the board so that the connections would be easier to see. Now we are just trying to test out the individual motors to see if they function. However, because of some version issues, we can't test it.
Here is an image of the setup:
Here is an image of the board.