Senior Project Assistance: Motorcycle Control

Click For Summary
SUMMARY

The forum discussion centers on a senior project involving the design of a self-balancing motorcycle using an Arduino Uno, ArduIMU V2 sensor, and a stepper motor. The project aims to utilize pulse width modulation (PWM) for motor control based on feedback from the tilt sensor. The user seeks clarification on the interaction between the tilt sensor and the Arduino, specifically regarding the implementation of PID control for motor actuation. The conversation highlights the challenges faced in establishing communication between the sensor and the Arduino, as well as suggestions for alternative motor control methods.

PREREQUISITES
  • Understanding of Arduino programming and libraries
  • Knowledge of PID control algorithms
  • Familiarity with pulse width modulation (PWM) techniques
  • Experience with tilt sensors and their data output
NEXT STEPS
  • Research Arduino PID Library for motor control implementation
  • Explore methods for converting sensor data into usable numerical values
  • Investigate alternative motor control options, such as solenoids
  • Learn about troubleshooting communication issues between sensors and microcontrollers
USEFUL FOR

This discussion is beneficial for robotics enthusiasts, engineering students, and hobbyists working on projects involving Arduino, motor control, and sensor integration.

LabGuy330
Messages
36
Reaction score
0
Hello All,

A friend and I took on a senior project design that is certainly proving to be more difficult than anticipated.

Here are the details:


Design Challenge: Self Balancing Motorcycle

Description: A picture of our prototype is attached. The motorcycle is remote controlled with a DC motor that drives the bike. A tilt sensor is used to determine the inclination and a stepper motor is used to steer the front wheel in order to torque the bike back to a vertical position. Also we are using an Arduino for microprocessing.


My question lies in the set up. I am confused exactly how the sensor tells the motor to turn. I know some sort of pulse width modulation is necessary, which is where I grow weary.

This is how I think the set up should go:

The tilt sensor sends an error signal to the Arduino. The Arduino calculates a proper output through PID control (which we will create the code). The output is sent to the Stepper Motor Controller which converts the signal to PWM which is then sent to the motor. Then the motor turns.

Any help would be greatly appreciated. I can provide more information as well.

Thank you in advance!
 

Attachments

  • photo-2.jpg
    photo-2.jpg
    31.6 KB · Views: 570
Engineering news on Phys.org
From the picture it seems like you have achieved your goal - it looks upright and balanced! ha ha

PWM for a stepper motor. Interesting.
You sure it's is a stepper motor?
Doesn't a stepper motor require different coils to be energized in a certain sequence for it to turn, and energizing the coils at a faster pace makes the motor turn faster?

Or are you talking about a pulse width related to the error from the sensor, that is calculated in you PID, to determine for how long the stepper controller should energize the stepper motor, and at what speed and power level(torque)?

You have done your control analysis which I do not want to get into as its complicated for a forum.
 
Hey 256bits thanks for the reply!

Yes you are right about the stepper motor being actuated by energizing coils. I now have a better understanding of how things are suppose to work, thank you!

So here is now my new idea for the electronic set up of the balancing motorcycle:

The tilt sensor will produce an error signal to the Arduino. The Arduino will contain a Stepper Motor Control code that will output a pulse generation to the motor driver (this is where I was confused before). Then the controller will send a correction signal to the motor which will rotate and torque the bike back to the proper position.


Of course I am open to any criticism and suggestions.


Current Goals
  • Connect sensor to voltmeter and get some readings
  • Connect sensor to Arduino and get them to talk to each other
  • Place sensor on known inclination angles to test linearity of sensor
  • Figure out Stepper Motor Control code from Arduino Library

Will make updates as days go on.
 
Painstaking trial and error, but that is the fun and exciting part, especially when it starts to work.
 
17 November 2011

So here is my first update.

My goals today was to connect the tilt sensor to the Arduino and attempt to read some data. This became extremely frustrating and my attempts were unsucessful :(

The tilt sensor outputs a digital data stream. However, the readings I was getting were complete jibberish. It was a random string of strange looking characters (maybe somebody knows what I am talking about). Turning the sensor in each direction didn't appear to get any distinct change in the reading so I unaware if the sensor and Arduino are even talking to each other.

If anyone has experience with Arduinos any help would be greatly appreciated.

The components I am using are:
  • ArduIMU V2 (sensor)
  • Arduino Uno

I have found a program that will display the sensor's orientation (yaw, pitch, roll) and the values for their magnitude called ArduFlight. It works with the IMU without the Arduino so I can at least see if the sensor is working correctly.

Other than that I need to find a way to convert the jibberish serial data into something useful (like numbers lol). I am sure there is a way and I will continue searching for an answer.

Of course any assistance would also be nice. If anyone would like to see my attempted Arduino code I would be happy to show it.

Thanks,

LabGuy
 
Being a motorcyclist I suggest drop the stepper motor and use 2 solenoids, both always active to cut out backlash but one may be more active than the other for control inputs. Does this sound like a pair of human arms, could throw in a bit of weight shift as it develops! Good luck
Dom
 

Similar threads

Replies
9
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
6
Views
2K
  • · Replies 5 ·
Replies
5
Views
6K
Replies
3
Views
671
  • · Replies 3 ·
Replies
3
Views
1K
Replies
3
Views
4K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K