CEB Press/Manufacturing Instructions/Control Source Code v1.0 Explained
- 1 Introduction
- 2 Changes since v1.0
- 3 Code Testing Procedure
Last updated August 25, 2011.
Notes: Orientation of CEB machine is defined by machine user facing the control panel, where the control panel is located to the left of the secondary cylinder attachment to the secondary arms. 3 magnets (sensor actuators) are used for main cylinder, 3 magnets for soil drawer. (2 magnets are are used for soil grate shaker sensor, optional and discontinued in 2011). Copyright April 2010, Creative Commons CC-BY-SA-compatible Open Source Ecology (OSE) License, by Marcin Jakubowski, Ph.D., for OSE.
This code and other documentation is available at the Open+Pario project management site under the CEB Project, under Documents - Liberator Beta 2.0 Control Code, http://openpario.net/projects/OSE.
Changes since v1.0
The 2011 production run features controller boards produced by Blair Evans of the Detroit Fab Lab. This particular board results in modifications to the code, in that the threshold values read by the Arduino from the Hall Effect sensors are 80 instead of 500.
That should be the only change, and the new source code is here: http://openpario.mime.oregonstate.edu/documents/1251
Code Testing Procedure
Upon receipt of a CEB machine, the following procedure should be followed in preparation for field use:
- Identify orientation of position magnets.
- Adjust position of sensor holders.
- Connect controller to battery power and connect control Arduino to a control computer
- Test solenoid valves manually with CEB Testing program - without hydraulic power
- Test solenoid valves manually with CEB Testing program - with hydraulic power
- Test automatic motion of secondary cylinder alone.
- Test automatic motion of main cylinder alone.
- Test full motion of the machine without soil
Upon receipt of the machine, the position supermagnets should be in their correct position. If they have been moved during shipping, they need to be stuck onto the magnet holder in the correct (+ and -) orientation with respect to the north or south pole facing up or down.
To orient the magnets - use the indicator lights in the circuit as suggested in CEB_Press/Manufacturing_Instructions/Controller_Box#Testing_from_Zero - in particular - steps 9-17. This test should be done without live hydraulic power.
To orient the magnets, test the sensors with th e controller testing interface (Fig. 1) by pressing on the Sensor 1 or Sensor 2 button.
The high side of the magnet (+) will be identified when the corresponding sensor LED blinks. This must be done for both the primary and secondary cylinder sensors.
There are 3 position magnets for each sensor. These should be oriented such that the + faces of the magnets are on the outside, and the - face is in the middle. This applies to both sensors.
Sensor Holder Position
- Adjust the sensor holder so that the sensor tube is about 1/8" away from the magnet. The orientation of the sensor tube does matter - the side marked with a line should be the upper face of the Hall Effect sensor. If the marking is absent, test the orientation with the Controller Testing GUI.
-- OSECEBTest2.pde - This is testing code for the secondary cylinder. This code moves the secondary cylinder between the 3 magnet locations, stopping for 1 second at each location.
Battery Power and Arduino Hookup
- Connect the alligator clip power leads to the battery. The white wire is + of the battery, and the black wire is - of the battery. Polarity matters - you will burn out the controller if the polarity is reversed. NOTE: polarity reversal protection should be included in future versions.
- Connect the USB cord from the control computer to the Arduino
Manual Testing of Solenoid Valves
- Use the GUI (see CEB_Press/Manufacturing_Instructions/Controller_Box#Testing_from_Zero) to test the solenoid valve. Test each channel of the solenoid valve by itself, to make sure that it is activated. Proper activation is determined by: (1) an audible click of the solenoid inside the valve; and (2), lighting up of the corresponding indicator light on both the solenoid driver board and the solenoid itself. Each solenoid should display a green light on the top solenoid and a red light on the bottom solenoid.
Manual Testing of Solenoid Valves Under Hydraulic Power
Warning: Before connecting hydraulic power to the system, make sure that a safety bypass valve is installed and set at its lowest setting (500psi or lower).
- Connect the hydraulic power unit to the system and turn the hydraulic power unit on. Turn the power on idle.
- At this point, the system is under pressure and should be treated with caution. To perform this test safely, the operator must be aware which solenoid port corresponds to which direction of the cylinder. Note that the controller testing code activates the corresponding solenoid for 1 second.
- The convention for direction of motion is: (1), Port A on the solenoid valve (labeled on top of aluminum body next to work ports) is activated by the bottom terminal connections on the solenoid valve; (2), Port B is activate by the top terminals.
- Determine where each port leads to - in terms of bottom or top of hydraulic cylinder. This will determine the direction of motion of the cylinder.
- Move the hydraulic cylinders back and forth, while not hitting the terminal positions to avoid the engine stalling in idle.
- Start with secondary cylinder, which puts out less force
- Complete the test with the main cylinder
Automated Testing of Solenoid Valves
Download testing code for secondary (soil-loading drawer) cylinder
This is a walk through the testing setup including wiring and hookup of the hydro-electric system:
This is a result of secondary cylinder testing: the cylinder moves between 3 magnet locations, the outer ones being + and the middle one being -, as tested with the test GUI.
Here is an explanation of connection and testing procedures as embodied in the Arduino testing code for the secondary cylinder (see OSECEBTest1.pde). This explains pinout and wiring procedures
The pin assignments on the solenoid driver board are pins 1-5 corresponding to the test GUI. On the physical controller, these are 1-5 going from the bottom to the top of the board on the controller. The corresponding channels on the Arduino are:
Top connection of solenoid 2
Port B goes to bottom of drawer cylinder
Bottom connection of solenoid 2
Port A goes to top of drawer cylinder
There are 3 solenoids, the leftmost corresponding to the main cylinder, the middle to the secondary cylinder, and the rightmost to the grate shaker. The rightmost is a motor valve – allowing freewheeling upon turnoff, and the left 2 are cylinder valves – closing ports upon stop of motion.
The solenoids are bi-directional. Two directions of motion apply to the cylinders, and one direction of motion applies to the shaker motor. It is important to connect hoses to the shaker motor such that the case drain return goes to the return line, not the power line.
The electrical connections on the solenoid are such that the common connection is removed from between 2 pins on the bottom right. The upper electrical connection opens up port B, and the bottom electrical connection opens up port A. These ports are labeled on top of the aluminum body. One can test this by activating either port and blowing through the valve to determine which port is open.
For the sensors, the main cylinder sensor is on channel analog 0 (A0, or Digital 14) on the Arduino, and the secondary cylinder is on channel analog 1 (A1, or digital 15).
Here is the result for the secondary cylinder:
Testing procedure, analogous to secondary cylinder testing:
- Download the control code for the main cylinder: [ OSECEBTest2.pde]
- Use CEB Electronics Test Application to determine magnet orientation as discussed for secondary cylinder testing.
- Place magnets in [+ - +] configuration on main cylinder magnet attachment bar.
- Open up Arduino Environment, open OSECEBTest2.pde, and upload it to the controller Arduino.
- Wire the solenoid driver pin 4 to the BOTTOM electrical connection of the leftmost hydraulic solenoid.
- Wire the solenoid driver pin 5 to the TOP electrical connection of the leftmost hydraulic solenoid.
- Connect the hose from port B of the solenoid valve to the BOTTOM port of the main hydraulic cylinder.
- Connect the hose from port A of the solenoid valve to the TOP port of the main hydraulic cylinder.
Upper Electrical Connection of solenoid 3
Port B is power
Top electrical connection of solenoid 2
Port B goes to bottom of drawer cylinder
Bottom electrical connection of solenoid 2
Port A goes to top of drawer cylinder
Bottom Electrical Connection of solenoid 1
Port A goes to top of main cylinder
Upper Electrical Connection of solenoid 1
Port B goes to bottom of main cylinder