lördag 5 oktober 2013

how to move a mindstorms ev3 motor to the start position.

During my build of a lego technic loom i found out that I had counted the number of needed motors wrong...
So I was one mindstorms motor short. XL or medium motors are not an alternative since I need degree precision.            
To solve the missing motor problem I built a transmission but instead of taking the output power on one axle with different speeds I have three separate axles that, one at a time, get the power.

Simple transmission with three outputs.
This configuration is working great but during the programming  I had problems with the initialization.
The power of the mindstorms motors are so great that it breaks the build and put a big stress on the frame (I had to add the long yellow beam). But with this short program the orange L-beam is turned upwards until it can't move any more.
Move to start position
It works by first reset the internal angle measurement.
Then turn on the motor for a short while.
If the angle measure block at the end returns zero degrees of movement the loop is exited.
Otherwise we run around in the loop once more.