Go Down

### Topic: Challenge: horizontally / inertially stabilize a pizza on motorcycle (Read 4039 times)previous topic - next topic

#### Dnos

##### Jan 31, 2013, 11:23 amLast Edit: Jan 31, 2013, 11:26 am by Dnos Reason: 1
I'm new to arduinos and looking to dive into something challenging. I study mechanical engineering, but my roommate is a computer scientist so I have a little help. The challenge is just like it sounds: horizontally / inertially stabilize a pizza, in a box, on the back of a motorcycle. Today I started to do some research and came across a lot of people building Segway robots using an accelerometer, gyroscope, motor controller, an arduino UNO, and software based on the kalman filter. I started to wonder what would happen if the Segway was mounted sideways to the back of a motorcycle instead of on wheels? Would the robot maintain its stability? What if we added 30 lbs of weight and fast turns?

This had a lot of great information about kalman filtering and using accelerometers. Someone already built a 3 axis stabilizing platform.
http://arduino.cc/forum/index.php?topic=58048.330

Right now I'm trying to price the arduino and additional hardware out, what size a motor i woud need for a 20 lb box, and see how much programming I can find rather than beginning from scratch. I'd like to be able to make this thing as cheaply as possible.

#### Nick Gammon

#1
##### Feb 01, 2013, 03:15 am
Please post technical questions on the forum, not by personal message. Thanks!

http://www.gammon.com.au/electronics

#### Dnos

#2
##### Feb 03, 2013, 05:41 amLast Edit: Feb 03, 2013, 05:42 am by Dnos Reason: 1
I'm not too worried about the weight sloshing around. It's only twenty pounds, and if needed we can just put the pivot point at center mass of the pizzas which would make any movement unnoticeable to the rider.

You are correct that motorcycles lean to overcome centrifugal force, but a motorcylist can also lean his/her body for the same effect. The ideal angle for the pizza/the angle for center mass, would then be somewhere between the bike and the rider. Sometimes the bike is leaned more than the rider. Sometimes the rider is leaned more than the bike. The pizza on the back is sloshing around the whole time.

Also think of it this way: You have two pizzas. Pizza one is riding along in the passenger seat of a car. Pizza two is on the back of a bike. Both vehicles go through a turn at the same speed. The pizza in the car made it. What would you expect to see inside the pizza box strapped to the bike that was leaning through the turn?

Second scenario, same situation, except that the pizza on the back of the bike remains at the same angle as the pizza in the car. Pizza in the car survives. What about the pizza on the bike?

Here's two home made gyro cams operating on the same principle. THe first one is just made with a servo that has a gyro in it, designed for RC airplanes and quadcopters. In the air im sure a quadcopter isnt pulling any G's, but on the bike you can see that the camera moves freely from the bike, yet the horizon leans a little with whichever way the bike is turning, I'm guessing at the angle for center of gravity. The second one does a surprisingly good job of staying perfectly horizontal. I wouldn't be surprised if some of that was fixed in post.

http://blog.capinc.com/2011/11/the-motorcycle-gyrocam-project/

#### liudr

#3
##### Feb 03, 2013, 07:47 am
I think with an accelerometer you will be able to sense a tilted direction as the "true horizontal" when your motorcycle is turning.

#4
##### Feb 03, 2013, 08:42 am
I think oric_dan is right. Keeping the pizza horizontal during a turn is going to create a net force on the pizza and toppings toward the outside of the turn. One way to look at it: Imagine looking down from above and tracing the path the pizza makes during a turn. It's going to be an arc, correct? And that means a change in direction and hence acceleration. Now imagine tying a string to the pizza box and whizzing it around you in a horizontal plane. How will the pizza fair? What you want to do is make it so the direction of the total force on the pizza is orthogonal to it's plane. Just like gravity usually does.

#### MaJiG

#5
##### Feb 03, 2013, 09:11 am
Do you need an Arduino?

Won't this work: http://en.wikipedia.org/wiki/Gimbal?

#6
##### Feb 03, 2013, 10:35 amLast Edit: Feb 03, 2013, 10:49 am by jabbado Reason: 1

Quote
What you want to do is make it so the direction of the total force on the pizza is orthogonal to it's plane.

Which is more or less what happens if the pizza box were rigidly attached to the motorcycle
frame, such that it's horizontal when the m/c is straight up and down, rather than being
"actively stabilized".

Exactly. I was hoping the OP would realize that. In fact his idea would work better for a car which doesn't significantly lean into a corner, which is the opposite to what he's thinking. I wonder if any university has ever obtained government funding to research "Topping Drift on a Pizza En Route"

#### Dnos

#7
##### Feb 03, 2013, 11:11 amLast Edit: Feb 03, 2013, 11:43 am by Dnos Reason: 1
I'm too lazy to quote people directly but just a few things, and let me just say that I do like the input. I'm gonna take a couple wild guesses here:

1. There's no way for a topping to fly off of a pizza. Just going on the observation that cheese isn't actually goo and crusts arent actually glued to the box. When a pizza box is tilted too far, the pizza slides and crumples in a corner. The toppings don't just all pop off.

2. No pizza has ever been decimated by a car ride in the history of car rides OR pizzas. The pizza-en-route-via-car scenario is the ideal pizza delivery situation we're attempting to recreate on a motorcycle. Also because a horizontally stable platform on a motorcycle is awesome and could be  used for a number of things. Large camera rigs, carrying potted plants, etc.

3. The net force is not orthogonal to the lean angle of a motorcycle. In theory, yes. In practice there's a rider on the bike and that rider is never leaning at the same angle as the bike, so while a motorcycle does lean to overcome centrifugal force, you can lean off the bike for the same effect. Or if it's a tight, slow corner, you can just lean the bike and sit upright, as is what we're expecting to happen most-often. Plus I'm guessing it's the constant adjusting of lean angles that throws the pizza around.

4. I don't know if an arduino is necessary. I only know that it can be done using an arduino... and an accelerometer, a gyroscope, a motor, motorcontrollers, c++, kalman filter, and some other stuff I don't know about yet.... But if a handful of people can post videos of their two wheeled robots, segways, gyrocopters, and gyrocameras, all using the same tech, I think that this project can be done.

#### Shpaget

#8
##### Feb 03, 2013, 11:34 am

We're trying to prevent a pizza from crumpling into the side of a box when the bike is tilted at up to a 45 deg angle.

2. We're also trying to make a horizon-locked platform on a bike because it's awesome and if we try, we can.

3. The net force is not orthogonal to the lean angle of a motorcycle. In theory, yes. In practice the rider is never leaning at the same angle as the bike.

Lateral forces (the ones you want to reduce) will be greater if you keep the pizza parallel to the horizon than in case where the pizza follows the leaning of the motorcycle.
You do not want to keep the pizza horizontal, unless the bike is stationary or cruising (but in that case there is no leaning).
I'd keep the roll axis fixed, but compensate for pitch, because it is breaking that produces uncompensated acceleration.

#### Dnos

#9
##### Feb 03, 2013, 11:47 amLast Edit: Feb 03, 2013, 12:05 pm by Dnos Reason: 1
I wouldn't lock either axis if it can be avoided, but braking and throttle are definitely a lot easier to modulate by the rider than keeping the bike perfectly angled. The biggest thing I think will be the shorter, stiffer suspension on the bike, ie potholes, speedbumps, dips, etc. I havent thought of a good way to allow movement in 3 axis, apart from just suspending the thing on springs. For now I'll just worry about roll.

I'm much more of a motorcyclist than I am a physicist. This project to me seems like a great way for me to learn. If someone can help me figure out all the parts I need so we can get this whole thing built, we can test out everything in reality instead of just talking about it on the forums. I'm excited to work with arduinos and everything else.

#### Shpaget

#10
##### Feb 03, 2013, 12:21 pm
But roll is the least of your worries.

Why don't you take a bowl of some kind, put some thick paint in it and take it for a ride. Fix it firmly in a way that when the motorcycle is upright the paint stands still. Ride normally as you would around the block, with stops and starts, left and right turns and see which way the paint drifts. My bet is that most will go forward, some will go backward, and very little left and right.

Not only it is a (semi-pseudo) scientific experiment, it's also an excellent excuse to go for a ride.

#### Dnos

#11
##### Feb 03, 2013, 12:40 pmLast Edit: Feb 03, 2013, 01:37 pm by Dnos Reason: 1
I love the idea of taping a sloshing bowl of paint to the back of my motorcycle but why not just just use an accelerometer/g-meter? I can just download an app on my phone. Or better yet, why not build a g meter using an arduino and accelerometer? That's pretty much my plan already. I'm just hoping one of those geniuses that built a stabilizing gyrocopter, or a gyro camera gimbal, or a two wheeled balancing autobot can guide me in the right direction since the selection of hardware available is quite overwhelming. Also existing software would be  a great time-saver.

#### Dnos

#12
##### Feb 04, 2013, 08:53 amLast Edit: Feb 04, 2013, 09:17 am by Dnos Reason: 1
Lol ok seriously, can someone just help me with a parts list? There's like 20 accelerometers to choose from. I also need a motor controller, gyro, shield or other components to put it all together.

#### liudr

#13
##### Feb 04, 2013, 03:18 pm

Lol ok seriously, can someone just help me with a parts list? There's like 20 accelerometers to choose from. I also need a motor controller, gyro, shield or other components to put it all together.

Your location information is missing from your forum profile. I can make recommendation to a simple accelerometer but the shipping will be expensive if you are not on my part of the world.

#### jroorda

#14
##### Feb 04, 2013, 06:21 pm
You can actually forgo for gyro and here is why.  The gyro will only give you changes in rotation rates while the accelerometers will only sense acceleration.  I severely doubt that you could turn a car or anything fast enough to harm a pizza, and compensating for this rotation would require the use of a controlled turntable which while awesome would be VERY hard to build.

Instead you just need to compensate for linear accelerations including that due to gravity.  With a 3-axis acceleration mounted to the pizza carrying frame one only needs to write code that tries to keep all of the acceleration in the Z-axis.  When you are sitting still it should see 1G straight down and no X or Y acceleration.  Thus it will orient the sensor and thus the frame so that straight down matches with the direction of gravity.  If you accelerate hard the chip will see the 1G of gravity plus the say .5 G of +Y.  The combine to form a net force vector that is 63.4 degrees bellow horizontal and it should rotate to shift this net acceleration so it is centered on the Z axis (90 degrees below horizontal)  The gyro would be unnecessary to tell you if this acceleration was due to a linear acceleration of the vehicle or a forward tilt of the vehicle.  The forward tilt can cause the same acceleration reading by shifting gravity to the Y axis.  However because both of these eventualities will affect the pizza identically you do not need to differentiate them.

TLDR:
You don't need a gyro only a 3-axis accelerometer
Write code to keep net acceleration vector aligned with Z-axis (PID might be good here)
You don't need Kalman filters as you won't have gyro data.
It's likely easier than you once thought.

Good luck, sounds like fun!

Go Up

Please enter a valid email to subscribe