I hate to ask this because I'm sure the answer isn't simpler, can you do a video to show how to do the chip/wiring and programming? I feel like that is something I could use for other purposes and even make a few projects with my sons to spend some quality dad time with them. Thanks
How would you get electronic to "maintain that angle". You can't just have a huge gyro or SAS on a bike, that's no possible unless you use a multi-point ABS or something like that. Cruise control itself won't hold an angle.
Yep, otherwise if you need to slow down while signalling a right turn you might go over the handlebars. Signalling a left turn is less important as you are not crossing the opposing flow of traffic.
Thanks, that's an interesting rationale, never would have thought of that. Though, if you go over the handlebars when using the front brake, you're doing something quite wrong :) It's the front one that actually makes the bike stop, the rear one just sends you into a skid :D
Well, bike frame anyway. Take angle value, take pot value, scale both appropriately, add/subtract pot pseudo value from angle value => you can tune the angle the servo kicks in. Simples.
The problems wouldn't still exist. Any configuration of body mass, arm length, and ride style will have a certain preferred balance angle. You just need to tune that one value for the rider, and you're set. And if the PID is implemented on both the motor and brake, a fairly wide range of values would work. They'd just be less comfortable the further away from the preferred point it is. You'd probably want to set an "on" angle, so that the controller doesn't start unless you're actually trying to wheelie.
Hey Tom, Might be worth logging the way you do a wheelie first - by taking the data from the accelerometer and a potentiometer on your brake handle. This should get your native wheelie angle and brake force applied, once this data is obtained you could match it with your servo or even continue to use the POT to match a force applied to the brake with the servo. Obviously this is in no way dynamic like the segway as it will be matched completely to your wheelie profile.
no, youre just cutting out the jitters. essentially the average of values over time. the response time is not affected at all what so ever. time is constant. martinvb.com/wp/wp-content/uploads/2016/08/g_comp_b2b3.png
@@CerebralDad I don't understand what you mean by "time is constant", but as you can probably learn from any signal processing book, "removing the jitters" is essentially removing the high frequency spectral components, which inevitably leads to the increase in the system's response time. Roughly speaking, if you take a step function (i.e. infinitely fast event), that is 0 for t0, through any smoothing algorithm, it will become some smoother function, that is still 0 at t
I think it could be done completely automatically if the control system was operating the motor rather than the brake, and was able to sense the amount of torque applied to the motor compared to motor position. Comparing wheel torque with both angular and linear acceleration should allow a controller to differentiate between forward movement and tilt change. In this way, the controller could seek the angle at which required torque is minimized. It would not be that different from other self-balancing devices.
This is a really nice idea. The motor and position could be estimated by a tri-phase current sensor. Torque would be very well approximated by constant*total_current and the axial displacement of the motor shaft by integration of the tri-phase angle matrix.
Actually, torque would be equal to power divided by angular velocity, and power is voltage times current. Both current and voltage change at the same time when revving an electric motor.
except self balancing devices are direct drive. the motor is both drive and brake. on a bike the motor freewheels, so it has no brake authority. there would be no way to stop it from flipping over backwards.
The motor freewheels? Not on this design. Maybe on a mid-drive system where the motor is attached to the pedal sprocket. But on Tom's designs, the large pulley is directly coupled to the wheel. Note that a freewheel system would prevent regenerative braking as well, so it is not preferred.
Its amazing to see how much you have developed from here until now. From being new with arduino and unsure with coding to your later videos where you have been using arduino in your VTOL aircraft. Great stuff, from a proud patreon
I never even knew people used brakes at all when doing wheelies on bikes until I watched this video. When I was younger and we used to do wheelies down the road we never used brakes, just held onto the handle bars and jumped off the bike backwards if the bike was going to flip over.
pretty much exactly what i used to do, I started watching youtube videos to learn about the brakes and stuff... still didnt stop me from breaking my spine everytime I flipped over lol
I don't know how you would flip over backwards without having an instinctual reaction of jumping off, and planting your feet on the ground prior to the bike flipping so far back that you land on your back. I would literally have to try very hard to let that happen
Originally I wanted to try this on a dirtbike but more mechanically and use the foot brake with a lever and spring system(kind of like the throttle cut device but to apply the rear brake). I always had the thought of using an Arduino but I knew a servo wouldn't be strong enough to stop a dirtbike and I wasn't going to find out the hard way lol. since then I decided to scale down for a prototype and right now I'm using a Servo attached to a drone flight Flight controller in an effort to smooth out the actuation of the braking, however, my Lack of understanding when it comes to optimizing PID values has been my downfall. I'm sure if you knew what you were doing this system would work flawlessly! Good Luck!
What I love about your videos is you show everything "warts 'n' all". Real world engineering is about examining challenges, proposing, developing and testing solutions, but, without immense resources, there will always be assumptions or variables that weren't considered, which means that things often don't work perfectly first time or at the very least can be improved. You aren't afraid to show the imperfections and design iterations that are what real-world engineering is all about. Our 'failures' or imperfect designs and consequent design iterations are always the greatest learning experiences which is what makes your videos so much more valuable as a viewer. I wonder if this challenge can be more easily solved using the electric bike, since you will gain potentially finer control of both torques acting on the wheel? I suspect the rider's mass distribution is by far the largest variable though. The segway also has things much easier as the torque control is provided by the same mechanism, i.e. the motor that drives the wheels, which is probably easier to characterise than a friction brake and gives finer control than a simple mechanism such as you've implemented can provide - the braking force is going to be quite non-linear for any friction brake ultimately. It's an impressive video though and very successful given the time spent on it! Maybe a dedicated wheelie bike without a rear freewheel allowing the motor to provide propulsion and braking forces? Unicycle?
I think the solution is to monitor the rate of agular change not set an absolute angle, this would give allot more flexibility , not to mention it wouldn't pull the brake when you go up a hil :p
Of course, that would theoretically try to keep the change of angle constant! But it would make getting into the wheelie quite difficult, maybe add a button to disengage the system at the start, and then let go at the proper angle?
Andrew B Your suggestion of measuring the rate of angular change not withstanding, the arrangement that he has doesn't care whether he is going up or down a hill unless the hill is more than 45°. The sensors are measuring the angle relative to the direction of gravity. ;)
If you can measure the speed, and then calculate the rate of the change of speed - acceleration of the bike, on top of the angle sensor, you have enough information to compensate for all of those "balance torque, including the riders arms", weird angles (the angle it's mounted no longer matter when you only measure rate, but you still want it to check it's not zero due to "both wheels on ground" I guess) stuff you were talking about... when you have acceleration = 0 and the rate of change of angle = 0 then all those dynamic torques/weights/etc are in balance. if the rider leans forward, then the angle rate increases, and to zero that out, the bike will need to accelerate, which means non-zero acceleration... Drive your control system to zero both out, and you have balance. You can drive "break only" with the same control system, was just easier to talk about assuming perfect rear wheel motor power output control. I hope that made sense.
Hi Tom; cool project once again! What I think is working against you the most, from a control theory perspective, is the amount of 'play' in the brake system. These electronics have a nonzero reaction time in the first place, and once the system reacts the servo first has to pull itself through the non-activated part of the brake; which makes any delays so much worse. Of course you can try and counteract this by making the servo more aggressive; but that makes for a very jolty system. Things would probably improve a lot of you calibrated the servo-brake mechanism to have some pre-tension, so that at rest it is not-quite-engaged, so any servo input will more or less directly and proportionally engage the brake. Play in your system is notoriously difficult to correct for in any control system, and it definitely obeys a 'less is less' kind of dynamic. A PID loop by itself will do little to correct this characteristic, and can even lead to really annoying chatter. Its based on linear theory and play is intrinsically a nonlinear feature (or plateau) in your input-output relationship.
As a "senior statesmen" of watching RC stuff online and finding your channel awhile ago I have to say you are very good at teaching old dogs new tricks. I have been interested in seeing what Adrino was. Thank You for doing something with this.
A motor spinning the front wheel will give you a gyroscope on the front end. I used to see a guy riding wheelies around entire motocross tracks with such a set up. He toured the circuit, I believe he called himself "The Wheelie King"
What about taking the concept to RC? you could use some quad motors to make a direct drive RC car with stability control. Endless endos and wheelies. Plus you could publish the design so I could build one.
I have an ambition to make a decked out 4 motor car with stability, steering and so on controlled by whatever the equivalent of a flight controller would be. More out of curiosity than anything else but it might be cool to be able to control the driving characteristics and drift angles really precisely, this would just be one example. I was trying to get Tom to figure it out for me!
I learned to ride a wheelie in 1976 , my bike is 20" with a coaster brake , my longest is 5.5 miles @ 2 to 3 mph no greater than 5 mph . Curiosity made me watch this and I must applaud how deep you have delved into the physics using electrical components . That device you created is equally terrifying as it is terrific . My mind is blown by your whole concept and I have nothing but accolades and applauses for your efforts . Simply Magnificent , especially for a prototype . I would deem that a first round success if I were you .
as a former kid that tinkered with anything i could get my hands on , and now 52 and still at it,things like this kit are so damn cool to me. kids today have no idea how lucky they are ,to be living in great times like we have today. for anyone to be able to just look up ,order ,and get it days later is amazing fun.and so cheep.
You also need to account for the forward acceleration adding to the perceived angle the accelerometer is measuring with every pedal push. You would probably need to measure the rear wheel rotational speed and add a correction value based on that.
Truly excellent project. If I may share some thoughts: 1) It would be possible to have the Arduino read a handlebar mounted pot to facilitate a field adjustable braking starting point for the braking process. Pots can be read by a standard Arduino with 8 bits resolution. Some inexpensive microcontrollers can read with 12 or even 16 bits resolution. 2) Likewise, it may be possible to have the Arduino read a separate pot to field adjust the slope of a line describing the increase in servo rotation per degree of tilt, thus resultant caliper tension. 3) One could self-enforce consistent elbow angle, or measure the distance between, say, the handlebar stem and the rider's chest using a standard general purpose ultrasonic range sensor or specialized infrared drone ground proximity sensor
Been following your video for the engineering but also learning to wheelie (can almost do it after 2-3 months on/off). I'm not surprised the tuning is so difficult as its very dependent on your position on the bike and its quite a fine adjustment. Very impressed that you can do the engineering AND can wheelie too!
+ClaudeSac No, it is you who is thinking this in the wrong way. Since the Arduino is using a gyro the brakes will automatically deploy up a hill as it cannot tell the difference between them. Use that brain of yours before commenting, please.
Add a potentiometer. Code it to adjust the angle of the balance point. Take a lot of the weight out of the setting so you turn the potentiometer a lot and move the angle a little. Add a second potentiometer and use one for High Gain and one for low gain. Set the length of your break wire to where you're happy and don't touch it again, you should just adjust the software not the hardware ( once you get it to the right length ) in my opinion. I'm currently working on a drifting/racing/R.C./GPS/riding lawn mower with a working mower deck. This thing wouldn't be possible without you and your Channel. Thank you so very much.
Balancing a bike would be a classic inverse pendulum problem, its a non-linear problem and will take a bunch more math than just implementing a PID controller.
Adrian Forbes - I think you're right. Any links to any projects, code, papers... anything really, on the subject? I am just starting out. Got the chips and the coding experience, need some help with the physics and the mechanics.
A good start is googling "inverse pendulum arduino". There's tonnes of information to absorb there. Once you have a good general idea of how it works then you'll know if you need more specific information.
@@clonkex - Thanks for that, there is indeed a ton of stuff there. However, there is one major difference, in that a true wheelie system will ONLY have unidirectional forward motion, and any overbalance will always be corrected by braking (either off the brakes or off the engine), whereas these balancing robots move (jitter?) backwards and forewards to ensure they don't topple. That's quite a difference, any ideas how to tackle it? Of course, the existing robots ARE essentially doing a wheelie when they travel forewards - I guess - but they don't propel themselves into it (do they?). Also, when they move forward they do so at fairly optimal balance point, I don't think they'd correct a suboptimal angle by going faster (would they?) All very interesting...
Actually off the top of my head I think it would be exactly like one of those balancing robots when it's moving forward... unless the human is providing the forward motion (so the electronics can't control it). When the balancing robots are moving forward they just tip forward then accelerate so they end up moving forwards but with the centre of gravity right over the axis of rotation (the wheel); i.e. they should end up upright, but moving forwards. Maybe a slight tilt forwards is necessary due to rolling resistance, not sure.
@@clonkex - Yes, the other interesting thing is when BOTH the human and the electric motor are supplying the power simultaneously. You'd need to figure if the pedaller was "getting it up" enough, and assist if not. OTOH if the pedaller wasn't trying to wheelie, there'd be no point trying to assist it. So you'd need to detect (somehow) if a wheelie was being attempted. Maybe either through a "wheelie mode" switch, or some smart acceleration monitoring software.
Great start, and thanks for the inspiration! I'd never for a moment have imagined that such a simple servo-brake setup would work AT ALL. Also amazing and really encouraging to see just how many people are working on the same idea - why, there's enough just here to make a forum... I agree that you should use the gyro reading to track your rotational moments, and maybe blend with some PID mechanism. Someone also mentioned that it's a non-linear "inverse pendulum" problem. I'd like to hear more about that. I wonder if some Machine Learning would be of use here, too? I'll probably start experimenting with a model, my wheelies are pretty poor (read nonexistent). I also prefer to use ESP chips. You can program them in the same IDE as Arduino, but they are quite a bit more powerful, and cheaper. Built-in WiFi also facilitates remote logging or RC control. Really cool to see there's so much support, hey this may work out now! Can't wait to see what else, erm... comes up :) ==== PS. I am also shocked, I say, shocked!! to find out that some benighted (LOL) countries put the rear brake on the right. Motorbike riders must just love that...
Yes dude! I've been wanting to try this ever since I saw the alta motorcycle. They could have a wheelie mode on it. You would just have to lean back twist the throttle and the bike would find its own balance point. The brake is one way to do it, you could also wire it to control entirely with the throttle. Glad people have started experimenting!
15:28 surely a PID controller could adjust for a different balance point on the fly? Its job is just to keep the angle between the bike frame and the horizon constant. How does a quad copter adjust for a wind gust for example?
Great project as always. If this device is just meant to prevent loop outs you're oh so close! If the brake reacted to rate of angular change providing a short sharp stab of rear brake when you're over your tuned threshold you'd have much more consistent results given the variables you've already identified. This is one of your most commercially viable tinkerings, happy coding!
Just started the video, plan on finishing it, but I just wanted to say that I have no idea what you're talking about as far as this board and tech goes, but it's cool XD
Hi Tom, I have a suggestion for you. Why don't you tap the analog signal from the throttle on your handlebar into the Arduino and then digitally control the vESC. Because you have a Gyro on board it would allow you to program a variety of control systems to control the bike in various conditions like when you're riding normally and holding a wheelie. A PID system can help you maintain a wheelie continuously without using brakes, and may be bring your nose down very smoothly when you throttle to zero. Using potentiometers on your brake cables will allow you to play around and design with a combination of so many i/o methods and control systems. All the best.
If you can do this, you can probably put a rotary encoder on the wheels to detect slip-skid. This means you might be able to do ABS and traction control in a future project. Any chance that'll come up?
you should revisit this project, using your speed to gauge the angle ratio, and also smooth out the braking to be more generous. Add in a couple of control knobs for target angle and speed so you can adjust on the field
I love all the interesting ideas you come up with on this channel! Even when they’re simple ideas they’re still super interesting and I always want to stay tuned in to see how things turn out. 🤙
Is there a way to measure the angle of the strain on the rear axle? The controller could be set to keep it as close to gravitationally vertical as possible, because that means the center of mass is directly above the hub.
Hi Tom, great stuff. It's always interesting hearing you think through the problems. A few thoughts you may want to consider : If you wanted to account for the riders relative position to the bike, it would be interesting to put a second inclinometer/gyro on the back of the rider. It won't give you distance, but may give you some kind of trim to your controller. If you set up an sd card (I assume there is one in your dev kit) you could try logging a "perfect" wheelie to see what angles you need to start applying the break. (it may also give you some nice plots for your content). With a second gyro you may see a relationship that can be used to improve your control loop I would put a bit of averaging in to the system to remove the gitter (maybe an IIR filter?). If your getting angle from an accelerometers, it's going to noisy. I've done a couple of PID's on 8bit micros in the past and it can be challenging. You probably only need the P and a little bit of I. There are some useful libraries out there for the arduino where you set up your Kp Ki and Kd gain and let the function do the work for you. I don't usually post comments... Ever... But I do find your channel very interesting. I hope my input is of some interest /help. Keep up the great work. Thank you Matt
You could have a device that has calibration built in, to set a persons balance point. This could possibly be done by allowing them to put the device into a calibration mode, the code could do something like check for a threshold value that exists for x amount of seconds. This step could be repeated x amount of times to make the program fine tune the balance point. Then this would work no matter what weight, height & arm length the person has. Nice work so far!
Cool stuff! I bought that exact kit about a year ago and it's changed my life. The arduino in combo with raspberry pi and a 3d printer and one can do lottsa stuff!
A neural network would be a really interesting idea here, to read Tom’s brake pulling vs. pitch inputs and try to replicate it (as opposed to having to write an algorithm to determine the right time to pull the brake).
Great project, i would suggest looking at PID's or MIMO's could potentially code a feedback loop that will try to keep an angle or even find a stable angle on its own.
The question of a balanced bicycle on one wheel is an interesting one. However, this is not the only complication we're facing here. Your discovery, that you were controlling the angle by actively changing the center of mass (10:45), effectively "cheating" your own device, shows that the device would have to "measure" (and factor in) the rider's "intention". One could possibly measure the rider's physical interaction with the bike, e.g.- the pull/push force on the handles, the force being applied to the pedals and to the seat, which should give enough information for a rough estimation of the rider's intention, and position relative to the bike, but I'm not sure that's enough. A sloped ground would also change the wheel's point of contact with it, and as a result the angle of balance. The deterministic approach presented in the video is safer than others in some respects, but may require a lot of programming to achieve a usable result. A different approach might be to feed all of the sensors' data into a learning algorithm, (an "AI"), and let it determine when to apply the break, (and with what force)... preferably using data from skillful riders. Thanks for raising the question, and for taking the time to explore and share it with the rest of us. You seem to enjoy what you do, which is all any of us can hope for.
Nice project board & case! :D Protip: When using those external power regulators on a nano, put a schottky diode between the power reg and the nano's 5V line - that way you can still plug the nano in to usb without problems :)
For future portable experiments, maybe use an adjustable pot + LCD display to be able to tune the response of the servo without having to connect to a laptop? Years ago, RCSUPERPOWERS made an RC "jet" (may have been EDF or prop, I forget) and it had accelerometer-controlled canards that would let it fly controllably at amazing angles of attack.
You have to make the Arduino react on the speed of which there is a change in in degrees over a certain point - not hardcore it to an actual degree. There is Arduino library's out there you can use for it.
Great idea Tom! I’m impressed with your arduino work for a first time. Maybe look into filtering your values from the accelerometer to avoid actuation jitters in the servo. Keep up the good work
Have you considered a deadman switch? A thumb button that has to be held in to keep the wheelie code running would mean the bike doesn't go speeding away if you fall off. That way it would be safer to let the code control your motor as well. Very nicely presented technical videos, by the way
have you tried having a secondary back break connected to the device. with the device connected to those breaks instead of the handle bar breaks? that way you are still able to use the hand break and it be functional, while the secondary pads on the back wheel being soley for the servo. maybe a clamp that slowly closes as the angle gets more and more steep, fully closing at 60 degrees. perhaps a corkscrew that spins openning and closing the clamp.
Thanks to everyone that watched more than 6 seconds of this video!! To the others, thanks for the wheelie advice 😂
I have made a simple wheelie cheat for my Ebike please check it out on my instagram shanelangen8415 I can explain it
2Crazy1Side SE bikes on duro did you Se my easy wheelie set up on my instagram
I hate to ask this because I'm sure the answer isn't simpler, can you do a video to show how to do the chip/wiring and programming? I feel like that is something I could use for other purposes and even make a few projects with my sons to spend some quality dad time with them. Thanks
Millie Muncher contact me on my Instagram
can u share the code? i want to do it with my dirt bike with some mods.. ;p
The software brings the nose down? You've turned your bike into a 737 MAX 8.
I have been on UA-cam for about 4 years, and you are officially the most funny comment that I have ever had the pleasure of laughing at.
Perfect! Too funny.
Haha
mCaS
@@user-or1uo4ct9r Now available as Manual Characteristics Augmentation System
these minecraft building tutorials are getting harder and harder
Lmfao 😂😂😂
this has fuck all to do with a shitty minecraft game ... GROW UP !
@@JUST-UK-JAY Okay Jay with the Anonymous profile picture who is subscribed to "All sexy girls in the world"
@@JUST-UK-JAY okie dokie 🅱️🅾️🅾️mer
@@JUST-UK-JAY fuck up men you are a guy who sub to all girl ay badeng
Badeng is a gay
Do it like a cruise control, you pull a wheelie then press a button to set the angle, then the electronics take over and maintain that angle
It's possible, but when you are not at your balance point, you will either accelerate or decelerate.
Basically hover board or segway programing.
How would you get electronic to "maintain that angle". You can't just have a huge gyro or SAS on a bike, that's no possible unless you use a multi-point ABS or something like that. Cruise control itself won't hold an angle.
@@aidanginise best I can think of is electric motor to pitch backwards and brakes to pitch forwards provided forward motion is present.
RB Ching: Then you can burn up the brakes and motor ; )
Why is your rear brake lever on the left? :o Does everything have to be left-hand drive in the UK? :D
hanetar I would complain but that was pretty good
Haha yes it's because we drive on the left. Though I'm not sure why the brakes need to change depending on which side of the road we drive on.
Yep, otherwise if you need to slow down while signalling a right turn you might go over the handlebars. Signalling a left turn is less important as you are not crossing the opposing flow of traffic.
Thanks, that's an interesting rationale, never would have thought of that. Though, if you go over the handlebars when using the front brake, you're doing something quite wrong :) It's the front one that actually makes the bike stop, the rear one just sends you into a skid :D
Using the front brake alone can cause the bike to tip up, you are obviously not going fast enough. :D
Add a potentiometer on the steeringwheel to adjust the balancing point on the fly?
Steering wheel??? Haha have we all been watching the same video Danny?
YASSS
Well, bike frame anyway. Take angle value, take pot value, scale both appropriately, add/subtract pot pseudo value from angle value => you can tune the angle the servo kicks in. Simples.
A potentiometer would certainly help tuning the break angle faster in the field for testing, but the general problems tom described still remain.
The problems wouldn't still exist. Any configuration of body mass, arm length, and ride style will have a certain preferred balance angle. You just need to tune that one value for the rider, and you're set. And if the PID is implemented on both the motor and brake, a fairly wide range of values would work. They'd just be less comfortable the further away from the preferred point it is.
You'd probably want to set an "on" angle, so that the controller doesn't start unless you're actually trying to wheelie.
Try to go uphills with that (:
Why is it not going anywhere?
Why am I skidding backwards?
Oh I know (crashes to a tree)
ayy lol
Kadirhan Yavlak i
try going down steep hills
Have you *tried* biking up a hill at that angle? Fat chance that he would need to account for that.
The world needs more engineers like you. Hands on and educated.
The easiest way to do a wheelie for me is just riding my unicycle.
Nice
Nice
Nice
Nice
Nice
Hey Tom,
Might be worth logging the way you do a wheelie first - by taking the data from the accelerometer and a potentiometer on your brake handle. This should get your native wheelie angle and brake force applied, once this data is obtained you could match it with your servo or even continue to use the POT to match a force applied to the brake with the servo.
Obviously this is in no way dynamic like the segway as it will be matched completely to your wheelie profile.
Or learning how to wheelie properly
Youre going to need to filter the sensor values to smooth the result
If you cut high frequencies off, you will lose in reaction time.
youre not cutting the frequency youre smoothing the value
@@CerebralDad which is exactly equivalent to cutting the high frequency.
no, youre just cutting out the jitters. essentially the average of values over time. the response time is not affected at all what so ever. time is constant. martinvb.com/wp/wp-content/uploads/2016/08/g_comp_b2b3.png
@@CerebralDad I don't understand what you mean by "time is constant", but as you can probably learn from any signal processing book, "removing the jitters" is essentially removing the high frequency spectral components, which inevitably leads to the increase in the system's response time. Roughly speaking, if you take a step function (i.e. infinitely fast event), that is 0 for t0, through any smoothing algorithm, it will become some smoother function, that is still 0 at t
I think it could be done completely automatically if the control system was operating the motor rather than the brake, and was able to sense the amount of torque applied to the motor compared to motor position. Comparing wheel torque with both angular and linear acceleration should allow a controller to differentiate between forward movement and tilt change. In this way, the controller could seek the angle at which required torque is minimized. It would not be that different from other self-balancing devices.
Exactly what I was thinking. He'd definitely need to filter those sensor values though. The Kalman filter would be perfect.
This is a really nice idea. The motor and position could be estimated by a tri-phase current sensor. Torque would be very well approximated by constant*total_current and the axial displacement of the motor shaft by integration of the tri-phase angle matrix.
Actually, torque would be equal to power divided by angular velocity, and power is voltage times current. Both current and voltage change at the same time when revving an electric motor.
except self balancing devices are direct drive. the motor is both drive and brake. on a bike the motor freewheels, so it has no brake authority. there would be no way to stop it from flipping over backwards.
The motor freewheels? Not on this design. Maybe on a mid-drive system where the motor is attached to the pedal sprocket. But on Tom's designs, the large pulley is directly coupled to the wheel. Note that a freewheel system would prevent regenerative braking as well, so it is not preferred.
Its amazing to see how much you have developed from here until now. From being new with arduino and unsure with coding to your later videos where you have been using arduino in your VTOL aircraft. Great stuff, from a proud patreon
i hope people know how scary it is not having your finger on the brake when wheeling and dont think he is just pussing out :D
I never even knew people used brakes at all when doing wheelies on bikes until I watched this video. When I was younger and we used to do wheelies down the road we never used brakes, just held onto the handle bars and jumped off the bike backwards if the bike was going to flip over.
pretty much exactly what i used to do, I started watching youtube videos to learn about the brakes and stuff... still didnt stop me from breaking my spine everytime I flipped over lol
How many times have you broken your spine now?
I don't know how you would flip over backwards without having an instinctual reaction of jumping off, and planting your feet on the ground prior to the bike flipping so far back that you land on your back. I would literally have to try very hard to let that happen
Exactly like this kid right here is what I mean. ua-cam.com/video/927-WNvoK_g/v-deo.html
No Way!!! I've been working on this exact concept for a few weeks now and you beat me to it!! Anyway, I love the videos man keep it up!
That's awesome! How far have you got with the concept? Are you using the angle to activate the brake, or something different? Thanks!
Originally I wanted to try this on a dirtbike but more mechanically and use the foot brake with a lever and spring system(kind of like the throttle cut device but to apply the rear brake). I always had the thought of using an Arduino but I knew a servo wouldn't be strong enough to stop a dirtbike and I wasn't going to find out the hard way lol. since then I decided to scale down for a prototype and right now I'm using a Servo attached to a drone flight Flight controller in an effort to smooth out the actuation of the braking, however, my Lack of understanding when it comes to optimizing PID values has been my downfall. I'm sure if you knew what you were doing this system would work flawlessly! Good Luck!
Yes course you was lol
When are you making a new video Daversity it’s been 7 months!!!!!
Just filmed a video with my Miata this past weekend gotta find time to edit. should be this week though!
What I love about your videos is you show everything "warts 'n' all". Real world engineering is about examining challenges, proposing, developing and testing solutions, but, without immense resources, there will always be assumptions or variables that weren't considered, which means that things often don't work perfectly first time or at the very least can be improved. You aren't afraid to show the imperfections and design iterations that are what real-world engineering is all about. Our 'failures' or imperfect designs and consequent design iterations are always the greatest learning experiences which is what makes your videos so much more valuable as a viewer. I wonder if this challenge can be more easily solved using the electric bike, since you will gain potentially finer control of both torques acting on the wheel? I suspect the rider's mass distribution is by far the largest variable though. The segway also has things much easier as the torque control is provided by the same mechanism, i.e. the motor that drives the wheels, which is probably easier to characterise than a friction brake and gives finer control than a simple mechanism such as you've implemented can provide - the braking force is going to be quite non-linear for any friction brake ultimately. It's an impressive video though and very successful given the time spent on it! Maybe a dedicated wheelie bike without a rear freewheel allowing the motor to provide propulsion and braking forces? Unicycle?
It's a wheelie good idea Tom!
O
M
G
W
T
I love playing with IMUs, it’s so satisfying playing with your creations when it’s orientation dependent
I think the solution is to monitor the rate of agular change not set an absolute angle, this would give allot more flexibility , not to mention it wouldn't pull the brake when you go up a hil :p
Of course, that would theoretically try to keep the change of angle constant!
But it would make getting into the wheelie quite difficult, maybe add a button to disengage the system at the start, and then let go at the proper angle?
Andrew B Your suggestion of measuring the rate of angular change not withstanding, the arrangement that he has doesn't care whether he is going up or down a hill unless the hill is more than 45°. The sensors are measuring the angle relative to the direction of gravity. ;)
That would be a heck of a hill! XD
You mean mt everest? The road with the steepest grade in the world is "only" about 30%, or 13.5 degrees
Very interesting. There are many ways one could go about the design to get the end result but you've actually put in the time and energy. Good job
If you can measure the speed, and then calculate the rate of the change of speed - acceleration of the bike, on top of the angle sensor, you have enough information to compensate for all of those "balance torque, including the riders arms", weird angles (the angle it's mounted no longer matter when you only measure rate, but you still want it to check it's not zero due to "both wheels on ground" I guess) stuff you were talking about... when you have acceleration = 0 and the rate of change of angle = 0 then all those dynamic torques/weights/etc are in balance. if the rider leans forward, then the angle rate increases, and to zero that out, the bike will need to accelerate, which means non-zero acceleration... Drive your control system to zero both out, and you have balance. You can drive "break only" with the same control system, was just easier to talk about assuming perfect rear wheel motor power output control. I hope that made sense.
19:23 Nice job Tom. I couldn't do these videos without you either.
these kind of coding and servo related videos I have really wanted to see for a long time! Please do more projects like this :P
1:27 as an osteopath I seriously recommend that you get a stand for the lap top - as your neck is bent at a very unhealthy angle.
Hi Tom; cool project once again! What I think is working against you the most, from a control theory perspective, is the amount of 'play' in the brake system. These electronics have a nonzero reaction time in the first place, and once the system reacts the servo first has to pull itself through the non-activated part of the brake; which makes any delays so much worse. Of course you can try and counteract this by making the servo more aggressive; but that makes for a very jolty system. Things would probably improve a lot of you calibrated the servo-brake mechanism to have some pre-tension, so that at rest it is not-quite-engaged, so any servo input will more or less directly and proportionally engage the brake. Play in your system is notoriously difficult to correct for in any control system, and it definitely obeys a 'less is less' kind of dynamic. A PID loop by itself will do little to correct this characteristic, and can even lead to really annoying chatter. Its based on linear theory and play is intrinsically a nonlinear feature (or plateau) in your input-output relationship.
As a "senior statesmen" of watching RC stuff online and finding your channel awhile ago I have to say you are very good at teaching old dogs new tricks. I have been interested in seeing what Adrino was. Thank You for doing something with this.
A motor spinning the front wheel will give you a gyroscope on the front end. I used to see a guy riding wheelies around entire motocross tracks with such a set up. He toured the circuit, I believe he called himself "The Wheelie King"
You are not a Wheelie King if you need a spinning front wheel. But you are right. It makes wheelies a lot easier.
ukulelefatman His name was Doug Domokos I think. I remember reading about him in dirt bike mag.
Have you tried putting your camera on the build plate of your 3D printer? This would give you a much cleaner time lapse of your print. Just an idea:)
What about taking the concept to RC? you could use some quad motors to make a direct drive RC car with stability control. Endless endos and wheelies. Plus you could publish the design so I could build one.
Or you could just get a giant gyro and put it in the RC car, I actually have an RC car that does this. Its weird but it can do wheelies on one wheel
I have an ambition to make a decked out 4 motor car with stability, steering and so on controlled by whatever the equivalent of a flight controller would be. More out of curiosity than anything else but it might be cool to be able to control the driving characteristics and drift angles really precisely, this would just be one example. I was trying to get Tom to figure it out for me!
19:23 "I honestly couldn't do these videos without me" I think you were right the first time. :)
Dang. That is one advanced wheeliebar...
I learned to ride a wheelie in 1976 , my bike is 20" with a coaster brake , my longest is 5.5 miles @ 2 to 3 mph no greater than 5 mph .
Curiosity made me watch this and I must applaud how deep you have delved into the physics using electrical components . That device you created is equally terrifying as it is terrific . My mind is blown by your whole concept and I have nothing but accolades and applauses for your efforts .
Simply Magnificent , especially for a prototype .
I would deem that a first round success if I were you .
You could add a tare button for level
as a former kid that tinkered with anything i could get my hands on , and now 52 and still at it,things like this kit are so damn cool to me. kids today have no idea how lucky they are ,to be living in great times like we have today. for anyone to be able to just look up ,order ,and get it days later is amazing fun.and so cheep.
Would be cool try something like this on my wheelchair :D
You also need to account for the forward acceleration adding to the perceived angle the accelerometer is measuring with every pedal push. You would probably need to measure the rear wheel rotational speed and add a correction value based on that.
Is this the MPU-6050 accelerometer-gyro? If so, would you mind linking the code you used to interpret pitch angle?
Truly excellent project. If I may share some thoughts:
1) It would be possible to have the Arduino read a handlebar mounted pot to facilitate a field adjustable braking starting point for the braking process. Pots can be read by a standard Arduino with 8 bits resolution. Some inexpensive microcontrollers can read with 12 or even 16 bits resolution.
2) Likewise, it may be possible to have the Arduino read a separate pot to field adjust the slope of a line describing the increase in servo rotation per degree of tilt, thus resultant caliper tension.
3) One could self-enforce consistent elbow angle, or measure the distance between, say, the handlebar stem and the rider's chest using a standard general purpose ultrasonic range sensor or specialized infrared drone ground proximity sensor
1:35 thats a proper cuppa
Been following your video for the engineering but also learning to wheelie (can almost do it after 2-3 months on/off). I'm not surprised the tuning is so difficult as its very dependent on your position on the bike and its quite a fine adjustment. Very impressed that you can do the engineering AND can wheelie too!
What if you're riding up a hill? The autobrake will definetly make it far more difficult ;)
Think again.
+ClaudeSac
No, it is you who is thinking this in the wrong way.
Since the Arduino is using a gyro the brakes will automatically deploy up a hill as it cannot tell the difference between them. Use that brain of yours before commenting, please.
Wow .... goodbye kind soul.
+ClaudeSac What is your age?
@@ClaudeSac like you even know what 'kind soul' is
Add a potentiometer. Code it to adjust the angle of the balance point. Take a lot of the weight out of the setting so you turn the potentiometer a lot and move the angle a little. Add a second potentiometer and use one for High Gain and one for low gain. Set the length of your break wire to where you're happy and don't touch it again, you should just adjust the software not the hardware ( once you get it to the right length ) in my opinion.
I'm currently working on a drifting/racing/R.C./GPS/riding lawn mower with a working mower deck. This thing wouldn't be possible without you and your Channel. Thank you so very much.
Keep it simple, scrap the lot and use a 3 axis gyro. Couldnt be easier
Balancing a bike would be a classic inverse pendulum problem, its a non-linear problem and will take a bunch more math than just implementing a PID controller.
Adrian Forbes - I think you're right. Any links to any projects, code, papers... anything really, on the subject? I am just starting out. Got the chips and the coding experience, need some help with the physics and the mechanics.
A good start is googling "inverse pendulum arduino". There's tonnes of information to absorb there. Once you have a good general idea of how it works then you'll know if you need more specific information.
@@clonkex - Thanks for that, there is indeed a ton of stuff there.
However, there is one major difference, in that a true wheelie system will ONLY have unidirectional forward motion, and any overbalance will always be corrected by braking (either off the brakes or off the engine), whereas these balancing robots move (jitter?) backwards and forewards to ensure they don't topple.
That's quite a difference, any ideas how to tackle it? Of course, the existing robots ARE essentially doing a wheelie when they travel forewards - I guess - but they don't propel themselves into it (do they?). Also, when they move forward they do so at fairly optimal balance point, I don't think they'd correct a suboptimal angle by going faster (would they?)
All very interesting...
Actually off the top of my head I think it would be exactly like one of those balancing robots when it's moving forward... unless the human is providing the forward motion (so the electronics can't control it). When the balancing robots are moving forward they just tip forward then accelerate so they end up moving forwards but with the centre of gravity right over the axis of rotation (the wheel); i.e. they should end up upright, but moving forwards. Maybe a slight tilt forwards is necessary due to rolling resistance, not sure.
@@clonkex - Yes, the other interesting thing is when BOTH the human and the electric motor are supplying the power simultaneously. You'd need to figure if the pedaller was "getting it up" enough, and assist if not. OTOH if the pedaller wasn't trying to wheelie, there'd be no point trying to assist it. So you'd need to detect (somehow) if a wheelie was being attempted. Maybe either through a "wheelie mode" switch, or some smart acceleration monitoring software.
Great start, and thanks for the inspiration! I'd never for a moment have imagined that such a simple servo-brake setup would work AT ALL. Also amazing and really encouraging to see just how many people are working on the same idea - why, there's enough just here to make a forum...
I agree that you should use the gyro reading to track your rotational moments, and maybe blend with some PID mechanism. Someone also mentioned that it's a non-linear "inverse pendulum" problem. I'd like to hear more about that. I wonder if some Machine Learning would be of use here, too?
I'll probably start experimenting with a model, my wheelies are pretty poor (read nonexistent). I also prefer to use ESP chips. You can program them in the same IDE as Arduino, but they are quite a bit more powerful, and cheaper. Built-in WiFi also facilitates remote logging or RC control.
Really cool to see there's so much support, hey this may work out now! Can't wait to see what else, erm... comes up :)
====
PS. I am also shocked, I say, shocked!! to find out that some benighted (LOL) countries put the rear brake on the right. Motorbike riders must just love that...
Make a model RC bike.
Tom: "Ever wondered if you can make a wheelie cheat device for your bike?"
Me: "I can't even ride a bike."
Tom:"Yeah, me too."
Okay, for real. I misread your name as Train Station... im so sorry 😅
That's a nice little shop you've made for your projects. Good work. Good explaining. Well Done.
Your back brake is on the left wtf
omg! looks like UK realy got it for same traffic reasons
Sergej Nadaždin It’s usually is to the left because the gears are to the right on most bikes
Yes dude! I've been wanting to try this ever since I saw the alta motorcycle. They could have a wheelie mode on it. You would just have to lean back twist the throttle and the bike would find its own balance point. The brake is one way to do it, you could also wire it to control entirely with the throttle. Glad people have started experimenting!
Now you need to wire your esc with that arduino for automatic wheeling 😂
xavtek I think this would be the best option, it would require a dead mans handle though, so if he fell off it would stop,
Love these quick cool ideas and implementation. Cool to see you start using arduinos. Great stuff as always dude :)
Just learn how to do a wheelie without that crap. Lol
Just searching for this comment. Thanks. 😂 fucking lazyness and fear
Haha i hope this wont be trend soon
Dídak Carbasa you understand he’s doing this for fun to learn about programming not how to wheelie if anything this would make it harder to wheelie.
he already could wheelie that wasn't the point of the project.
Learn to wheelie without brakes
15:28 surely a PID controller could adjust for a different balance point on the fly? Its job is just to keep the angle between the bike frame and the horizon constant. How does a quad copter adjust for a wind gust for example?
A potentiometer to change the angle would've make your life so much easier on this tests, man hahahahaha Great video as always!
This could be used on every motorcycle. Companies should be interested in this simple yet great idea.
1:45 If I try to have tea while working I always forget about it - you're brave tommy boy
"I honestly couldn't do these videos without me" I believe you Tom
Great project as always. If this device is just meant to prevent loop outs you're oh so close! If the brake reacted to rate of angular change providing a short sharp stab of rear brake when you're over your tuned threshold you'd have much more consistent results given the variables you've already identified. This is one of your most commercially viable tinkerings, happy coding!
Awesome man! You may put a trimpot/potenciometer so you can adjust the kick-angle on the field without having to reprogram the board
I was so excited when I saw the title! You should hook it up to your e-bikes motor and use the acceleration from that to balance the wheelie!
Excited to see you working with Arduino / electronics. Another great video :)
Just started the video, plan on finishing it, but I just wanted to say that I have no idea what you're talking about as far as this board and tech goes, but it's cool XD
Hi Tom, I have a suggestion for you. Why don't you tap the analog signal from the throttle on your handlebar into the Arduino and then digitally control the vESC. Because you have a Gyro on board it would allow you to program a variety of control systems to control the bike in various conditions like when you're riding normally and holding a wheelie. A PID system can help you maintain a wheelie continuously without using brakes, and may be bring your nose down very smoothly when you throttle to zero. Using potentiometers on your brake cables will allow you to play around and design with a combination of so many i/o methods and control systems.
All the best.
If you can do this, you can probably put a rotary encoder on the wheels to detect slip-skid. This means you might be able to do ABS and traction control in a future project. Any chance that'll come up?
you should revisit this project, using your speed to gauge the angle ratio, and also smooth out the braking to be more generous. Add in a couple of control knobs for target angle and speed so you can adjust on the field
Thanks for going down this route. I've thought about this and this is the first time I've seen someone take a stab at it. Great job!
These videos are the best... reminds me of my own tinkering while growing up.
I would think that a control loop rather than an open loop linear function would help, but it practically may be impossible..... Great video Tom!
I love all the interesting ideas you come up with on this channel! Even when they’re simple ideas they’re still super interesting and I always want to stay tuned in to see how things turn out. 🤙
When you love bikes and love nerdy stuff and you bring the two together love it and its simple keep it up mate 👍
4:00 the code seemed to have "delay(10)". Why not constantly read the angle and adjust the servo?
Amazing idea. Nice to see all the technology and you rely on adjusting the length of a piece of wire. Great to see you invention.
I've been using arduino for years and I didn't know you could graph the output!!! That's going to change everything! Thanks!
Is there a way to measure the angle of the strain on the rear axle? The controller could be set to keep it as close to gravitationally vertical as possible, because that means the center of mass is directly above the hub.
Hi Tom, great stuff. It's always interesting hearing you think through the problems. A few thoughts you may want to consider :
If you wanted to account for the riders relative position to the bike, it would be interesting to put a second inclinometer/gyro on the back of the rider. It won't give you distance, but may give you some kind of trim to your controller.
If you set up an sd card (I assume there is one in your dev kit) you could try logging a "perfect" wheelie to see what angles you need to start applying the break. (it may also give you some nice plots for your content). With a second gyro you may see a relationship that can be used to improve your control loop
I would put a bit of averaging in to the system to remove the gitter (maybe an IIR filter?). If your getting angle from an accelerometers, it's going to noisy.
I've done a couple of PID's on 8bit micros in the past and it can be challenging. You probably only need the P and a little bit of I. There are some useful libraries out there for the arduino where you set up your Kp Ki and Kd gain and let the function do the work for you.
I don't usually post comments... Ever... But I do find your channel very interesting. I hope my input is of some interest /help.
Keep up the great work.
Thank you
Matt
You're an eloquent presenter Tom and I enjoy your ideas and your videos. Keep on !!
Amazing Videos. Your videos always inspire me to create new things and work on old projects I gave up.
You could have a device that has calibration built in, to set a persons balance point. This could possibly be done by allowing them to put the device into a calibration mode, the code could do something like check for a threshold value that exists for x amount of seconds. This step could be repeated x amount of times to make the program fine tune the balance point. Then this would work no matter what weight, height & arm length the person has. Nice work so far!
Cool stuff! I bought that exact kit about a year ago and it's changed my life. The arduino in combo with raspberry pi and a 3d printer and one can do lottsa stuff!
Genius 40 yrs to late for me. I learned the old fashion way. You never cease to amaze me.
A neural network would be a really interesting idea here, to read Tom’s brake pulling vs. pitch inputs and try to replicate it (as opposed to having to write an algorithm to determine the right time to pull the brake).
Great project, i would suggest looking at PID's or MIMO's could potentially code a feedback loop that will try to keep an angle or even find a stable angle on its own.
The question of a balanced bicycle on one wheel is an interesting one.
However, this is not the only complication we're facing here. Your discovery, that you were controlling the angle by actively changing the center of mass (10:45), effectively "cheating" your own device, shows that the device would have to "measure" (and factor in) the rider's "intention".
One could possibly measure the rider's physical interaction with the bike, e.g.- the pull/push force on the handles, the force being applied to the pedals and to the seat, which should give enough information for a rough estimation of the rider's intention, and position relative to the bike, but I'm not sure that's enough.
A sloped ground would also change the wheel's point of contact with it, and as a result the angle of balance.
The deterministic approach presented in the video is safer than others in some respects, but may require a lot of programming to achieve a usable result.
A different approach might be to feed all of the sensors' data into a learning algorithm, (an "AI"), and let it determine when to apply the break, (and with what force)... preferably using data from skillful riders.
Thanks for raising the question, and for taking the time to explore and share it with the rest of us.
You seem to enjoy what you do, which is all any of us can hope for.
Wanted to use an Arduino so you created this amazing design to push yourself, bravissimo!
You have to implement a proper PID-loop and control the motors throttle and braking so you can have a "One Button high start"
Nice project board & case! :D
Protip: When using those external power regulators on a nano, put a schottky diode between the power reg and the nano's 5V line - that way you can still plug the nano in to usb without problems :)
For future portable experiments, maybe use an adjustable pot + LCD display to be able to tune the response of the servo without having to connect to a laptop?
Years ago, RCSUPERPOWERS made an RC "jet" (may have been EDF or prop, I forget) and it had accelerometer-controlled canards that would let it fly controllably at amazing angles of attack.
Brilliant Project and excellent video . Well done duuude
Once again, your genius and intelligence never cease to amaze me.
You have to make the Arduino react on the speed of which there is a change in in degrees over a certain point - not hardcore it to an actual degree. There is Arduino library's out there you can use for it.
All I know is, when people like you get a hold of arduinos, amazing things always happen.
You should redo this project with an ebike. People would pay good money for a wheelie button
Another cool project Mr Stanton. Keep it up.
Great idea Tom! I’m impressed with your arduino work for a first time. Maybe look into filtering your values from the accelerometer to avoid actuation jitters in the servo. Keep up the good work
This is so brilliant I can’t find words! 🤩
Have you considered a deadman switch? A thumb button that has to be held in to keep the wheelie code running would mean the bike doesn't go speeding away if you fall off. That way it would be safer to let the code control your motor as well. Very nicely presented technical videos, by the way
have you tried having a secondary back break connected to the device. with the device connected to those breaks instead of the handle bar breaks? that way you are still able to use the hand break and it be functional, while the secondary pads on the back wheel being soley for the servo. maybe a clamp that slowly closes as the angle gets more and more steep, fully closing at 60 degrees. perhaps a corkscrew that spins openning and closing the clamp.
Technically speaking, making the videos without you would be even harder. Not sure if that paradox would just simply implode the universe or what.
how do you think about put the device on your shoulders or on your back so it sense your position and not the bike position?