Difference between revisions of "ECE597 Fall2014 Ringing Servos"

From eLinux.org
Jump to: navigation, search
(Electrical Hardware)
m (Switched to Fall 2014)
 
(52 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:ECE597 |Px]]
+
[[Category:ECE497Fall2014]]
 
{{YoderHead}}
 
{{YoderHead}}
  
Line 9: Line 9:
  
 
<pre style="color:red">
 
<pre style="color:red">
00 Executive Summary
+
08 Executive Summary
00 Installation Instructions  
+
10 Installation Instructions - Wow, nice complete list of parts and assembly.
00 User Instructions
+
08 User Instructions
00 Highlights
+
09 Highlights
00 Theory of Operation
+
08 Theory of Operation  
00 Work Breakdown
+
10 Work Breakdown
00 Future Work
+
09 Future Work
00 Conclusions
+
09 Conclusions
00 Demo
+
10 Demo
00 Late
+
10 Not Late
Comments: I'm looking forward to seeing this.
+
Comments: Thanks for the video
  
Score:  10/100
+
Score:  91/100
 
</pre>
 
</pre>
  
Line 27: Line 27:
  
 
== Executive Summary ==
 
== Executive Summary ==
 
+
<pre style="color:red">
The goal of the project at this moment is to use a cape that gives the BeagleBone usage of 32 PWM ports and to attach servo motors to it. The servo motors will then drive a mechanism that will ring bells of sorts. We have successfully used the PWM cape to drive a servo to a specified position using a shell script. This was more difficult than it was originally thought, because the cape uses I2C1 on the board, which is I2C2 in software, and because there were multiple other configurations we needed to change to set up the cape. We use a JavaScript program to output I2C messages to the cape to control the servos. The servos are connected to a mechanism with two bells, and when the servo rotates the bells ring. The bells do not require a great amount of movement to ring, but need to be oriented correctly to get the best sound, so the program only moves the servo about 15 degrees away from the center in either direction. From this, we have learned that JavaScript was a poor choice for a project as time-sensitive as this. The asynchronous nature of the language has made it all-but impossible to control timing when using multiple threads. For this reason, we have begun the process of porting our software to C.
+
This rambles a bit.  Too much history, just report on what's working.
 
+
Consider using the outline given in the template.
+
</pre>
Give two sentence intro to the project.
+
The goal of the project at this moment is to use a cape that gives the BeagleBone usage of 32 PWM ports and to attach servo motors to it. The servo motors will then drive a mechanism that will ring bells of sorts. We have successfully used the PWM cape to drive a servo to a specified position using a shell script. We used a JavaScript program to output I2C messages to the cape to control the servos. The servos are connected to a mechanism with two bells, and when the servo rotates the bells ring. The bells do not require a great amount of movement to ring, but need to be oriented correctly to get the best sound, so the program only moves the servo about 15 degrees away from the center in either direction. For various reasons, we ported our software to C. At this point the C program can control the servers simultaneously, but we believe that we are hitting the transfer rate limit of I2C because we have to send four commands for each movement of each servo, and we send these four commands to each servo every 15 ms.
 
 
Give two sentences telling what works.
 
 
 
Give two sentences telling what isn't working.
 
 
 
End with a two sentence conclusion.
 
 
 
The sentence count is approximate and only to give an idea of the expected length.
 
  
 
== Hardware ==
 
== Hardware ==
Line 56: Line 48:
 
* X5 per Servo Mount, X16 per Rack [http://www.mcmaster.com/#90272a081/=un31y8 2-56 X 1/2" Screw]
 
* X5 per Servo Mount, X16 per Rack [http://www.mcmaster.com/#90272a081/=un31y8 2-56 X 1/2" Screw]
 
* X2 per Servo Mount [http://www.mcmaster.com/#90631a003/=un32b1 2-56 Nyloc Nut]
 
* X2 per Servo Mount [http://www.mcmaster.com/#90631a003/=un32b1 2-56 Nyloc Nut]
 +
* X2 per Servo Mount [http://www.mcmaster.com/#96659a101/=un53ul #4 Washer]
  
The bells used are bells provided to us by Dr. Yoder, orriginating from Hobby Lobby.
+
The bells used are bells provided to us by Dr. Yoder, originating from Hobby Lobby.
  
 
To build the Servo Mount, pieces were cut out from acrylic sheets. The links lead to DXF files. To download, rightclick and click save link as.  
 
To build the Servo Mount, pieces were cut out from acrylic sheets. The links lead to DXF files. To download, rightclick and click save link as.  
  
* X2 @ 0.125 [https://raw.githubusercontent.com/randman2011/ECE597-RingingBells/master/Drawings/FinalCuts/Bell%20Twist.DXF Bell_Twist.DXF]
+
* X2 @ 0.125 in [https://raw.githubusercontent.com/randman2011/ECE597-RingingBells/master/Drawings/FinalCuts/Bell%20Twist.DXF Bell_Twist.DXF]
* X1 @ 0.125 [https://raw.githubusercontent.com/randman2011/ECE597-RingingBells/master/Drawings/FinalCuts/ServoConnection.DXF Servo_Connection.DXF]
+
* X1 @ 0.125 in [https://raw.githubusercontent.com/randman2011/ECE597-RingingBells/master/Drawings/FinalCuts/ServoConnection.DXF Servo_Connection.DXF]
* X1 @ 0.25 [https://raw.githubusercontent.com/randman2011/ECE597-RingingBells/master/Drawings/FinalCuts/Base.DXF Base.DXF]
+
* X1 @ 0.25 in [https://raw.githubusercontent.com/randman2011/ECE597-RingingBells/master/Drawings/FinalCuts/Base.DXF Base.DXF]
* X4 @ 0.25 and X2 @ 0.125 [https://raw.githubusercontent.com/randman2011/ECE597-RingingBells/master/Drawings/FinalCuts/Spacer.DXF Spacer.DXF]
+
* X4 @ 0.25 in and X2 @ 0.125 in [https://raw.githubusercontent.com/randman2011/ECE597-RingingBells/master/Drawings/FinalCuts/Spacer.DXF Spacer.DXF]
  
 
To build the Mounting Racks, pieces were cut out from acrylic sheets. The links lead to DXF files. To download, rightclick and click save link as.  
 
To build the Mounting Racks, pieces were cut out from acrylic sheets. The links lead to DXF files. To download, rightclick and click save link as.  
  
* X1 @ 0.125 [https://raw.githubusercontent.com/randman2011/ECE597-RingingBells/master/Drawings/FinalCuts/LowerRack.DXF LowerRack.DXF]
+
* X1 @ 0.125 in [https://raw.githubusercontent.com/randman2011/ECE597-RingingBells/master/Drawings/FinalCuts/LowerRack.DXF LowerRack.DXF]
* X1 @ 0.25 [https://raw.githubusercontent.com/randman2011/ECE597-RingingBells/master/Drawings/FinalCuts/TopRack.DXF TopRack.DXF]
+
* X1 @ 0.25 in [https://raw.githubusercontent.com/randman2011/ECE597-RingingBells/master/Drawings/FinalCuts/TopRack.DXF TopRack.DXF]
* X16 @ 0.125 [https://raw.githubusercontent.com/randman2011/ECE597-RingingBells/master/Drawings/FinalCuts/Latch.DXF Latch.DXF]
+
* X16 @ 0.125 in [https://raw.githubusercontent.com/randman2011/ECE597-RingingBells/master/Drawings/FinalCuts/Latch.DXF Latch.DXF]
  
 +
==== Electrical Hardware ====
  
==== Electrical Hardware ====
+
A BeagleBone is the bread and butter of the project, driving the entire effort. In case you dont have one, you can get one [http://www.digikey.com/product-search/en?lang=en&site=us&keywords=BB-BBLK-000-REVC-ND here]!
  
 
To drive all these the following cape was used:
 
To drive all these the following cape was used:
Line 79: Line 73:
 
* [http://elinux.org/CircuitCo:PWM_Cape PWM Cape]
 
* [http://elinux.org/CircuitCo:PWM_Cape PWM Cape]
  
The electrical circitry for the detector was made a few components. Additional components may be needed if you don't want to make perminant additions to the cape.
+
The electrical circuitry for the detector was made a few components. Additional components may be needed if you don't want to make permanent additions to the cape.
  
 
Each detector comprises of:
 
Each detector comprises of:
Line 86: Line 80:
 
* X1 [http://www.digikey.com/product-detail/en/CFR-25JB-52-10K/10KQBK-ND/338 10K Ohm]
 
* X1 [http://www.digikey.com/product-detail/en/CFR-25JB-52-10K/10KQBK-ND/338 10K Ohm]
 
* X1 [http://www.digikey.com/product-detail/en/CF14JT150R/CF14JT150RCT-ND/1830603 150 Ohm]
 
* X1 [http://www.digikey.com/product-detail/en/CF14JT150R/CF14JT150RCT-ND/1830603 150 Ohm]
[[File:ProximitySensor.png|thumbnail]]
+
[[File:ProximitySensor.png]]
 +
 
 +
We also created an expansion board to allow us to access the GPIO ports that would otherwise be covered by the PWM cape. It brings the I2C and enable signals to the cape and leaves the rest of the headers on the BBB open.
 +
 
 +
[[File:ExpansionBoard.jpg|720px]]
  
 
== Mechanical Assembly ==
 
== Mechanical Assembly ==
 
==== Servo Mount Assembly ====
 
==== Servo Mount Assembly ====
  
#
+
1. Collect all the materials and tools you will use. In terms of tools, you will need a 2-56 tap, a 4-40 tap, a 10-24 tap, as well as tools to attach the screws/nuts.
#
+
 
#
+
[[File:Step1ServoMount.jpg|720px]]
#
+
 
#
+
2. First thing first, you need to tap the right holes. The two large holes on the Base are 10-24, the holes above and below the hole for the servo to sit in on the Base are 2-56. The hole further from the large hole on the Bell_Twist need to be tapped to 4-40. Also, depending on your horn (the thing that spins on the servo motor), you may need to widen the holes present there.
 +
 
 +
[[File:Step2ServoMount.jpg|720px]]
 +
 
 +
3. Ensure that the horn is vertical when the servo is at 90 degreees. After that, attach the servo, the two Bell_Twists, and the Servo_Connection to each other with the 2-56 screws and nuts as seen in the picture below. The screw and nut should hold the peices firmly together, but still allow for easy pivoting.
 +
 
 +
[[File:Step3ServoMount.jpg|720px]]
 +
 
 +
4. Next is to add the shoulder screw and spacers. The order which the peices should be on the screw, from the head of the screw, is the 0.125 in Spacer, the Bell_Twist, and then two 0.25 in Spacers.
 +
 
 +
[[File:Step4ServoMount.jpg|720px]]
 +
 
 +
5. Now comes the time to attach the servo assembly to the Base. Simply slide it in and screw in the two shoulder screws into the Base. Follow that up with adding two 2-56 screws with washers, to hold the servo down firmly.
 +
 
 +
[[File:Step5ServoMount.jpg|405px]]
 +
 
 +
6. The bells you select may need some prep work. The ones we recieved had tinsle and little cards on them. This needs to be removed so you only have bells.
 +
 
 +
[[File:Step6ServoMount.jpg|405px]]
 +
 
 +
7. The final step is to attach the bells to the bell-less servo mount. Use the two 4-40 screws to do so.
 +
 
 +
[[File:Step7ServoMount.jpg|720px]]
  
 
==== Rack Holder Assembly ====
 
==== Rack Holder Assembly ====
  
#
+
1. Collect all the materials and tools you will use. In terms of tools, you will need a 2-56 tapas well as probably a screwdriver to attach the screws.
#
+
 
#
+
[[File:Step1Rack.jpg|720px]]
#
 
#
 
  
== Electrical Assembly ==
+
2. On the LowerRack, tap all the small holes as 2-56. There should be a total of 16.
 +
 
 +
[[File:Step2Rack.jpg|720px]]
 +
 
 +
3. Place on top of the Lower Rack the TopRack. The small holes should align over each other. Then screw in a 2-56 screw, with a latch as well. To restate this, the screw should pass, from head down, the latch, the TopRack, and then the LowerRack. The screw should be just tight enough to hamper motion of the latch, but not enough to stop it.
  
==== Other Stuff....cause work in progress ====
+
[[File:Step3Rack.jpg|405px]]
  
* Project materials are at [https://github.com/randman2011/ECE597-RingingBells https://github.com/randman2011/ECE597-RingingBells].  Clone the repository to find a read-me and code to get started.
+
==== Rack Holder Assembly ====
* Use a [[CircuitCo:PWM_Cape|PWM Cape]] to expand the PWM functionality of the Beaglebone.
+
 
* Attach bells to the servos so they will ring with minimal servo movement.
+
The final assembly should look something like this. Each assembly consists of four servo mounts and a single rack. If done correctly, everything should slide sunggly into each other and hold quite respectably.
* Run the "RingerScript.js" program.
 
  
----
+
[[File:FinalProductRingingServos.jpg|720px]]
  
Give step by step instructions on how to install your project. 
+
== Electrical Assembly ==
  
 +
* Project materials are at [https://github.com/randman2011/ECE597-RingingBells https://github.com/randman2011/ECE597-RingingBells].  Clone the repository to find a README and code to get started.
 +
* Use a [[CircuitCo:PWM_Cape|PWM Cape]] to expand the PWM functionality of the Beaglebone.
 +
* Execute the makefile and run the RingerScript program.
 
* The GitHub repository containing all of our software can be located here:  [https://github.com/randman2011/ECE597-RingingBells https://github.com/randman2011/ECE597-RingingBells].  
 
* The GitHub repository containing all of our software can be located here:  [https://github.com/randman2011/ECE597-RingingBells https://github.com/randman2011/ECE597-RingingBells].  
* Be sure your README.md is includes an up-to-date and clear description of your project so that someone who comes across you git repository can quickly learn what you did and how they can reproduce it.
+
* No additional configuration or setup steps are needed. Once cloned, the project is ready to be compiled.
* Include a Makefile for you code.
 
* Include any additional packages installed via '''opkg'''.
 
* If there is extra hardware needed, include links to where it can be obtained.
 
  
 
== User Instructions ==
 
== User Instructions ==
 +
<pre style="color:red">
 +
Could you give these as step-by-step instructions, showing what to type and
 +
what output to expect?
 +
</pre>
  
Executing the makefile will create a RingerScript executable. The executable sets up separate threads automatically, so all the user has to do is execute it. The ringing of the bells is controlled by the proximity sensor LEDs. Waving a hand in front of them will trigger the board to begin ringing the associated bells. Execution continues until the SIGINT command is sent via terminal.
+
Execute the makefile by running the following command from the project directory:
 +
<pre>
 +
bone$ git pull
 +
bone$ make
 +
</pre>
 +
This will update the project files and then create a RingerScript executable. The executable sets up separate threads, initializes the I2C interface, and configures the cape automatically, so all the user has to do is execute it.  
 +
<pre>
 +
bone$ ./RingerScript
 +
</pre>
 +
The ringing of the bells is controlled by the proximity sensor LEDs. Waving a hand in front of them will trigger the board to begin ringing the associated bells. Execution continues until the SIGINT (CTRL + C) command is sent via terminal.
  
 
== Highlights ==
 
== Highlights ==
 
+
Check out the bells in motion in this [https://www.youtube.com/watch?v=Di0t_z5XyyQ&feature=youtu.be Youtube] video!
Here is where you brag about what your project can do.
 
 
 
Include a [http://www.youtube.com/ YouTube] demo.
 
  
 
== Theory of Operation ==
 
== Theory of Operation ==
 
+
<pre style="color:red">
Give a high level overview of the structure of your softwareAre you using GStreamer?  Show a diagram of the pipelineAre you running multiple tasks?  Show what they do and how they interact.
+
Give more detail on how the i2c command rings the bell.
 +
</pre>
 +
The main process thread spawns a number of worker threads, each of which will poll the associated GPIO pins continuously. When the input drops below the threshold, the thread sends a command via I2C to ring the associated bell.  The I2C commands sent set two 16 bit registers that define the PWM signal the cape sends to a particular port.  The registers define the times of the rising and falling edges of the PWM signalThe PWM pulse width sets the angle of the servoUsing multiple I2C commands with a delay between them, the servo can be moved back and forth around a center of 90 degrees to create a ringing motion to ring the bells.
  
 
== Work Breakdown ==
 
== Work Breakdown ==
  
 
While we all took part in all the components, each one of us took lead in a particular field:
 
While we all took part in all the components, each one of us took lead in a particular field:
* Mark took lead in desinging the electrical hardware.
+
* Mark took lead in designing the electrical hardware. He also, took charge of coding at the end, due to his extensive experience in C.
* Peter was the brainchild behind the physical mounts and the mechanical design.  
+
* Peter was the brainchild behind the mechanical aspect of the project. He is also the one who spent a considerable effort bringing up the eLinux page to a respectable state!
* Randy was the architect of the software that drove the bells and servos.
+
* Randy was the architect of the JavaScript software that drove the bells and servos, building most of the program that later got converted into C.
  
 
== Future Work ==
 
== Future Work ==
 
* The current I/O being used is using an IR detector and IR LED. The detection range of our set up is not that long. It would be intresting to see an improvement on this scheme.  
 
* The current I/O being used is using an IR detector and IR LED. The detection range of our set up is not that long. It would be intresting to see an improvement on this scheme.  
 
* Other hardware inputs could also be looked at, from as simple as push buttons to a Rube Goldberg like contraption.
 
* Other hardware inputs could also be looked at, from as simple as push buttons to a Rube Goldberg like contraption.
* In addition to hardware inputs, software inputs of various type could be looked at. These wern't looked at as deeply as we would have liked to, due to the limitation of time. A great suggestion would be to use Crontab.
+
* In addition to hardware inputs, software inputs of various type could be looked at. These weren't looked at as deeply as we would have liked to, due to the limitation of time. Potential control schemes include:
 +
** MIDI Inputs
 +
** Chrontab
 +
* The PWM cape supports simultaneous control of all PWM outputs. This eliminates the need for multiple threads and would also eliminate the I2C bus saturation that we are experiencing. If the application demands that all bells ring at once, this is a much better solution. The hardware addresses to control them all are as follows:
 +
** 250 0xFA ALL_LED_ON_L
 +
** 251 0xFB ALL_LED_ON_H
 +
** 252 0xFC ALL_LED_OFF_L
 +
** 253 0xFD ALL_LED_OFF_H
  
 
== Conclusions ==
 
== Conclusions ==
  
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.
+
We'd like to thank Dr. Yoder for providing us the materials and technical expertise to make this happen. We would like to also thank the Rose-Hulman Mechanical Engineering Department for supplying all the fasteners used. Also, special thanks to Ron Hofmann to cutting out all the material with the laser cutter.
 +
 
 +
We have learned that JavaScript is a poor choice for timing-critical applications. We have also learned the limits of the onboard I2C interface, making control of all 32 channels impractical. Additionally, we discovered some oddities with the setup of the BeagleBoard itself. The PWM cape uses the I2C1 headers, but is located on i2c2 in the software. Likewise i2c1 refers to the hardware I2C2 bus. The i2c0 bus is used internally and should not be accessed directly.
  
== Stuff we found (Cause stuff is dumbz) ==
+
== Technical Notes of Interest ==
  
*i2c1=i2c2
+
* The GitHub repository containing all of our software, as well as files CAD files, can be located [https://github.com/randman2011/ECE597-RingingBells here].
*i2c2=i2c1
+
* i2cdetect -y -r 2 finds address 0x40 and 0x41, which are the chip addresses on the PWM cape.
*i2c0=???
+
* The mode register (register 0x00) of the chip on the PWM cape needs to be set in order to use the internal oscillator. It is by default disabled and cannot be enabled in "sleep mode"
*i2cdetect -y -r 2 finds address 0x40 and 0x41
+
<span style="color:red">Mode register of what?</span>
*need to set mode register (register 0x00) to not sleep mode to use the internal oscillator
 
  
 
{{YoderFoot}}
 
{{YoderFoot}}

Latest revision as of 04:11, 10 August 2015

thumb‎ Embedded Linux Class by Mark A. Yoder


Team members: Mark Morrison, Peter Olejnik, Randy Turner

Grading Template

I'm using the following template to grade. Each slot is 10 points. 0 = Missing, 5=OK, 10=Wow!

08 Executive Summary
10 Installation Instructions - Wow, nice complete list of parts and assembly.
08 User Instructions
09 Highlights
08 Theory of Operation 
10 Work Breakdown
09 Future Work
09 Conclusions
10 Demo
10 Not Late
Comments: Thanks for the video

Score:  91/100

(Inline Comment)

Executive Summary

This rambles a bit.  Too much history, just report on what's working.
Consider using the outline given in the template.

The goal of the project at this moment is to use a cape that gives the BeagleBone usage of 32 PWM ports and to attach servo motors to it. The servo motors will then drive a mechanism that will ring bells of sorts. We have successfully used the PWM cape to drive a servo to a specified position using a shell script. We used a JavaScript program to output I2C messages to the cape to control the servos. The servos are connected to a mechanism with two bells, and when the servo rotates the bells ring. The bells do not require a great amount of movement to ring, but need to be oriented correctly to get the best sound, so the program only moves the servo about 15 degrees away from the center in either direction. For various reasons, we ported our software to C. At this point the C program can control the servers simultaneously, but we believe that we are hitting the transfer rate limit of I2C because we have to send four commands for each movement of each servo, and we send these four commands to each servo every 15 ms.

Hardware

Mechanical Hardware

Two diffrent types of servos were used. These were used with simmilar results.

The following quantaties of fasterners were used as well. All were obtained from McMaster-Carr

The bells used are bells provided to us by Dr. Yoder, originating from Hobby Lobby.

To build the Servo Mount, pieces were cut out from acrylic sheets. The links lead to DXF files. To download, rightclick and click save link as.

To build the Mounting Racks, pieces were cut out from acrylic sheets. The links lead to DXF files. To download, rightclick and click save link as.

Electrical Hardware

A BeagleBone is the bread and butter of the project, driving the entire effort. In case you dont have one, you can get one here!

To drive all these the following cape was used:

The electrical circuitry for the detector was made a few components. Additional components may be needed if you don't want to make permanent additions to the cape.

Each detector comprises of:

ProximitySensor.png

We also created an expansion board to allow us to access the GPIO ports that would otherwise be covered by the PWM cape. It brings the I2C and enable signals to the cape and leaves the rest of the headers on the BBB open.

ExpansionBoard.jpg

Mechanical Assembly

Servo Mount Assembly

1. Collect all the materials and tools you will use. In terms of tools, you will need a 2-56 tap, a 4-40 tap, a 10-24 tap, as well as tools to attach the screws/nuts.

Step1ServoMount.jpg

2. First thing first, you need to tap the right holes. The two large holes on the Base are 10-24, the holes above and below the hole for the servo to sit in on the Base are 2-56. The hole further from the large hole on the Bell_Twist need to be tapped to 4-40. Also, depending on your horn (the thing that spins on the servo motor), you may need to widen the holes present there.

Step2ServoMount.jpg

3. Ensure that the horn is vertical when the servo is at 90 degreees. After that, attach the servo, the two Bell_Twists, and the Servo_Connection to each other with the 2-56 screws and nuts as seen in the picture below. The screw and nut should hold the peices firmly together, but still allow for easy pivoting.

Step3ServoMount.jpg

4. Next is to add the shoulder screw and spacers. The order which the peices should be on the screw, from the head of the screw, is the 0.125 in Spacer, the Bell_Twist, and then two 0.25 in Spacers.

Step4ServoMount.jpg

5. Now comes the time to attach the servo assembly to the Base. Simply slide it in and screw in the two shoulder screws into the Base. Follow that up with adding two 2-56 screws with washers, to hold the servo down firmly.

Step5ServoMount.jpg

6. The bells you select may need some prep work. The ones we recieved had tinsle and little cards on them. This needs to be removed so you only have bells.

Step6ServoMount.jpg

7. The final step is to attach the bells to the bell-less servo mount. Use the two 4-40 screws to do so.

Step7ServoMount.jpg

Rack Holder Assembly

1. Collect all the materials and tools you will use. In terms of tools, you will need a 2-56 tapas well as probably a screwdriver to attach the screws.

Step1Rack.jpg

2. On the LowerRack, tap all the small holes as 2-56. There should be a total of 16.

Step2Rack.jpg

3. Place on top of the Lower Rack the TopRack. The small holes should align over each other. Then screw in a 2-56 screw, with a latch as well. To restate this, the screw should pass, from head down, the latch, the TopRack, and then the LowerRack. The screw should be just tight enough to hamper motion of the latch, but not enough to stop it.

Step3Rack.jpg

Rack Holder Assembly

The final assembly should look something like this. Each assembly consists of four servo mounts and a single rack. If done correctly, everything should slide sunggly into each other and hold quite respectably.

FinalProductRingingServos.jpg

Electrical Assembly

User Instructions

Could you give these as step-by-step instructions, showing what to type and
what output to expect?

Execute the makefile by running the following command from the project directory:

bone$ git pull
bone$ make

This will update the project files and then create a RingerScript executable. The executable sets up separate threads, initializes the I2C interface, and configures the cape automatically, so all the user has to do is execute it.

bone$ ./RingerScript

The ringing of the bells is controlled by the proximity sensor LEDs. Waving a hand in front of them will trigger the board to begin ringing the associated bells. Execution continues until the SIGINT (CTRL + C) command is sent via terminal.

Highlights

Check out the bells in motion in this Youtube video!

Theory of Operation

Give more detail on how the i2c command rings the bell.

The main process thread spawns a number of worker threads, each of which will poll the associated GPIO pins continuously. When the input drops below the threshold, the thread sends a command via I2C to ring the associated bell. The I2C commands sent set two 16 bit registers that define the PWM signal the cape sends to a particular port. The registers define the times of the rising and falling edges of the PWM signal. The PWM pulse width sets the angle of the servo. Using multiple I2C commands with a delay between them, the servo can be moved back and forth around a center of 90 degrees to create a ringing motion to ring the bells.

Work Breakdown

While we all took part in all the components, each one of us took lead in a particular field:

  • Mark took lead in designing the electrical hardware. He also, took charge of coding at the end, due to his extensive experience in C.
  • Peter was the brainchild behind the mechanical aspect of the project. He is also the one who spent a considerable effort bringing up the eLinux page to a respectable state!
  • Randy was the architect of the JavaScript software that drove the bells and servos, building most of the program that later got converted into C.

Future Work

  • The current I/O being used is using an IR detector and IR LED. The detection range of our set up is not that long. It would be intresting to see an improvement on this scheme.
  • Other hardware inputs could also be looked at, from as simple as push buttons to a Rube Goldberg like contraption.
  • In addition to hardware inputs, software inputs of various type could be looked at. These weren't looked at as deeply as we would have liked to, due to the limitation of time. Potential control schemes include:
    • MIDI Inputs
    • Chrontab
  • The PWM cape supports simultaneous control of all PWM outputs. This eliminates the need for multiple threads and would also eliminate the I2C bus saturation that we are experiencing. If the application demands that all bells ring at once, this is a much better solution. The hardware addresses to control them all are as follows:
    • 250 0xFA ALL_LED_ON_L
    • 251 0xFB ALL_LED_ON_H
    • 252 0xFC ALL_LED_OFF_L
    • 253 0xFD ALL_LED_OFF_H

Conclusions

We'd like to thank Dr. Yoder for providing us the materials and technical expertise to make this happen. We would like to also thank the Rose-Hulman Mechanical Engineering Department for supplying all the fasteners used. Also, special thanks to Ron Hofmann to cutting out all the material with the laser cutter.

We have learned that JavaScript is a poor choice for timing-critical applications. We have also learned the limits of the onboard I2C interface, making control of all 32 channels impractical. Additionally, we discovered some oddities with the setup of the BeagleBoard itself. The PWM cape uses the I2C1 headers, but is located on i2c2 in the software. Likewise i2c1 refers to the hardware I2C2 bus. The i2c0 bus is used internally and should not be accessed directly.

Technical Notes of Interest

  • The GitHub repository containing all of our software, as well as files CAD files, can be located here.
  • i2cdetect -y -r 2 finds address 0x40 and 0x41, which are the chip addresses on the PWM cape.
  • The mode register (register 0x00) of the chip on the PWM cape needs to be set in order to use the internal oscillator. It is by default disabled and cannot be enabled in "sleep mode"

Mode register of what?




thumb‎ Embedded Linux Class by Mark A. Yoder