Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Auto rotate/leveling system

Status
Not open for further replies.

hizzo3

New Member
Hi, new here. I am in the process of building a HID (High Intensity Discharge) system for my motorcycle. The issue with motorcycles is when they turn they lean. This makes the HID rotate causing blinding effects on oncoming traffic, and you turn into an unlit portion of the road.

Looking at taking a r/c helecoptor gyro, having the output of that processed then have a processor rotate a motor that keeps the light leveled. Feedback will be provided via a POT.

I have very minimal skills here. used to build lil small circuts, like blinkers and stuff. Never anything like this. Any help greatly appriciated.
 
You are in luck: you may not need extra processing circuitry if you are planning on using an RC gyro. Try hooking up an R/C helicopter gyro to an RC servo motor (or two, if you have a mutli-axis gyro and want multi-axis movement compensation). Then you need a simple timing circuit that provides a constant PWM positioning pulse (that plugs into another port into the gyro).

This is exactly the same way RC gyros are used in RC helicopters.

PWM Position Pulse ---> Gyro ---> Servo

The PWM Pulse (from the radio receiver) tells the servo which way to move. If the gyro detects no motion, the PWM pulse is passed onto the servo as is and the servo moves accordingly. If the gyro detects motion (and for simplicity sakes we will say the the servo is being held at a constant position by a constant PWM pulse), the gyro will modify the PWM pulse in a such a way as to get the servo move in the opposite direction detected by the gyro so as to maintain its position in real-space. This is used in RC helicopters to keep helicopters balanced and drift-free without user intervention.

I don't think the gyro will properly compensate if the gyros detect motion beyond the servo's range of motion without more complex circuitry, but 180 degrees is quite a bit for a tilting application). There is also the problem of drift where your gyros will slowly sway towards one direction over time so you may need a reset of some sorts to reset the position
 
Last edited:
dknguyen said:
I don't think the gyro will properly compensate if the gyros detect motion beyond the servo's range of motion without more complex circuitry, but 180 degrees is quite a bit for a tilting application). There is also the problem of drift where your gyros will slowly sway towards one direction over time so you may need a reset of some sorts to reset the position

I guess that explains why some gyros are 60-60 bucks vs others are in the 100's. I'm unfamiliar with servos. arent the like a motor that will turn 180 degrees and when the electricity is stoped, it goes back to where it started from? How strong are they. i will need about a good 5-10'lbs of torque to be on the safe side.

BTW thanks alot. you may have saved me much in R&D $$$...
 
Servos

Yeah, the strongest RC servos you can get that put out a maximum of about 10kg-cm/25lbs-in of torque. Titanium gears and stuff, about $115. The strongest RC servos I have seen by a very large margin.

https://www.hitecrcd.com/Servos/hs5995TG.htm

Of course, you can find cheaper more conventional servos around the range you specified. I am just show you the strongest, most durable, highest end one. BUT get a servo with metal gears for your application...trust me...you got inertial forces and vibrration of the light when moving the motor cycle around that the motor will have to fight. Be aware of the increased current requirement for digital servos over analog (conventional) servos. Its 5A@7.2V for the servo mentioned above. Also be aware of the 7.2V maximum found in RC servos which will require you to step-down the 12V motor cycle batteries to 6V-7.2V (for the servo sizes you need) with a capacity of ~5A per servo motor used (for the servo mentioned above, current draw will vary from servo to servo).

Do you need move 5-10lbs or do you need 5-10 lbs of torque? There is a big difference when the lever-arm mechanics kick in.

RC servos use a PWM input pulse that they process to determine the position to move to. When powered off, they STAY WHERE THEY ARE. Some fancy radio receiver systems for use in model airplanes might reset the servos to certain positions during a power failure using stored capacitor power...but they aren't something built into the servo.

When I spoke of the gyro-servo not being able to properly compensate if the gyro detects motion beyond the servo's range of motion, I hope you understand what I am talking about. But now that I think about it, the gyro may make the servo move in the opposite direction at the opposite speed it is detecting (rather than making the servo move the opposite distance that the gyro is detecting, since this would mean the gyro processor has to do some nasty inaccurate math with the raw angular velocity output that gyros output). This would mean that the gyro may not be able to compensate if the motor cycle tilts too fast, but you should never exceed that speed either. So basically, you probably dont need to worry about either of these problems- your motor cycle should never EVER tilt far enough or fast enough for the gyro to not be able to compensate. If you do have to worry about these problems...you got much more serious problems on your hands, God forbid.

I kind of don't understand why a motor cycle light blinds someone...is it because the light is made to face at the ground and when tilting it points up?
 
Last edited:
I'm not sure what a "gyro" measures here. Normally you'd use an accelerometer to measure tilt but motorcycles perform coordinated turns and the g-force is straight down the bike, even though the bike is an an angle to the ground.

A gyro is typically poor at detecting an absolute position due to offset errors.
 
An angular velocity gyro is the only kind of gyro I have ever seen. As far as I know, gyros are the only sensors available to keep a reference when acrobatic movements are involved (like airplanes, missiles and such), since things like accelerometers cannot effectively keep track of where the ground is when dynamics are involved because other accelerations get superimposed onto gravity.

But yeah, they drift. You could always use other processing to try and automatically fix that offset, but more work and more circuitry. Or you could have a manual reset or something that would reset the servo back to center position at will to correct for any offsets. I am pretty sure you can find some sort of override input or reset on some RC gyro that would allow you to do this.
 
Last edited:
How about a lower tech solution? Since the tilting and blinding light is mostly a problem on sharp turns. Couldn't you simplely use a couple of mercury tilt switches driving a couple of solenoids to reposition the headlight. I haven't been on a motorcycle in many years (had an almost religious experience...), but don't remember leaning to one side or the other for more than a few seconds. I was living in Oregon at the time, a lot of moutains, and many sharp curves. Kind of miss it now.
 
Just to add my 2 cents, what about countersteering? I'm thinking this is going to mess with simply tilting the headlight, and seriously overcomplicate the design. The headlight will be pointing up and to the right as you turn left. The bike will be leaning left, but the headlight will be offset much further than if the bars were actually turned to the left.

Countersteering, BTW, is when you actually turn the bars slightly in the opposite direction you want to turn, while leaning the bike the way you want to go. It gets you into a turn leaning way faster than you normally can, using the gyroscopic effect of the front wheel. Most of the time you are countersteering without knowing it, but once you learn to take advantage of the effect, your turning will improve greatly.
 
wow..... great ideas.

first off... awesome... i was afraid i wasnt going to get but a handfull of responses. this is wonderfull.

dknguyen -after much thought. i think that if i can get a bearing installed i think a smaller gyro will work much better. and it would be cheaper. also this reset intrigues me. i wonder if it would be too much to have it reset by button. "I kind of don't understand why a motor cycle light blinds someone...is it because the light is made to face at the ground and when tilting it points up?" this issue occurs because of the counter steer mentioned further in the post. that and DOT alows more spill from the headlight on motorcycles for the turn situations. also the cut off is like this ----- and when u lean it does this \ or this / which then blinds cause all the light that would hit the ground now isnt.

HarveyH42 - i thought about using this method. Issue is that they work off gravity. when you lean like mentioned b4 by dknguyen with the accelerometers, the mercury wouldnt move. this is due to centrivical(sp) force. much like why you can take a glass of water and spin it then hold it horizontally while spinning and it doesnt spill. great idea for cars though.

zevon8 -I also thought bout this issue. You use counter steer more in tighter turns and it goes up exponitionly for the tighter turn you want. luckly there are 2 things that keep this to a minimum. Crusers rarely see this much turn and sports bikes have the lights mounted to the front farring. Also HID's produce roughly 3x the amount of light. all of this light is highly projected, typically in a 120-160 deg beam pattern with a very sharp cut off.


I so wanna get this thing done, and for under 350 for the system. On hidplanet, a hid forum, they said it couldnt be done for under a few grand b/c the current leveling systems work from accelrometers in the front and back, dont account for rotation and are plugged into the "brain" of these cars. I just think that so many lives could be saved with a technology like this and it sofar is looking to be almost inexpesive for what it can do.
 
hizzo3 said:
zevon8 -I also thought bout this issue. You use counter steer more in tighter turns and it goes up exponitionly for the tighter turn you want.

It's nice to hear of people who realise about 'counter steering', it applies to ALL turns on a bike that require leaning - in fact you don't actually 'lean', you counter steer and that produces the lean. To test that, try and steer around a corner with your hands off the handle bars - it's incredibly difficult to do, compared to the tiny little counter steer effort required (in fact, so little, most bikers don't even know that's how a bike is steered).

Where it doesn't apply of course is at exceptionally slow speeds, where you steer conventionally, and it's difficult to keep your balance - I've always wondered (because of these two different steering methods), if there's a critical speed where you could turn without steering or leaning? :D
 
Nigel Goodwin said:
Where it doesn't apply of course is at exceptionally slow speeds, where you steer conventionally, and it's difficult to keep your balance - I've always wondered (because of these two different steering methods), if there's a critical speed where you could turn without steering or leaning? :D

Off topic but who cares lol.... it depends on the weight of the bike and the amount of turning your doing and speed. rule of thumb from my MSF course is 10-20 mph
 
I have found that with many bikes, once the gyroscopic effect is sufficient to want to maintain vertical, counter steering comes into play, slower and you get the flop. Even then, accelerating from a corner from low speed and counter steering to shorten the radius is one of those "cheap thrills" you get to do at reasonable speeds around town without getting pinched.

There are two instances where I can remember not seemingly needing to "steer". One is while doing well over the ton, and the other is on milled pavement ( not the sidewalk Nigel, LOL, why do you call the sidewalk the pavement? ) Also, try counter steering on a stretched chopper... very much a different experience!!

I would agree it would be different for cruisers, but often they get fitted with highway lamps, usually lower, and aimed slightly different helping to get around this problem.
 
To throw in my own 2 cents here, if this is being considered as a solution that will be marketed, I would go with a microcontroller, a digital servo, and one of the Analog Devices gyro's.

The only thing I can think of for a semi-automated reset device is a single axis accelerometer in the bike. The microcontroller would have to be connected to the speedo. If the speed was zero and the angle of the bike was even, then reset the gyro drift.

For heavier duty RC servo, you can use an extra gearing device, like this one:
**broken link removed**

Analog devices gyros:
**broken link removed**

Analog Devices Accelerometers:
**broken link removed**
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top