CEB Press Control Code

From Open Source Ecology
Jump to: navigation, search

Overview

The Compressed Earth Brick Press operation is automated using a microcontroller.

Code is uploaded to the microcontroller and the microcontroller saves the code; when the microcontroller is turned on, it will run the saved code to control the other CEB Press electronics; the CEB Press operation code is written to loop so that the operator does not need to reset the microcontroller for each brick.

The code commands the microcontroller to send digital signals to the solenoid driver, which powers the hydraulic solenoid valves. The hydraulic solenoid valves open hydraulic flow to the hydraulic cylinders for motion.

Regular Operation (Continuously Press Bricks)

  • Upload the Code to the Arduino Microcontroller. The steps are explained in the following link.

http://opensourceecology.org/wiki/CEB_Press/Manufacturing_Instructions/Code_Upload

  • Power Off the CEB Press Electronics. Turning off the power to the microcontroller and solenoid driver ensures that the hydraulic solenoid valves are not activated when turning on hydraulic flow. You can do this by disconnecting the CEB electronics from both the battery and the computer.
  • Perform CEB Press Area Safety Check. Ensure that no unintended objects are in or around the CEB Press area.
  • Turn On Hydraulic Flow. Because the hydraulic solenoid valves are not activated, they will be in their neutral, open position, which allows the hydraulic fluid to directly return to the pump. If you experience operation problems, disconnect the CEB Press electronics from the battery or shut off hydraulic flow.
  • Power On the CEB Press Electronics. Connect the battery to the CEB Press Electronics. The microcontroller's LEDs should light up to show that the code is running. The solenoid driver's LEDs should light up to show which direction the hydraulic solenoid valves are being powered, if any.
  • Check Proper CEB Press Operation. Look at the motion of the CEB Press and ensure that the soil loading, soil compression, and brick ejection movements are correct. Note that the CEB Press has an initialization sequence that is not part of the operation loop.
  • Load Soil. Safely dump soil into the CEB Press hopper. You may want to view the CEB Press operation from the top of the hopper to check whether the soil is loading into the soil drawer; observe safely.
  • Check Compression Pressure. Observe the reading on the hydraulic pressure gauge during the compression. The value should be at least 2000 psi.
  • Check Compressed Earth Brick. Check the physical characteristics of the brick. Ensure that the brick is not warped (ex. curved).

Testing (Use a computer interface to control the solenoid valves independently)

  • Download the Testing Code File. This file contains the code that you will upload to the Arduino microcontroller. (Right-click the link and choose Save Link As. After downloading, ensure that the file extension is .ino. If not, rename the file)
  • Upload the Testing Code to the Arduino Microcontroller. The steps are explained in the following link.

http://opensourceecology.org/wiki/CEB_Press/Manufacturing_Instructions/Code_Upload

  • Download the Testing Interface Code File. This file contains the code that you will run in a Python interpreter. (Go to the openpario link, click on the file, then click download. After downloading, ensure that the file extension is .py. If not, rename the file)

If you are using Arduino Uno, go to the following webpage and download the CEBTestingV2Uno.py file:

http://openpario.net/documents/1261

If you are using Arduino Duemilanove, go to the following webpage and download the CEBTestingV2.py file:

http://openpario.net/documents/1260

  • Open the Testing Interface. This consists of running the Testing Code in a python interpreter.

For Linux users, open terminal and navigate in terminal to the folder containing the Testing Interface Code File. Then type python CEBTestingV2.py (Uno) or python CEBTestingV2.py (Duemilanove). The graphical user interface should pop up in a new window.

For Windows users, Install Python 2.7, PySerial(http://pyserial.sourceforge.net/) and PIL (http://www.pythonware.com/products/pil/). Open IDLE and then open the CEBTestingV2.py file.

For Mac users,

  • Power On the CEB Press Electronics. Connect the battery to the CEB Press Electronics. The microcontroller's LEDs should light up to show that the code is running.
  • Connect to the Microcontroller. In the Interface Window, click Open Connection. Click other buttons to test the CEB Press.

Mosfet C11: starts the shaker

Mosfet C10: moves the drawer right

Mosfet C9: moves the drawer left

Mosfet C6: moves the pressfoot up

Mosfet C3 moves the pressfoot down

Sensors

Sensors: Take one of the two sensor assemblies. There should be a mark on the sensor assembly noting the correct side of the sensor that you must put closest to the magnets. The Hall Effect Sensor inside the sensor tube is about 1/2" from the end of the sensor tube. When the sensor is moved over a magnet, one of the two sensor LEDs on the controller board should light up. This defines the magnet orientation for turning on the sensor. If the LED does not light up, flip the magnet onto its other face. This applies to each of the sensors. The main cylinder is connected to pin A0, and secondary cylinder is connected to pin A1. See CEB_Press/Manufacturing_Instructions/ElectrohydraulicIntegration for wiring diagram:

ElectrohydraulicIntegration part2.png

  • Setting Sensor Magnets: To set the 3 magnets for each cylinder - orient the outer magnets such that they turn the sensor on when the magnets pass the sensor assembly, and orient the middle magnet such that it turns the sensor off.

Sensormark.jpg

CEBPressV1SensorMagnet.png

  • Identifying the Sensors. The secondary cylinder (A1) sensor is connected to the upper pin of the middle terminal on the Solenoid Driver Board, and the main cylinder sensor (A0) is connected to the lower pin of the middle terminal:

LED Blink: lights the sensor LEDs on the solenoid driver board intermittently

Note: see the annotations within the code using a text editor for more details on the testing procedure

Note: look for the LEDs of the solenoid driver board and of the solenoid valves lighting up as you click on the relevant buttons within the GUI.

  • Perform CEB Press Area Safety Check. Ensure that no unintended objects are in or around the CEB Press area.
  • Lower Hydraulic Pressure for Testing. For safety lower hydraulic pressure to minimum setting by turning the pressure relief screw counterclockwise until it's loose.

  • Turn On Hydraulic Flow. Because the hydraulic solenoid valves are not activated, they will be in their neutral, open position, which allows the hydraulic fluid to directly return to the pump. If you experience control problems, disconnect the CEB Press electronics from the battery or shut off hydraulic flow.
  • Check Proper CEB Press Operation. Look at the motion of the CEB Press and ensure that Interface commands cause the correct CEB Press movements.

Other Code

Forks

Old Code



Back to Table of Contents