Difference between revisions of "Conservation of Angular Momentum Locomotion Robot (Fluffbot)"

From Mech
Jump to navigationJump to search
(New page: right == Overview == Flufbot uses conservation of angular momentum to move forward or backward, by controlling the acceleration of a momentum wheel and the an...)
 
 
(122 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[image:Snake_Robot_1.jpg|right]]
[[image:Fluff_Bot_1.jpg|right]]


== Overview ==
== Overview ==


Flufbot uses conservation of angular momentum to move forward or backward, by controlling the acceleration of a momentum wheel and the angle of a steering wheel.
Flufbot uses conservation of angular momentum to move forward or backward, by controlling the acceleration of a momentum wheel and the angle of a steering wheel.

Some videos:

[http://www.youtube.com/watch?v=jAqSzvoKiLE Fluffbot with seal casing 1]

[http://www.youtube.com/watch?v=utZnFJuoLag Fluffbot seal-on-land]

[http://www.youtube.com/watch?v=BIMgh9eEPQ4 Fluffbot seal-in-water]

[http://www.youtube.com/watch?v=Xc-FJgjFg50 Fluffbot seal-on-ice]

[http://www.youtube.com/watch?v=-XoxQAQtva4 Fluffbot seal-on-land reverse]

[http://www.youtube.com/watch?v=fzAgX4L4gHU Fluffbot bottom view of momentum and steering wheel]

[http://www.youtube.com/watch?v=3X7MnW4_8FM Fluffbot with seal casing 2]

[http://www.youtube.com/watch?v=H4ZJ47V_QE4 Fluffbot with seal casing 3]


==Team Members==
==Team Members==


//insert team picture[[image:Team23_Members.jpg|thumb|400pix|right|Hwang-Long-Smart]]
[[image:2010-25-Johnson-Pentelovitch-Yu.jpg|thumb|400pix|right|Johnson - Pentelovitch - Yu]]


*Tyler Johnson - Mechanical Engineer - Class 2011
*Tyler Johnson - Mechanical Engineer - Class 2011
Line 16: Line 34:
== Concept Overview ==
== Concept Overview ==


[[image:Serpentine_curves.jpg|thumb|300pix|right|Serpentine Curves]]
[[image:Fluffbot_Concept.jpg|thumb|700pix|right|Fluffbot Motion]]


Instead of using motors to directly drive its motion forward, Fluffbot uses the basic principal of conservation of angular momentum. When an object with a high moment of inertia is accelerated about an axis, angular momentum in the direction of motion is immediately created. When this happens, angular momentum in the opposing direction is also produced. The resulting motion from this "reaction" momentum can be transferred to ground through a rigid fixture, or this resulting motion could be controlled and channeled into a desirable form as shown with Fluffbot.
Real snake motion does not follow specified equations. However, research has proven that the serpentine motion of a snake can be modeled with the following equations (Saito etal, 72-73):


When the large flywheel on Fluffbot accelerates clockwise in the horizontal plane, the body attempts to conserve the zero angular momentum of the system by rotating around the same axis in a counter clockwise direction. Motion forward or backward by Fluffbot is made possible by the steering of the front wheel. There are three conditions for the steering wheel to be in, and three corresponding effects:
<math>x(s)= \int_{0}^{s} \cos (\zeta_\sigma) d\sigma</math>


1) Wheel is aligned straight ahead - In this scenario, friction between the front wheel and the the ground prevent any rotation along the robot's main axis of rotation. Any acceleration of the momentum wheel in this arrangement will result in no movement of Fluffbot.
<math>y(s)= \int_{0}^{s} \sin (\zeta_\sigma) d\sigma </math>


2) Wheel is turned to the left - When the momentum wheel accelerates in a clockwise direction, the chassis will attempt to rotate to the left. Because the front wheel is turned to the left, a portion of this rotation will be allowed to occur around a pivot point perpendicular to the direction the wheel is pointed. This gives the overall effect of turning Fluffbot to the left and moving it slightly forward. If the momentum wheel were to accelerate in the opposite direction (counter clockwise) while the front wheel is steering left, the result would be to turn Fluffbot to the right and send in moving backward.
<math>\zeta_\sigma= a \cos (b\sigma) +c\sigma </math>


3) Wheel is turned to the right - This exhibits the same behavior as when the front wheel is turned to the left, however, the direction of rotation for the momentum wheel and the chassis are reversed.
where the parameters ''a'', ''b'', and ''c'' determine the shape of the serpentine motion. The graph shows how the parameters influence the serpentine curve. Basically, ''a'' changes the appearance of the curve, ''b'' changes the number of phases, and ''c'' changes the direction.


In order to control the motion of Fluffbot and to send it in a straight direction, the momentum wheel accelerates back and forth sinusoidally as the front wheel turns left to right with the same sinusoid. To reverse the direction that Fluffbot travels, simply put the front wheels control wave 180˚ out of phase with the control wave for the momentum wheel. Fluffbot is also able to steer left and right by controlling the amplitude and range of the front steering wheel.


The serpentine curve can be modeled with a snake like robot by changing the relative angles between the snake robot segments using the following formula with the number of segments (n):


<br clear=all>


== Mechanical Design ==
<math>\phi_i = \alpha sin(\omega t +(i-1)\beta ) + \gamma, \left ( i=1, ..., n-1 \right )</math>
[[image:Uncovered_Bot.jpg|thumb|right|Inside Fluff Bot]]
The Fluffbot has all of its circuitry and mechanical components confined to a single chassis. The chassis is an arrow shape and is mounted on three wheels attached to the bottom of the chassis. The two rear wheels are fixed, while the front wheel is free to rotate and is mounted on a fork and coupled to a servo, which controls its turning angle. A momentum wheel is fixed underneath the center of the chassis to a motor which is mounted on top. All circuitry and power sources are mounted on the top of the chassis as well.


Mechanically, the Fluffbot is designed for minimum chassis weight and maximum torque generated by the momentum wheel. The momentum wheel is mounted directly in the center of the three wheels so that the torque is distributed evenly. The wheels use press-fit ball bearings mounted on fixed axles to achieve minimum friction when rolling. The front-wheel fork is mounted to the chassis through a ball bearing to reduce frictional force on the servo motor.
where &alpha; , &beta; , and &gamma; are parameters used to characterize the serpentine curve and are dependent on ''a'', ''b'', and ''c'' as shown below:




<math>\alpha = a \left | \sin \left ( \frac{\beta}{2} \right ) \right | </math>


<math>\beta = \frac{b}{n} </math>


===Parts List===
<math>\gamma = -\frac{c}{n} </math>


*'''Motors:''' Futaba S3004 standard ball bearing RC servo motor, Mechatronics Lab - Pittman GM8712G708-R3 Motor 19.5:1 gear head, Mechatronics Lab
*'''Wheels:''' Machined from Aluminum 2" 6061 rod, McMaster part# 8974K711
*'''Momentum Wheel:''' Machined from 6" Aluminum 6061 rod, machine shop stock
*'''Tires:''' Shop Stock rubber wheel coverings
*'''Wheel Fork:''' Machined from aluminum 6061 rod, McMaster part# 8974K711
*'''Wheel Fork Bearing:''' Steel, flanged open ball bearing, 1/4" ID, 11/16" OD, McMaster part# 6383K213
*'''RC Servo-Shaft Coupler:''' Split clamp to Futaba S3004 coupler, ServoCity.com
*'''Chassis:''' laser cut from 1/4 inch 12"x12" clear acrylic
*'''Axels:''' 1/4" tapered dowels
*'''Wheel Bearings:''' 3 x Open steel ball bearings, 1/4" ID, 7/8" OD, 1/4" thickness, McMaster part# 6383K14
*'''Fasteners:''' 10-32 set screw for securing the momentum wheel to the motor, 4-40 round-head screws for securing motor to the chassis
*'''Velcro:''' To attach battery packs and housing to the chassis
*'''Adhesives:''' Acrylic Epoxy for Servo Holder, Superglue for rear wheel mounts
*'''Power Source:''' 2 x 9.6 V, 2200 mAh, NI-MH, Powerizer rechargeable battery


The equations above for &phi;<sub>i</sub>,&alpha;,&beta;, and &gamma; were used in this snake like robot as shown in the [[Robot Snake#PIC Code|code section]].


==== Chassis ====
<br clear=all>


The base of the chassis is made from a sheet of 1/4 inch clear Acrylic. It needed to be large enough to hold the motors, two batteries, and two circuit boards. In order to reduce the weight of the design, the base was cut into a triangle with wheels to be placed at each corner. Four small holes were cut at the front and at the middle of the base to allow the motor to be secured, and one larger hole was cut for a bearing to be pressed into place for the front steering wheel. [[Media:Dimensioned_Drawing_of_Chassis.pdf|Dimensioned Drawing of Chassis]]
== Mechanical Design ==
[[image:FullSnake.jpg|thumb|right|The Snake]]
The robotic snake consists of a head segment and several body segments. The head segment houses the onboard microcontroller and xBee radio. The body segments house the servo motors and the batteries required to power each motor. As the snake is designed to be modular, there is no limit to the number of body segments. More segments will allow it to move more smoothly, while fewer segments will be easier to control. For this design, seven body segments were used due to material limitations.


Mechanically, the snake is designed to move in a serpentine motion, imitating the motion of a real snake. As discussed above, real snakes move with anisotropic coefficients of friction. It is difficult to locate materials with this property, but passive wheels satisfy the friction requirements. The friction will be lower in the direction of rolling, thus providing the required difference in friction. The only problem with this approach is that the wheel may slide in the normal direction if the weight applied to the wheel is not sufficient.


===Parts List===


==== Steering Assembly ====
*Motors: Futaba S3004 standard ball bearing RC servo motor, Tower Hobbies LXZV41 $12.99
*Wheels: McMasterCarr Acetal Pulley for Fibrous Rope for 1/4" Rope Diameter, 3/4" OD McMasterCarr 8901T11 $1.66
*O-Rings (Tires): McMasterCarr Silicone O-Ring AS568A Dash Number 207, Packs of 50 McMasterCarr 9396K209 $7.60/50
*PVC Pipe: McMasterCarr Sewer & Drain Thin-Wall PVC Pipe Non-Perforated, 3" X 4-1/2' L, Light Green McMasterCarr 2426K24 $7.06
*1/8th inch plastic for chassis: (Shop Stock) or McMasterCarr Polycarbonate Sheet 1/8" Thick, 12" X 12", Clear, McMasterCarr, 8574K26 $6.32
*Dowel Pins: 1" long, 1/4" diameter
*Sheet Metal: For the connecting segments
*Fasteners: Screws for the servos and chassis, washers for the standoffs
*Standoffs: Used 1" and 1/2" to achieve a level snake
*Velcro: To attach battery packs and housing to the chasis
*Ball caster: For the head


[[image:Servo_and_Fork_Detail.jpg|thumb|right|RC Servo Attachment and Front Wheel Fork]]


The front wheel was attached to the steering servo through a machined aluminum fork. The fork design was used (as opposed to a one-sided mount) so that the axis of rotation for the front wheel could be directly centered above the centerline of the wheel with relative ease.
=== The Body Segments ===
[[image:Chasis.jpg|thumb|right|A Single Chasis Without a Servo]]


The Futaba RC servo used for steering the front wheel was held in place by the servo-shaft coupler and by two pieces of acrylic. The servo was light enough that it could be supported by only the coupler. Two vertical pieces of acrylic prevented the servo from rotating as it turned the front wheel. A small piece of electrical tape kept the servo from backing off of the coupler while Fluffbot was operating. [[Media:Dimensioned_Drawing_of_Steering_Fork.pdf|Dimensioned Drawing of Steering Fork]]
Each of the body segments are identical and includes a chassis, a servo, a connector, standoffs and two passive wheels as can be seen in the picture.


[http://www.youtube.com/watch?v=wBcJkNHEaAs Video of 3 body segments moving]


==== Chassis ====


The base of the chassis is made from a thin (approx. 1/8th inch) piece of polycarbonate. The chassis must be wide enough to hold a servo motor with a AAA battery pack on each side and long enough for the servo and a standoff (the connection for the previous segment). The polycarbonate was cut into a rectangle to meet the specifications for our servo motor. Five holes were then drilled in the rectangle, four to mount the servo and one for the standoff. The holes are drilled to allow the servo to be located in the center of the chassis.


==== Connector ====


A connector was machined to attach to the servo horn of one body segment and to attach to the next segment's standoff. The length of this connector is about 3 inches and is just long enough to prevent collision between segments. A shorter beam allows for greater torque. This connection needs to be as tight as possible and the beam must be mounted perpendicular to the chassis.


[[image:ChasisUnderside.jpg|thumb|right|The Underside of a Chassis]]


====Standoffs ====


Standoffs were used to attach the servo to the chassis and to attach the connector to the chassis. Two standoffs (1 in and 1/2 in) and several washers were used to make the connector parallel to the ground.


==== Passive Wheels ====
[[image:Wheel.jpg|thumb|left|A Passive Wheel on the Dowel Pin]]
Passive wheels were mounted to the bottom of the chassis. Each wheel was made of a 3/4 inch pulley and an o-ring. The o-ring was used to increase friction with the ground. The wheels have been set on polished metal dowel pins which allow the wheels to rotate more freely than when placed on wooden dowels. The dowel pin axles were mounted (hot glue works but is not very strong) in the center of the segment. The center of the segment is not the center of the polycarbonate rectangle. Instead, the entire segment length is the distance from the standoff on one chassis to the center of the servo horn on the other. In this project, the length of the connector was made to be about half the length of the segment. Therefore, the wheels were placed at the same location as the stand off as can be seen in the image. The wheels are held in place with zip ties.
<br clear=all>


==== Fully Assembled Body Segment ====
[[image:BuiltChasis.jpg|thumb|right|A Chassis Built Showing a Standoff and Batteries]]
[[image:BuiltChasis2_MLS.jpg|thumb|right|Chassis with Batteries Removed]]
A fully assembled chassis has a mounted servo and is connected to a segment on either side. AAA batteries packs were attached to the sides of the motor with velcro to allow easy removal. The small electronic circuit board for each segment was mounted on the front of the motor to allow easy access to the switch. (See Electronic Design for more information on the circuit board and batteries)
<br clear=all>


=== The Head Segment ===
[[image:BallCaster.jpg|thumb|left|The Ball Caster Under the Front Segment]]


The head segment is similar to the body segments except that it contains a PCB board with a PIC instead of a servo motor. The head segment is the same width but slightly longer than the body segment. A ball caster was added to the front of the segment to help support the extra length and help the wheels stay on the ground.
<br clear=all>


==== Protection and Visual Appeal ====
[[image:Housing.jpg|thumb|right|One Segment of the Housing]]


As a final step, housing for each segment was created from 3" PVC pipe. The pipe was cut into segments the same length as the chassis. The bottom of the pipe was cut off, allowing it to sit flat on the chassis. The housing provides a protective covering for the servo, batteries and electronics. The pipe was attached with velcro straps which mounted under the chassis. This housing can be easily removed to debug and to change batteries.
<br clear=all>


=== Mechanical Debugging ===


Wheels come off the ground: Add washers to the standoffs to force the chassis to be parallel to the ground.


Wheels slide, but do not roll: Increase frictionby either adding weight to the segment or changing the "tires" (the o-ring).


==== Momentum Wheel ====
The segments slip when the servo rotates: Tighten the screws for the connector standoffs, both above the beam and below the chassis.
<br clear=all>


[[image:Momentum_Wheel.jpg|thumb|right|Angular Momentum Wheel]]
== Electronics ==
The momentum wheel is design specifically to increase the torque on the body. This was done by machining the wheel so that there was more weight on the outside of the wheel. The momentum wheel is made from Aluminum 6061. The shaft in the center of the momentum wheel connects to the shaft of the motor using a set screw. The motor connector shaft and the momentum wheel were made as one piece to increase rigidity and assure that the momentum wheel would be perfectly parallel to the chassis. The momentum wheel weighs about 1.3 lbs, which makes the torque on the motor above its maximum continuous torque rating. We felt that this would be alright because the motor is not running continuously at a high speed, but rather is accelerating and decelerating sinusoidally. The motor is also not running at maximum rpm.
====Parts List (Digikey Part Number)====
[[Media:Momentum_Wheel_Dimensioned_Drawing.pdf|Dimensioned Drawing of Momentum Wheel]]


*[[Using the PIC32MX Series |PIC32 NU32 Board]]
*Oscillator: 40MHz Oscillator (X225-ND)
*RC Servo (see mechanical design) preferably high-torque
*10 wire IDC ribbon cable
*10 pos IDC cable socket (ASC10G): 1 per segment
*10 pos IDC cable header (A26267-ND): 1 per segment
*3 pos AAA battery holder (BH3AAA-W-ND): 1 per segment
*2 pos AAA battery holder (BH2AAA-W-ND): 1 per segment
*475 Ohm resistors (transmission line termination)
*Various switches to turn power electronics and the motors on/off
*Standard Protoboard, to mount connector from ribbon cable, and switches for each motor
*Xbee radio pair and PC


====Electronics in Each Body Segment====
[[image:RibbonCable_schematic_HLS.jpg|thumb|right|Ribbon Cable Schematic]][[image:ServoBoard_schematic_HLS.jpg|thumb|right|ServoBoard Schematic]][[image:ServoBoard_Hooked_up_HLS.jpg|thumb|right|A Complete Circuit Board on the Snake]]


The each segment of the snake contains a Futaba Standard RC Servo. Each servo has 3 wires: power, ground, and signal. The signal generated by the microcontroller is carried by the IDC ribbon cable, and each servo board taps into a single signal line and the reference ground line as shown in the ribbon cable schematic. Each segment of the snake contains a small circuit board (ServoBoard Schematic) which has a connector for the ribbon cable, a switch to control the power, and a power indicator LED. Because of the length of the ribbon cable, each signal line must be terminated with a 475 ohm resistor to prevent reflected "ghost" signals from interfering with the original signal.


Each servo board also has its own power supply of 5 AAA cells, which gives each servo 7.5V. Although the servos are only rated for 6V, 7.5V was used because more torque was needed. The current drain (up to 500mA) caused the voltage across the cells to drop due to the high internal resistance of the alkaline cells. NiMH rechargeable cells are more capable of handling high current draw applications, but are also much more expensive and can take several hours to charge.


The robot snake can run for about 1 hour on the alkaline cells, after which the servos no longer have enough torque to generate the serpentine motion.


<br clear=all>


====Electronics in The Head Segment====
==== Wheels ====
[[image:PICBoard_schematic_HLS.jpg|thumb|right|The Mainboard Schematic]]
[[Image:RY_NP_TJ_Wheel_with_Bearing.jpg|thumb|right|Wheel with Ball Bearing]]
The wheels we used were specially machined out of Aluminum 6061 to fit treaded rubber tires we found in the machine shop. Aluminum was used instead of preformed plastic wheels because we could precisely machine the wheels to fit the design of the Fluffbot, rather than needing to design the Fluffbot around the wheels we had available. The wheels were designed to fit open steel ball bearings, 1/4" ID, 7/8" OD, 1/4" thickness. The ball bearings were press fit into the center of the wheel. We used ball bearings so that the wheels would spin with minimal friction and thus less energy would be required to move the Fluffbot. [[Media:Dimensioned_Drawing_of_Wheels.pdf|Dimensioned Drawing of Wheels
[[image:PICBoard_HLS.jpg|thumb|right|The Electronics in the Head]]
]]


==== Battery and Electronics ====
The PIC18F4520 Prototyping Board designed by Professor Peshkin was used. Schematics of the board can be found here: [[Main_Page#PIC_18F4520_prototyping_board|18F4520_prototyping_board]]. The only change applied to the board was to replace the 20MHz clock with a 40MHz clock. This allowed the microcontroller to perform calculations faster, improving the resolution of the servo signal. The ribbon cable was connected to the ground and port D pins on the PIC.


The batteries and circuit boards were attached to the top of the chassis using Velcro. The configuration of the batteries as well as the placement of the circuit boards are intentional, concentrating the majority of the weight around the center of hte momentum wheel and also so that different housing (read: stuffed animals) could be easily placed around the Fluffbot.
An [[XBee_radio_communication_between_PICs|XBee radio]] was used to communicate between the microcontroller and the PC. The wiring diagram shows a schematic for the Xbee connection with the PIC. The [[XBee_radio_communication_between_PICs#XBee_Interface_Module|XBee Interface Board]] was used to provide a robust mechanical mount for the radio, as well as supply the 3.3V needed by the XBee. On the PC side, another XBee interface board was plugged into the FTDI USB-Serial converter. Other than this, no special electronics were needed for the XBee radio. The radio simply acted as a serial cable replacement The snake was controlled by sending commands with a terminal program.


<br clear=all>


== PIC Code ==
There are two PIC files used in this robotic snake, SnakeServos.c and main.h, which are shown below. main.h sets up the default parameters used in SnakeServos.c. The microcontroller controls the RC servos and receives data from a computer via serial communication.


==== Fluffy Housing ====
The main purpose of SnakeServos.c is to calculate the motion profile of the servos, and send a corresponding signal to each of the servos every 20 ms. The code for this is found in the <tt>ISR_20MS</tt> function in the code which is run every 20ms.


[[Image:Fluffbot_with_Seal_Housing.jpg|thumb|right|Fluffy Housing]]
A secondary function is to update the parameters that affect the motion of the snake. The code for this can be found in the <tt>ISR_USART_RX</tt> function, which is run every time a byte is received on the USART's receive buffer.
The Fluffbot receives its name from the fluffy stuffed animals that ride atop it and that the Fluffbot imitates by its motion. For this version of the Fluffbot a seal was used to house the mechanical structure and electronics. The seal is split in two and attached to the chassis by Velcro. There is a piece of sheet metal that is bent and attached with Velcro to the upper part of the seal so that it will maintain its structure.


====Servo Control Details====
The main function of the PIC microcontroller is to control multiple RC servos (seven in our case). See [[RC Servo Theory]] for a discussion of the control signal for an RC servo. The RC servo expects a pulse every 20ms, so a timer called Timer1 is set up to overflow every 20 ms and trigger an interrupt. When the interrupt is triggered, the counter for Timer1 is set to the value held by the constant <tt>TMR1_20MS</tt> (defined as <tt>15536</tt>), which will cause Timer1 to overflow 20 ms later and re-trigger the interrupt.


As shown in the RC Servo Theory, the width of the high pulse determines the angle of the servo. As a result, the pulse width corresponding to the desired angle for each servo motor is calculated and the corresponding timer value is stored in an array called <tt>RCservo</tt>. At the beginning of the interrupt, all the pins connected to the servos are set high. For the RC servos used in this project, the maximum pulse width can be 2.25 ms; therefore, <tt>Timer1</tt> only needs to be polled for 2.25 ms. <tt>TMR1_2point25MS</tt> is a constant corresponding to the value of <tt>Timer1</tt> 2.25 ms after the interrupt begins and is defined as <tt>15536 + 6250</tt>. While <tt>Timer1</tt> is less than this variable, the counter is compared sequentially to the values in the <tt>RCservo</tt> array plus 15536 (15536 must be added because the Timer1 started counting at 15536 instead of 0). Since the <tt>RCservo</tt> array corresponds to the pulse widths of the servos, when the value of <tt>Timer1</tt> is greater than a value in <tt>RCservo</tt> plus 15536, the corresponding pin is set low. After the sequence is complete, <tt>Timer1</tt> is polled again and the process repeats until 2.25 ms have elapsed, which corresponds to when Timer1 is greater than <tt>TMR1_2point25MS</tt>. After all the servo signals have been sent, the values in the <tt>RCservo</tt> array are updated to prepare for the next 20ms interrupt.


Although polling the timer to control the length of a pulse has a lower resolution than using an interrupt (see [http://peshkin.mech.northwestern.edu/pic/code/RCservoSoft/RCservoSoft.c RCservoSoft.c]), it allows one to add and remove servos more easily and not have to decrease the frequency of the servo signal pulse train. With a 40MHz clock and seven servos, the resolution for the pulse was about 8us, which was sufficient for this project.


====Serial Communication Details====
The PIC communicates serially with a XBee radio to a PC with a XBee radio. As shown in the code, the serial communication allows the user to change the speed, the amplitude and period of the sine wave, and the direction (forward, reverse, left and right) of the robotic snake. When a byte is received in the UART receive buffer, a high-priority interrupt is triggered. The received byte is put into a switch-case statement, and the corresponding parameters are updated.


====SnakeServos.c====
<pre>
/*
Andy Long, Clara Smart, and Michael Hwang's snake robot code.
*/




#include <18f4520.h>
#device high_ints=TRUE // this allows raised priority interrupts, which we need
#fuses HS,NOLVP,NOWDT,NOPROTECT
#use delay(clock=40000000)
#use rs232(baud=9600, UART1)


#include <main.h>
#include <math.h>


/*
Put your desired high duration here;
3200 is center
1000 is 90 deg right
5400 is 90 deg left
*/
int16 RCservo[7];


//use volatile keyword to avoid problems with optimizer
volatile float a = A_DEFAULT;
volatile float b = B_DEFAULT;
volatile float c = C_DEFAULT;


volatile float alpha;
volatile float gamma;
volatile float beta;
volatile float speed = 0;
volatile float prev_speed = SPEED_DEFAULT;
float t = 0;


#INT_TIMER1 // designates that this is the routine to call when timer1 overflows
//generates servo signals
void ISR_20MS(){
volatile unsigned int16 time;
set_timer1(TMR1_20MS); //set timer to trigger an interrupt 20ms later
SET_ALL_SERVOS(0b11111111); //begin pulse for servo signal
time=get_timer1(); //poll timer
while(time < TMR1_2point25MS){ //end this loop after 2.25 ms
if (time > (RCservo[0] + TMR1_20MS)){
output_low(SERVO_0); //end the pulse when time is up
}
if (time > (RCservo[1] + TMR1_20MS)){
output_low(SERVO_1);
}
if (time > (RCservo[2] + TMR1_20MS)){
output_low(SERVO_2);
}
if (time > (RCservo[3] + TMR1_20MS)){
output_low(SERVO_3);
}
if (time > (RCservo[4] + TMR1_20MS)){
output_low(SERVO_4);
}
if (time > (RCservo[5] + TMR1_20MS)){
output_low(SERVO_5);
}
if (time > (RCservo[6] + TMR1_20MS)){
output_low(SERVO_6);
}
time=get_timer1(); //poll timer
}
SET_ALL_SERVOS(0); //set all servos low in case some pins are still high


//3200 is center //1000 is 90 deg right // 5400 is 90 deg left
/*
add value of sine wave with phase offset ((alpha*sin(t + X*beta),
3200 for servo center position,
an adjustment value to compensate for offsets when mounting servo horn (SERVO_X_ADJ),
and bias (gamma) for turning.
*/
RCservo[0]=(int16)(alpha*sin(t) + 3200 + SERVO_3_ADJ + gamma);
RCservo[1]=(int16)(alpha*sin(t + 1*beta) + 3200 + SERVO_4_ADJ + gamma);
RCservo[2]=(int16)(alpha*sin(t + 2*beta) + 3200 + gamma + SERVO_5_ADJ);
RCservo[3]=(int16)(alpha*sin(t + 3*beta) + 3200 + gamma + SERVO_6_ADJ);
RCservo[4]=(int16)(alpha*sin(t + 4*beta) + 3200 + gamma + SERVO_7_ADJ);
RCservo[5]=(int16)(alpha*sin(t + 5*beta) + 3200 + gamma + SERVO_8_ADJ);
RCservo[6]=(int16)(alpha*sin(t + 6*beta) + 3200 + gamma + SERVO_9_ADJ);


t+= speed; //increment time, wrap around if necessary to prevent overflow
if (t > 2*pi){
t = 0;
}
else if (t < 0){
t = 2*pi;
}
}




#INT_RDA HIGH //High-Priority Interrupt triggered by USART Rx
//parameter update
void ISR_USART_RX(){
char input;
if (kbhit()){
input = getc();
switch(input){
case 'w': //accelerate
speed += 0.002;
break;
case 's': //decelerate
speed -= 0.002;
break;
case 'x': //pause motion
prev_speed = speed;
speed = 0;
break;
case 'z': //resume motion
speed = prev_speed;
break;
case 'c': //reverse speed
speed = -speed;
break;
case 'a': //increase left turn rate
c -= 1000;
gamma=-c/num_segments;
break;
case 'd': //increase right turn rate
c += 1000;
gamma=-c/num_segments;
break;
case 'f': //set turn rate to 0
c = C_DEFAULT;
gamma = 0;
case 't': //increase amplitude
a += 10;
alpha=a*abs(sin(beta));
break;
case 'g': //decrease amplitude
a -= 10;
alpha=a*abs(sin(beta));
break;
case 'y': //increase phases in body
b += 0.1;
beta=b/num_segments;
alpha=a*abs(sin(beta));
break;
case 'h': //decrease phases in body
b -= 0.1;
beta=b/num_segments;
alpha=a*abs(sin(beta));
break;
case '1': //preset 1
a = A_DEFAULT;
b = B_default;
c = C_default;
gamma=-c/num_segments;
beta=b/num_segments;
alpha=a*abs(sin(beta));
speed=SPEED_DEFAULT;
break;
case '2': //preset 2
a = 1400;
b = 2*pi;
c = C_DEFAULT;
gamma=-c/num_segments;
beta=b/num_segments;
alpha=a*abs(sin(beta));
speed=SPEED_DEFAULT;
break;
case '3': //preset 3
a = 1000;
b = 5*pi;
c = C_DEFAULT;
gamma=-c/num_segments;
beta=b/num_segments;
alpha=a*abs(sin(beta));
speed=SPEED_DEFAULT;
break;
default:
}
}
return;
}


void main() {
//load default values
a = A_DEFAULT;
b = B_default;
c = C_default;
gamma=-c/num_segments;
beta=b/num_segments;
alpha=a*abs(sin(beta));
speed=0;
setup_timer_1(T1_INTERNAL | T1_DIV_BY_4 );
set_timer1(0);
enable_interrupts(INT_TIMER1); //enable Timer1 interrupt
enable_interrupts(INT_RDA); //enable USART receive interrupt
enable_interrupts(GLOBAL);
while (TRUE) {


==== Mechanical Debugging ====
}
}
</pre>


'''Bearings are coming out of rear wheels:''' Re-machine wheels using a boring bar for the through-hole for the bearings. While boring out hole, check dimensions of the bearing being used and take small cuts, measuring after each pass, to assure that the hole diameter precisely matches that of the bearing.
===main.h===
<pre>
#ifndef __MAIN_H__
#define __MAIN_H__


'''Servo comes loose from servo coupler:''' Machine a set screw hole through the part of the coupler connecting to the servo and add a set screw to keep the servo in place
#define SET_ALL_SERVOS(x) output_d(x)


== Electronics ==
/*
====Parts List====
This chart matches the pin on the PIC to the wire on the ribbon cable
PIN WIRE IN USE
--- ---- -------
RD0 2
RD1 3 *
RD2 4 *
RD3 5 *
RD4 6 *
RD5 7 *
RD6 8 *
RD7 9 *


*[[Introduction to the PIC32|PIC32 NU32 Board]] + PIC USB cable
*/
*[[XBee Interface Board|XBee Interface Board]] (2)
#define SERVO_3_ADJ 0
*[[PIC RS232| RS232 cable]]
#define SERVO_4_ADJ 300
*LM7805C 5V regulator (2)
#define SERVO_5_ADJ (-150)
*0.33uF capacitor
#define SERVO_6_ADJ 75
*0.01uF capacitor
#define SERVO_7_ADJ (-200)
*LM338T adjustable voltage regulator (2)
#define SERVO_8_ADJ 100
*5k potentiometer (2)
#define SERVO_9_ADJ (-150)
*120 ohm resistor (2)
*0.1uF capacitor (6)
*1uF capacitor (2)
*L298N H-bridge
*14N002 diodes (4)
*LS7083 decoder
*100k ohm resistor
*Pittman GM8712G708-R3 24V motor
*Futaba S3004 RCservo motor
*Protoboard/breadboard


#define SERVO_0 PIN_D1
#define SERVO_1 PIN_D2
#define SERVO_2 PIN_D3
#define SERVO_3 PIN_D4
#define SERVO_4 PIN_D5
#define SERVO_5 PIN_D6
#define SERVO_6 PIN_D7


#define A_DEFAULT 1300
#define B_DEFAULT 3*pi
#define C_DEFAULT 0


#define SPEED_DEFAULT 0.05
#define OMEGA_DEFAULT 1
#define num_segments 8


====Electronics On Fluffbot====
#define TMR1_20MS 15536
[[image:Fluffbot_Electronics_Block_Diagram.jpg |thumb|400px|Electronics Block Diagram|right]]
#define TMR1_2point25MS 15536 + 6250
#endif
</pre>


A 24V DC motor is used to control the momentum wheel. A RCservo motor is used to control the steering angle. An XBee Board is used to communicate between the Fluffbot and a PC.
== Results ==
[[image:Fluffbot_Circuit_Boards.jpg |thumb|300px|Fluffbot Circuitry|right]]
The electronics block diagram (right picture) shows how each circuitry block connects to each other. The following links illustrate how each individual circuitry block is built:
*[http://www.national.com/mpf/LM/LM78L05.html#Overview LM7805 5V regulator circuitry].
*[http://www.national.com/mpf/LM/LM338.html#Overview LM338T adjustable voltage regulator circuitry] for 18V and 3.3V.
*[http://www.datasheetcatalog.org/datasheet/SGSThomsonMicroelectronics/mXxwur.pdf L298N H-bridge circuitry].
*[http://hades.mech.northwestern.edu/images/f/fd/Motor_Encoder_circuit.pdf LS7083 decoder circuitry]. Note that our circuitry for the H-bridge is not the same as the one at this link.


<br clear=all>
Overall, the robotic snake was successful.


====Electronics At Computer====
Initially, the mechanical design included a single wheel mounted in the center of the pvc pipe. However, the motion of the snake was very difficult to control because the robotic snake became unstable very easily. As a result, the chassis was built to include two wheels, as discussed in the mechanical design section, in order to provide stability which made the robot easier to control.
The second XBee Interface Board is connected to a computer using the RS232 cable. This enables the user to communicate wirelessly in real-time to the Fluffbot.


== Code ==
Wireless control from a laptop allowed easy demonstration of the snakes capabilities, and allowed others to easily control its movement.
There is a PIC32 code, compiled using MPLAB, as well as a Processing code. Download them: [[Media:Fluff_bot_PIC_Code.zip|PIC code]], [[Media:Fluffbot_Processing.zip‎|Processing code]].


The code does three things:
The final robotic snake can be seen in action here.


1) Sets motion parameters.
[http://www.youtube.com/watch?v=Sb8WqaLX1Vo Video of the robot snake without housing]


2) Controls acceleration and direction of the momentum wheel.
[http://www.youtube.com/watch?v=r_GOOFLnI6w Video of the robot snake with housing]

3) Controls angle of the steering wheel.

====1) Sets motion parameters====

Depending on the "type" of seal chosen, Fluffbot exhibits different styles of motion. The styles of motion are changed by changing the maximum angle of the steering wheel (amplitude) and by changing the rate at which the momentum wheel and steering wheel change direction (frequency).

There are three motion styles to choose from:
*Seal on land (medium amplitude, high frequency)
*Seal in water (low amplitude, medium frequency)
*Seal on ice (high amplitude, medium frequency)

Steps to change motion parameters:
*From a computer, using a Processing GUI, the user chooses between seal on land, in water, and on ice. The users choices are transmitted wirelessly to the Fluffbot.
*In the PIC code: the UART 2 interrupt handler receives the instructions, and changes amplitude and frequency.
*The function setAnimalParameters() takes this new information, and changes Fluffbot's motion accordingly.

====2) Controls acceleration and direction of the momentum wheel====

The momentum wheel accelerates in a sinusoidal motion. The PIC controls uses PD control to control the acceleration. (You'll see in the code that we use speed control, but controlling speed will effectively control acceleration.)

The code controls acceleration with four steps:

*Sets a target speed "set_speed", based on a sinusoid generated in the setAnimalParameters() function.
*Gets actual speed data from encoders on the momentum wheel motor, with the getActualSpeed() function.
*Calculates the error between set speed and actual speed, with the calculateError() function.
*Sets PWM to help decrease the error, with the setPWM() function.

====3) Controls angle of the steering wheel====

The angle of the steering wheel determines whether the Fluffbot is going forward or reverse, and turning left or right.

There are four motion directions to choose from:
*Forward. Momentum wheel acceleration and steering wheel angle out of phase by 180 degrees. Equivalently (and as in the code), the steering wheel angle leads the momentum wheel speed by pi/2.
*Reverse. Momentum wheel acceleration and steering wheel angle in phase phase. Equivalently (and as in the code), the steering wheel angle leads the momentum wheel speed by 3*pi/2.
*Left, and 4) right. The variable middle_servo changes, so that the steering wheel angle changes about an angle leftwards or rightwards.

Steps to change direction parameters:
*From a computer, using a Processing GUI, the user chooses between forward, reverse, left, or right. The users choices are transmitted wirelessly to the Fluffbot.
*In the PIC code: the UART 2 interrupt handler receives the instructions, and changes the phase and middle_servo.
*The function setAnimalParameters() takes this new information, and changes Fluffbot's direction accordingly.






== Results ==

Overall, Fluffbot was a success.

Calibrating Fluffbot's front wheel to the proper steering took some fine tuning, but once it was oriented properly, the robot was easily controllable.

Wireless control from a processing GUI, made steering and adjusting the motion style quite easy.

Video of Fluffbot in action can be seen by following the links at the top of the page.


== Next Steps ==
== Next Steps ==


Due to the short amount of time in which the Fluffbot was designed, built and programmed, there was not enough time for optimization and iteration. Thus, there are many areas in which the Fluffbot could be improved with future work.
The robotic snake was developed within five weeks, and proved to be a very successful demo. There are many options that could be researched and developed to add to this robot and discussed below.


==== Position Sensors ====
==== Position Sensors ====
Sensors could be added to the robot to allow it to know its position. This could be accomplished with a combination of encoders on a segment. Most likely, the middle segment should be used since it would be the approximate center of gravity. Knowledge of the position of the center of gravity would potentially the robotic snake to be sent to different locations or navigate (using dead reckoning) through a pre-determined obstacle course or maze. The information from encoders could be sent to a computer to observe different snakelike motions with different parameters.
Sensors could be added to the robot to allow it to know its position. this could be accomplished by adding encoders to the front wheel to determine the distance the Fluffbot has moved from its initial position. It would then be possible to map the Fluffbot's trajectory as well as collect data about its speed and efficiency.


==== Obstacle Avoidance ====
==== Obstacle Avoidance ====
With optical sensors on the head of the snake, the robot would be able to sense an obstacle and either overide the wireless command and avoid it, or stop completely, and wait for further commands.
By adding optical sensors to the Fluffbot we could program it to automatically avoid obstacles. This would most likely use an override function that would supersede the command coming from the user.

==== Power Supply ====
Currently, 5 AAA batteries are required for each servo, meaning that this robot requires many batteries. As a result, a different power supply could be investigated.


====High Torque Servos====
==== High Torque Servos ====
High torque servos would enable the Fluffbot to move more quickly because the front wheel would be able to turn at a higher frequency.
The servos in the snake have a large load but do not need to move very quickly, so high torque servos could be used instead of standard servos. This would also prolong the battery life because the servos would be operating in a more efficient range.


==== Hand-held Controller ====
== References ==
By linking the control of the Fluffbot to a handheld controller a user could more easily interact with the Fluffbot and control it because they wouldn't need to be staring at a GUI on a computer to control its behavior.


==== Wall-Riding ====
Ma, Shugen. "Analysis of creeping locomotion of a snake-like robot." ''Advanced Robotics'' Vol 15, No 2 (2001): 205-6.
The initial scope of the project included giving the robot the ability to ride on a vertical wall. While this was not a possibility for us in the time frame allotted, a future team may be able to build on our design to enable dynamic motion using a momentum wheel along a vertical surface. This may be possible by using neodymium wheels to attach the robot to a metal wall.


==== Housing ====
Saito, Fukaya, Iwasaki. "Serpentine Locomotion with Robotic Snakes". ''IEEE Control Systems Magazine'' (Feb 2002): 66, 72-73.
The Fluffbot does not currently have a housing that protects the electronics on the chassis. A housing would allow for easy attachment and detachment of various animal shells and would also prevent the stuffed animals from contacting the hot electronics and making them heat up even faster. Air vents could also be added to the housing to allow for heat to dissipate from the electronics.

Latest revision as of 11:36, 23 March 2010

Fluff Bot 1.jpg

Overview

Flufbot uses conservation of angular momentum to move forward or backward, by controlling the acceleration of a momentum wheel and the angle of a steering wheel.

Some videos:

Fluffbot with seal casing 1

Fluffbot seal-on-land

Fluffbot seal-in-water

Fluffbot seal-on-ice

Fluffbot seal-on-land reverse

Fluffbot bottom view of momentum and steering wheel

Fluffbot with seal casing 2

Fluffbot with seal casing 3

Team Members

Johnson - Pentelovitch - Yu
  • Tyler Johnson - Mechanical Engineer - Class 2011
  • Noah Pentelovitch - Mechanical Engineer - Class 2010
  • Ren Chung (RC) Yu - Electrical Engineer - Class 2010


Concept Overview

Fluffbot Motion

Instead of using motors to directly drive its motion forward, Fluffbot uses the basic principal of conservation of angular momentum. When an object with a high moment of inertia is accelerated about an axis, angular momentum in the direction of motion is immediately created. When this happens, angular momentum in the opposing direction is also produced. The resulting motion from this "reaction" momentum can be transferred to ground through a rigid fixture, or this resulting motion could be controlled and channeled into a desirable form as shown with Fluffbot.

When the large flywheel on Fluffbot accelerates clockwise in the horizontal plane, the body attempts to conserve the zero angular momentum of the system by rotating around the same axis in a counter clockwise direction. Motion forward or backward by Fluffbot is made possible by the steering of the front wheel. There are three conditions for the steering wheel to be in, and three corresponding effects:

1) Wheel is aligned straight ahead - In this scenario, friction between the front wheel and the the ground prevent any rotation along the robot's main axis of rotation. Any acceleration of the momentum wheel in this arrangement will result in no movement of Fluffbot.

2) Wheel is turned to the left - When the momentum wheel accelerates in a clockwise direction, the chassis will attempt to rotate to the left. Because the front wheel is turned to the left, a portion of this rotation will be allowed to occur around a pivot point perpendicular to the direction the wheel is pointed. This gives the overall effect of turning Fluffbot to the left and moving it slightly forward. If the momentum wheel were to accelerate in the opposite direction (counter clockwise) while the front wheel is steering left, the result would be to turn Fluffbot to the right and send in moving backward.

3) Wheel is turned to the right - This exhibits the same behavior as when the front wheel is turned to the left, however, the direction of rotation for the momentum wheel and the chassis are reversed.

In order to control the motion of Fluffbot and to send it in a straight direction, the momentum wheel accelerates back and forth sinusoidally as the front wheel turns left to right with the same sinusoid. To reverse the direction that Fluffbot travels, simply put the front wheels control wave 180˚ out of phase with the control wave for the momentum wheel. Fluffbot is also able to steer left and right by controlling the amplitude and range of the front steering wheel.



Mechanical Design

Inside Fluff Bot

The Fluffbot has all of its circuitry and mechanical components confined to a single chassis. The chassis is an arrow shape and is mounted on three wheels attached to the bottom of the chassis. The two rear wheels are fixed, while the front wheel is free to rotate and is mounted on a fork and coupled to a servo, which controls its turning angle. A momentum wheel is fixed underneath the center of the chassis to a motor which is mounted on top. All circuitry and power sources are mounted on the top of the chassis as well.

Mechanically, the Fluffbot is designed for minimum chassis weight and maximum torque generated by the momentum wheel. The momentum wheel is mounted directly in the center of the three wheels so that the torque is distributed evenly. The wheels use press-fit ball bearings mounted on fixed axles to achieve minimum friction when rolling. The front-wheel fork is mounted to the chassis through a ball bearing to reduce frictional force on the servo motor.



Parts List

  • Motors: Futaba S3004 standard ball bearing RC servo motor, Mechatronics Lab - Pittman GM8712G708-R3 Motor 19.5:1 gear head, Mechatronics Lab
  • Wheels: Machined from Aluminum 2" 6061 rod, McMaster part# 8974K711
  • Momentum Wheel: Machined from 6" Aluminum 6061 rod, machine shop stock
  • Tires: Shop Stock rubber wheel coverings
  • Wheel Fork: Machined from aluminum 6061 rod, McMaster part# 8974K711
  • Wheel Fork Bearing: Steel, flanged open ball bearing, 1/4" ID, 11/16" OD, McMaster part# 6383K213
  • RC Servo-Shaft Coupler: Split clamp to Futaba S3004 coupler, ServoCity.com
  • Chassis: laser cut from 1/4 inch 12"x12" clear acrylic
  • Axels: 1/4" tapered dowels
  • Wheel Bearings: 3 x Open steel ball bearings, 1/4" ID, 7/8" OD, 1/4" thickness, McMaster part# 6383K14
  • Fasteners: 10-32 set screw for securing the momentum wheel to the motor, 4-40 round-head screws for securing motor to the chassis
  • Velcro: To attach battery packs and housing to the chassis
  • Adhesives: Acrylic Epoxy for Servo Holder, Superglue for rear wheel mounts
  • Power Source: 2 x 9.6 V, 2200 mAh, NI-MH, Powerizer rechargeable battery


Chassis

The base of the chassis is made from a sheet of 1/4 inch clear Acrylic. It needed to be large enough to hold the motors, two batteries, and two circuit boards. In order to reduce the weight of the design, the base was cut into a triangle with wheels to be placed at each corner. Four small holes were cut at the front and at the middle of the base to allow the motor to be secured, and one larger hole was cut for a bearing to be pressed into place for the front steering wheel. Dimensioned Drawing of Chassis


Steering Assembly

RC Servo Attachment and Front Wheel Fork

The front wheel was attached to the steering servo through a machined aluminum fork. The fork design was used (as opposed to a one-sided mount) so that the axis of rotation for the front wheel could be directly centered above the centerline of the wheel with relative ease.

The Futaba RC servo used for steering the front wheel was held in place by the servo-shaft coupler and by two pieces of acrylic. The servo was light enough that it could be supported by only the coupler. Two vertical pieces of acrylic prevented the servo from rotating as it turned the front wheel. A small piece of electrical tape kept the servo from backing off of the coupler while Fluffbot was operating. Dimensioned Drawing of Steering Fork










Momentum Wheel

Angular Momentum Wheel

The momentum wheel is design specifically to increase the torque on the body. This was done by machining the wheel so that there was more weight on the outside of the wheel. The momentum wheel is made from Aluminum 6061. The shaft in the center of the momentum wheel connects to the shaft of the motor using a set screw. The motor connector shaft and the momentum wheel were made as one piece to increase rigidity and assure that the momentum wheel would be perfectly parallel to the chassis. The momentum wheel weighs about 1.3 lbs, which makes the torque on the motor above its maximum continuous torque rating. We felt that this would be alright because the motor is not running continuously at a high speed, but rather is accelerating and decelerating sinusoidally. The motor is also not running at maximum rpm. Dimensioned Drawing of Momentum Wheel




Wheels

Wheel with Ball Bearing

The wheels we used were specially machined out of Aluminum 6061 to fit treaded rubber tires we found in the machine shop. Aluminum was used instead of preformed plastic wheels because we could precisely machine the wheels to fit the design of the Fluffbot, rather than needing to design the Fluffbot around the wheels we had available. The wheels were designed to fit open steel ball bearings, 1/4" ID, 7/8" OD, 1/4" thickness. The ball bearings were press fit into the center of the wheel. We used ball bearings so that the wheels would spin with minimal friction and thus less energy would be required to move the Fluffbot. Dimensioned Drawing of Wheels

Battery and Electronics

The batteries and circuit boards were attached to the top of the chassis using Velcro. The configuration of the batteries as well as the placement of the circuit boards are intentional, concentrating the majority of the weight around the center of hte momentum wheel and also so that different housing (read: stuffed animals) could be easily placed around the Fluffbot.


Fluffy Housing

Fluffy Housing

The Fluffbot receives its name from the fluffy stuffed animals that ride atop it and that the Fluffbot imitates by its motion. For this version of the Fluffbot a seal was used to house the mechanical structure and electronics. The seal is split in two and attached to the chassis by Velcro. There is a piece of sheet metal that is bent and attached with Velcro to the upper part of the seal so that it will maintain its structure.










Mechanical Debugging

Bearings are coming out of rear wheels: Re-machine wheels using a boring bar for the through-hole for the bearings. While boring out hole, check dimensions of the bearing being used and take small cuts, measuring after each pass, to assure that the hole diameter precisely matches that of the bearing.

Servo comes loose from servo coupler: Machine a set screw hole through the part of the coupler connecting to the servo and add a set screw to keep the servo in place

Electronics

Parts List

  • PIC32 NU32 Board + PIC USB cable
  • XBee Interface Board (2)
  • RS232 cable
  • LM7805C 5V regulator (2)
  • 0.33uF capacitor
  • 0.01uF capacitor
  • LM338T adjustable voltage regulator (2)
  • 5k potentiometer (2)
  • 120 ohm resistor (2)
  • 0.1uF capacitor (6)
  • 1uF capacitor (2)
  • L298N H-bridge
  • 14N002 diodes (4)
  • LS7083 decoder
  • 100k ohm resistor
  • Pittman GM8712G708-R3 24V motor
  • Futaba S3004 RCservo motor
  • Protoboard/breadboard



Electronics On Fluffbot

Electronics Block Diagram

A 24V DC motor is used to control the momentum wheel. A RCservo motor is used to control the steering angle. An XBee Board is used to communicate between the Fluffbot and a PC.

Fluffbot Circuitry

The electronics block diagram (right picture) shows how each circuitry block connects to each other. The following links illustrate how each individual circuitry block is built:


Electronics At Computer

The second XBee Interface Board is connected to a computer using the RS232 cable. This enables the user to communicate wirelessly in real-time to the Fluffbot.

Code

There is a PIC32 code, compiled using MPLAB, as well as a Processing code. Download them: PIC code, Processing code.

The code does three things:

1) Sets motion parameters.

2) Controls acceleration and direction of the momentum wheel.

3) Controls angle of the steering wheel.

1) Sets motion parameters

Depending on the "type" of seal chosen, Fluffbot exhibits different styles of motion. The styles of motion are changed by changing the maximum angle of the steering wheel (amplitude) and by changing the rate at which the momentum wheel and steering wheel change direction (frequency).

There are three motion styles to choose from:

  • Seal on land (medium amplitude, high frequency)
  • Seal in water (low amplitude, medium frequency)
  • Seal on ice (high amplitude, medium frequency)

Steps to change motion parameters:

  • From a computer, using a Processing GUI, the user chooses between seal on land, in water, and on ice. The users choices are transmitted wirelessly to the Fluffbot.
  • In the PIC code: the UART 2 interrupt handler receives the instructions, and changes amplitude and frequency.
  • The function setAnimalParameters() takes this new information, and changes Fluffbot's motion accordingly.

2) Controls acceleration and direction of the momentum wheel

The momentum wheel accelerates in a sinusoidal motion. The PIC controls uses PD control to control the acceleration. (You'll see in the code that we use speed control, but controlling speed will effectively control acceleration.)

The code controls acceleration with four steps:

  • Sets a target speed "set_speed", based on a sinusoid generated in the setAnimalParameters() function.
  • Gets actual speed data from encoders on the momentum wheel motor, with the getActualSpeed() function.
  • Calculates the error between set speed and actual speed, with the calculateError() function.
  • Sets PWM to help decrease the error, with the setPWM() function.

3) Controls angle of the steering wheel

The angle of the steering wheel determines whether the Fluffbot is going forward or reverse, and turning left or right.

There are four motion directions to choose from:

  • Forward. Momentum wheel acceleration and steering wheel angle out of phase by 180 degrees. Equivalently (and as in the code), the steering wheel angle leads the momentum wheel speed by pi/2.
  • Reverse. Momentum wheel acceleration and steering wheel angle in phase phase. Equivalently (and as in the code), the steering wheel angle leads the momentum wheel speed by 3*pi/2.
  • Left, and 4) right. The variable middle_servo changes, so that the steering wheel angle changes about an angle leftwards or rightwards.

Steps to change direction parameters:

  • From a computer, using a Processing GUI, the user chooses between forward, reverse, left, or right. The users choices are transmitted wirelessly to the Fluffbot.
  • In the PIC code: the UART 2 interrupt handler receives the instructions, and changes the phase and middle_servo.
  • The function setAnimalParameters() takes this new information, and changes Fluffbot's direction accordingly.




Results

Overall, Fluffbot was a success.

Calibrating Fluffbot's front wheel to the proper steering took some fine tuning, but once it was oriented properly, the robot was easily controllable.

Wireless control from a processing GUI, made steering and adjusting the motion style quite easy.

Video of Fluffbot in action can be seen by following the links at the top of the page.

Next Steps

Due to the short amount of time in which the Fluffbot was designed, built and programmed, there was not enough time for optimization and iteration. Thus, there are many areas in which the Fluffbot could be improved with future work.

Position Sensors

Sensors could be added to the robot to allow it to know its position. this could be accomplished by adding encoders to the front wheel to determine the distance the Fluffbot has moved from its initial position. It would then be possible to map the Fluffbot's trajectory as well as collect data about its speed and efficiency.

Obstacle Avoidance

By adding optical sensors to the Fluffbot we could program it to automatically avoid obstacles. This would most likely use an override function that would supersede the command coming from the user.

High Torque Servos

High torque servos would enable the Fluffbot to move more quickly because the front wheel would be able to turn at a higher frequency.

Hand-held Controller

By linking the control of the Fluffbot to a handheld controller a user could more easily interact with the Fluffbot and control it because they wouldn't need to be staring at a GUI on a computer to control its behavior.

Wall-Riding

The initial scope of the project included giving the robot the ability to ride on a vertical wall. While this was not a possibility for us in the time frame allotted, a future team may be able to build on our design to enable dynamic motion using a momentum wheel along a vertical surface. This may be possible by using neodymium wheels to attach the robot to a metal wall.

Housing

The Fluffbot does not currently have a housing that protects the electronics on the chassis. A housing would allow for easy attachment and detachment of various animal shells and would also prevent the stuffed animals from contacting the hot electronics and making them heat up even faster. Air vents could also be added to the housing to allow for heat to dissipate from the electronics.