Measuring distance - accurately

tcmtech

Joined Nov 4, 2013
2,867
I can't believe that you do not see any place in this world for safe training, driver aids or practice tools other than a 'stick your finger in the fire, bet you won't do it again' mentality.
It's not all or just about perceived "safety' anything.

A lot of it has to do with everything beyond that that actual real life application and implementation of such a system. There is a load of other issues with adding such a control system to any motorcycle that does not already have a full drive by wire engine, transmission, clutch, and brake control system in place. Adding all of that and having work seamlessly with the rider would be extremely difficult and likely way beyond your present electronics and design skillsets.

Especially given the sheer amount of processing power it would take to handle the amount of coding required to have it never screw up and do something unwanted when it was not needed. Something that would likely take hundred if not thousands of hours of hard R&D study to perfect.

It would require multi axis accelerometer inputs plus ground speed, front and rear tire speed, plus engine operating parameter inputs, plus steering, throttle and brake inputs plus likely other things as well just to give the system a baseline of real time input data channels to work with before a single line of code starts setting up a decision on whether to react or not and if so in what way in order to keep from making it and the unwarranted counterreaction of the actual operator result in a accident that is worse than had it and the rider done nothing.
 

Thread Starter

Man_in_UK

Joined May 13, 2008
192
It would require multi axis accelerometer inputs plus ground speed, front and rear tire speed, plus engine operating parameter inputs, plus steering, throttle and brake inputs plus likely other things as well just to give the system a baseline of real time input data channels to work with.
I have used a system that works perfectly well just using two micro-switches that have extra long actuating arms. I did not fall of or explode.
The system is so simple. Switch 'a' operates at the first height and cuts out half the engine. Switch 'b' operates at the fail-safe height and cuts the other half of the engine.
While having a go on this bike I managed to hit both switches more than once and at no point did I get close to getting hurt.
Proof and pudding. All I want to do is NOT use two micro-switches.
Anyway, the complex systems you talk about are already out there fitted to £15k sports bikes, my bike only cost £400 so I have to get out some blue-tack and string, try to fix my own version.

Can we just stick to talking about distance sensors?
 

DickCappels

Joined Aug 21, 2008
10,661
This thread is now off the original topic. The question is that of how to accomplish something, not whether certain argumentative individuals think it is something that should be done.

Anybody who wants to discuss whether or not the intended improvement is useful is welcome to open a new thread rather than blocking progress of this one.

Edit: Off-topic posts deleted,
It must be realized that it is the forum's policy to allow the thread starter to choose the direction in which the thread is to go. Hijacking, even though relevant, is not permitted.
 
Last edited:

profbuxton

Joined Feb 21, 2014
421
Interesting idea. I believe that drag bikes use a rear jockey wheel to prevent getting too high up. As a long time bike rider I must say I was never tempted to do wheelies(probably not enougth power or bravado) and anyway its a "improper control of a vehicle offense" here it spotted by cops.
 

MrSoftware

Joined Oct 29, 2013
2,273
Pretty much all the fast bikes these days come with elaborate electronics packages, and many (most?) include wheelie control. Same for the Moto GP bikes (motorcycle equivalent of Formula 1).

In any event; Jump on digikey and check out inclinometers. A wheelie bar would be cheaper/easier to implement. Or you could just put something on the forks that cuts the spark when the forks are topped out. Not ideal, but would keep the front wheel on the ground, though I could imagine a herky jerky ride in some situations...

If you MUST measure distance, I have found these to be much more reliable than the cheap ultrasonic sensors, though for this application I'm not convinced it's the best solution either:

https://www.pololu.com/product/2490

My uneducated opinion is that an inclinometer is going to be the way to go, perhaps with some electronics around it to filter out the noise.
 
Last edited:

wayneh

Joined Sep 9, 2010
18,104
My uneducated opinion is that an inclinometer is going to be the way to go, perhaps with some electronics around it to filter out the noise.
On level ground I agree, but is this supposed to work even with dirt bikes on steep inclines? Inclinometers or accelerometers cannot correct for slope. On the other hand I guess the risk of going ass over tea kettle doesn't depend much on the slope underneath the bike, only the position of the center of gravity relative to the center of pressure where the wheel contacts the earth. The latter moves forward a bit with slope, though. Hmmm... It's kind of complicated!
 

Thread Starter

Man_in_UK

Joined May 13, 2008
192
If you MUST measure distance, I have found these to be much more reliable than the cheap ultrasonic sensors, though for this application I'm not convinced it's the best solution either:
Good call. This needs a bit more looking into but it does look like it would be more accurate.
I think my biggest problem ATM is still the change of angle but I have yet to measure correctly the range I will be working with.


As for dirt bikes etc, this idea was only supposed to used as a learning / safety tool for learning to wheelie a road bike.
An angle sensor would work as long as you could cancel out the effect of the acceleration. I do know this is possible as current bikes use it but it would involve a bit more maths/programming than I was planning on.

http://www.bosch-motorcycle.com/en/...r/schraeglagensensor_1/lean_angle_sensor.html
 

LesJones

Joined Jan 8, 2017
4,511
Why not sense the position of the front suspension. If it is not compressed at all then the front wheel is about to leave the ground.

Les.
 

MrSoftware

Joined Oct 29, 2013
2,273
I'm no professional rider, but I have been riding (mostly off-road and motocross) for about 30 years. Based on that experience, I think this is one of those problems that might appear simple on the surface, but will become more complex the more refined you want your solution to be. If you just want to kill the power at some angle, then my personal first attempt would be with an inclinometer and some software to filter the noise. But abrupt stopping and starting of the power will likely unsettle the bike in a hurry, probably causing some falls. If you want a more refined solution, then it might be worth the effort to really check out the Bosch solution. I think the answer to a really refined wheelie control device is more complicated than it appears on the surface, and will likely involve multiple sensors and a good bit of software and R&D time to dial it in.

A side note; if you want to prevent flipping over backwards, then you need to consider not only angle but also angular velocity and center of gravity. And the rider is a big part of the net center of gravity, so it will vary between riders. If someone on a reasonably powerful bike grabs a hand full of throttle and you cut the engine at 45 degrees, it might be too late and the angular momentum of the bike might carry it over backwards anyway, where someone with a delecate touch might be fine to 75 degrees. Also different bikes have different centers of gravity, meaning the angle at which they start to fall backwards (balance point) will be different. Lots of variables, so your solution will need to allow for adjustment.
 
Last edited:

MrSoftware

Joined Oct 29, 2013
2,273
Thinking out loud.. and assuming the goal is to learn to balance a wheelie.. perhaps a better solution than killing the power, is to apply the rear brake. It's more complicated to implement, but will be a much smoother response, and the response can be proportional to the need, and will naturally filter some of the noise. Come up with an equation that considers angle, angular velocity, maybe angular acceleration and center of gravity (tipping point), and use the result to determine how much brake to apply. At the balance point, momentum will be 0 so 0 brake. Tip past the balance point and apply the rear brake, bringing the front down. Someone who grabbed a hand full of throttle will have high angular momentum so lots of brake as they approach the balance angle. etc..
 

wayneh

Joined Sep 9, 2010
18,104

Thread Starter

Man_in_UK

Joined May 13, 2008
192
Thinking out loud.. and assuming the goal is to learn to balance a wheelie.. perhaps a better solution than killing the power, is to apply the rear brake. ..
I did give this idea some time but due to the amount of extra hardware involved, I dropped it. Not only would it need an actuator to apply the brake, I guess it would also need a strain gauge to measure & adjust the amount of force. Even though it is the rear brake that gets used to balance a bike, I dont think it would be powerful enough to overcome the power of a modern engine if the throttle was held on.

You are right that everything would change from bike to bike & even rider to rider but I was not planning a one size fits all design. If this ever get off the ground it would be set to trigger at a very low height. Only when the rider is comfortable & consistent at hitting the correct height (the correct height would be at the point where the safety device signals level 1. Level 1 being the minimum amount of power reduction. Level 2 being the fail safe max power cut.) can the system be gradually adjusted for more height.

As for angular velocity, it should be easy enough. At the moment I am planning to keep the power reduction to just two levels as I know it works well enough. I can adjust in the future to 3 levels if things go well by adding another coil to the engine, allowing me to cut any or all of a 4 cylinder engine.
For example: If a sensor measuring distance to ground is configured to output a 10 volt scale between 0 cm & 100 cm.
We will say that level 1 cut is at 50 cm (5v) & level 2 cut is at 80 cm (8v).
The controller can be programmed to constantly monitor the volts. If the time taken for the volts to move from 0 to 5 is more than 2 sec, leave level 2 cut at 8v. If the time taken for the volts to move from 0 to 5 is less than 2 sec, move level 2 to 7v.

If the system can measure ground distance or angle reliably then there are many different possibilities available.
The only thing it will never do is balance like a Segway (although there are electric bikes out there).
 
Top