deeper-blue / sdp-robot

The robot code for Deeper Blue, an assistive chess-playing robot. Developed for the System Design Project, a 3rd year course offered at the School of Informatics, University of Edinburgh.
2 stars 0 forks source link

Electromagnet Control #22

Closed pilif0 closed 5 years ago

pilif0 commented 5 years ago

Split from #9. This issue tracks progress on the grabber electromagnet control.

pilif0 commented 5 years ago

Garry suggested looking into the drivers of DC motors to see how power can be controlled.

pilif0 commented 5 years ago

I have managed to export six GPIOs (into /sys/class/gpio/) by setting the lego-port's mode to raw. These should correspond to the port's six pins. The problem is that due to permissions I cannot write to them to check that and later use them to provide the signal for the electromagnet.

We have the circuit planned out. It uses a chip to provide power to the motor based on a high/low signal. The chip we currently have borrowed for testing can only take 10 V out of the 12 V that the electromagnet is rated for. Until the pin is working, I am also not absolutely sure about the signal voltage, so we might look into getting a different version when ordering ours.

pilif0 commented 5 years ago

I have managed to gain control over the voltage between pins 3 and 5 of a lego port (0.0 V low, 2.9 V high). To replicate:

pilif0 commented 5 years ago

To allow us to write to the value file from Python at runtime, I needed to set up the environment:

This way the setup script can be run from the start script to make sure the environment is prepared before running anything (or by hand when testing).

This way the current implementation of the electromagnet in #19 works after EV3 boot a running sudo setup.sh without it asking for a password.