Challenge: horizontally / inertially stabilize a pizza on motorcycle

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.

Dnos:
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.

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

  2. 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.

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.

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.

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.

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.

Dnos:
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.

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!

I guess I am also one of those people that doesn't believe that a microcontroller is the solution for everything. Add me in for the gimball. A well balanced, bearinged and weighted gimball will react a million times faster than any closed loop micro/motor/sensor could ever respond.

I should really clarify my previous post. When I said the a doubted a car could turn fast enough to harm a pizza I meant purely rotationaly. Imagine a pizza rotated about the middle so that it spins around. Now imagine how fast one would need to spin this pizza or how hard one would have to accelerate its rotation to do it any harm. I would imagine that it would need to be quite fast, and while his driving is amazing the maximum rotation rate is likely not in excess of 180 degrees a second. Not near enough by itself to harm a pizza.

The issue is the sideways g-force that is generated in the turn. This defiantly would harm a lowly pizza, but this sideways force is something the accelerometers can sense and your platform can realign to be straight down relative to the pizza. As far as the pizza is concerned gravity just got a bit stronger, but any sideways force is countered by the force of gravity which is no longer straight down on the pizza.

A well weighted suspended platform could work well and would be simpler, but without damping you could get oscillations at its resonant point that could harm the pizza too. After any sudden stop you would get a swing-set effect. Damping would help, but it would also slow the response to a sudden impulse. Good gimbals with a pair of positional servos could likely react faster than a simple pendulum without any noticeable oscillation. I would bet your main sensing loop could run at least a few hundred times a second making the system very low latency. The limit would be the maximum rotation rate of your servos, but they can be quick as well. Without the motor the platform is essentially a proportional controller. If you do a little looking into controls theory you will find why a proportional, integral, derivative controller (PID) would result in faster rise times with much less oscillation.

I think the biggest destructive force is that a motorcycle leans in turns. This would essentially lift the pizza up (assuming the box is affixed to the bike), which reduces the friction and the pizza will basically continue trying to stay in place while the box is moving. For most other movements of the bike, the friction of the pizza is likely enough to keep it moving along with the box. The little plastic spacer they put in the middle of the pizza would help a little with keeping the pizza from lifting.

I think the biggest problem in the moped/pizza scenario is that as the moped goes over bumps the pizza will sometimes have little/no contact with the pizza box - any time this happens while the moped is accelerating/braking or being thrown around sideways, the pizza will tend to shift and end up crumpled against the side of the box. Probably the best thing you can do is give the pizza box relatively soft vertical suspension with plenty of travel, and tell the rider not to accelerate or brake hard.

liudr:
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.

I'm in Berkeley, Calif.

Retroplayer:
I think the biggest destructive force is that a motorcycle leans in turns. This would essentially lift the pizza up (assuming the box is affixed to the bike), which reduces the friction and the pizza will basically continue trying to stay in place while the box is moving. For most other movements of the bike, the friction of the pizza is likely enough to keep it moving along with the box. The little plastic spacer they put in the middle of the pizza would help a little with keeping the pizza from lifting.

THe pizzas will be in a box, which will be in those insulated delivery bags, which will be in a plastic luggage box, which will be connected to a luggage rack on the back of a bike.

If you guys haven't seen this, here's a thread about using accelerometers, gyros, kalman filter, etc. Arduino Forum

oric_dan:

THe pizzas will be in a box, which will be in those insulated delivery bags, which will be in a plastic luggage box, which will be connected to a luggage rack on the back of a bike.

We all love theory, but have you actually just tried it on the bike to see what would happen?
Maybe there's no problem.

Yep. I'm out. Seems like over-engineering for something done more simply another way. But, I can realize that there is fun in learning all sorts of new things attempting this, so no harm in doing it. I just tend to try to stick to the KISS principle and this forum heading did mention "advice on feasibility."

Good luck, OP. It does sound like fun.

Retroplayer:
I just tend to try to stick to the KISS principle and this forum heading did mention "advice on feasibility."

Good luck, OP. It does sound like fun.

I dont expect everyone here to speak english as a first language, so I'll just say that "feasibility" does not mean "shoot someone's project down" and then "Argue about the best reason not to do something." It means "How possible is it for something to be done." Nobody has said anything about the "feasibility" of this project. They just recommended that I do it their way with bowls of paint, weights, or some other device not including an Arduino.

For the most part this discussion has been guessing what happens to a pizza on the back of a motorbike. I'm tired of posting about this and having nobody read them so I'll just say this: IT DOES NOT MATTER. Forget about the pizza for a second, just help me build a platform that remains horizontal while the bike is at tilt. THAT's the goal. You can tell me how dumb you think the idea is later. For now I know that the hardware required is the exact same hardware that this uses:

There are many other iterations of this same design, so I know creating what I want to create is 100% feasible, and has been done by many other people. Only difference is that nobody has stuck one to a bicycle or motorcycle

I'll ask oric_dan to please only post if there is something constructive to add to the subject.

You can tell me how dumb you think the idea is later.

I, personally, never said your idea was 'dumb.' I don't think it is at all. I am just of the opinion that there are much simpler ways to accomplish your goal and you are stuck doing it the way you want. There is nothing wrong with that, but you are asking others to go down the hard road with you when they know there are simpler ways or that in the end, it really isn't as much of a problem as you present. It's that simple. If you want to be stubborn about HOW you do it, you should reasonably expect that you may have to go it alone. That's all. I do that all the time, myself, and usually have to go it alone.

My unsolicited advice is to post specific parts of your project asking for help separately as you encounter problems. When you put out the whole thing at once, you are inviting comments on how to solve the overall problem, when you really want to do it a very particular way. So, post those 'particular ways' spearately to get advice on how to implement them.

There is alot of value in doing things the hard way. That's the best way to learn. Getting butt-hurt on a forum is a sure-fire way to stop people from trying to help as you just come across as stubborn and argumentative when you do that.

Again, my unsolicited advice. Take it or leave it.

Good luck with your project.

To make this a constructive post, if you don't view it as one, try starting here: Ball Balance Machine - Make:

I'm not interested in arguing with you so please stop. Take the attitude somewhere else.

There is no "hard road" for you. You either can contribute to the hardware parts list or you can't. And i havent been stubborn. Your idea of adding a swinging counterweight to the back of a bike has some issues. The added weight, the uncontrollable momentum, the added height and width required for the mechanical gimbal would be a lot. The idea of using an arduino is simple because its already been done many times in many different ways. By making this thread I hoped to reach out to one of those people.

I assume you can make/find a pivoting assembly and actuators capable of positioning it as fast as you need. Figuring out what 'horizontal' means is going to be the tricky bit and will require clever combination of gyro and accelerometer input. Maybe you can 'borrow' the code for this from an existing balance bot, but I suspect you'll find that most of them just go from sensor input to negative feedback directly without ever explicitly calculating the orientation of the vehicle. You might find that the Arduplane project gives you a better starting point, and if you also take one of the purpose-built Arduino clones and use the 'gimbal control' feature you can probably get it to do what you want with relatively little effort.

Obligatory disclaimer: I don't believe the behaviour you're trying to achieve will give you any benefit in the pizza delivery stakes. :slight_smile:

Getting butt-hurt on a forum is a sure-fire way to stop people from trying to help as you just come across as stubborn and argumentative when you do that.

Some people just don't understand what a public forum is all about. Also, given the
reactions, I doubt pizza has anything to do with this, it sounds more like a senior project
assignment.