cavenel / ev3-print3rbot

Python code for the EV3-Print3rbot, based on ev3dev project.
56 stars 35 forks source link

Motor port B running forever #4

Closed maceron4444 closed 8 years ago

maceron4444 commented 8 years ago

I've managed to get the Print3rbot up and running with all the required software, but when I run the writer.py code whatever's connected to motor port B will just run indefinitely regardless of what image I try to draw.

Has anyone else had this issue? Does this happen when the svg image doesn't have any paths? I'm most likely missing something simple here.

Thanks.

cavenel commented 8 years ago

Port B should be connected to the motor lifting the pen. It will indeed run indefinitely when started for calibration purpose. It will stop turning when it will be stopped against the red lego piece (http://img.rebrickable.com/img/pieces/elements/4227155.jpg):

self.mot_lift.rotate_forever(speed=-50, regulate='off')
    time.sleep(0.5)
    while(abs(self.mot_lift.speed) > 5):
        time.sleep(0.001)
    self.mot_lift.stop()

Basically: run forever while speed > 5. When speed < 5, stop the motor, reset the position and consider the motor calibrated.

Ports A and C should be connected to the 2 motors (left and right) giving the pen's position.

maceron4444 commented 8 years ago

Ahh I see now, how to the arms calibrate themselves? Do they move towards the bottom of what would be the image as every time I run the code now, the arms will contract towards the EV3 brick and try to keep going despite pushing the touch sensors.

I need to adjust the arm length in the code as I don't have all the parts required to build the print3rbot to the exact spec as shown in the instructions.

Thanks for the help so far :)

cavenel commented 8 years ago

I guess I can close this as it has been solved :)