motorcycle traction control using LPC1769

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

motorcycle traction control using LPC1769

439 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dragilla on Mon Nov 14 06:17:02 MST 2011
Hi,
I'm working on a motorcycle traction control project. My device will also do simple data logging on an sd card.
My general idea:
1) read data from various sensors (including g-sensor, gyro, tilt?, wheel speed sensors, gps) in a loop at constant rate (say maybe 300hz).
2) in each loop calculate if the traction control should be engaged - I have a basic concept but it will require a lot of tracday testing
3) set flags for tc for 4 cylinders, telling to either retard or kill sparks for selected cylinders (based on the level of traction loss)
4) each signal from the ecu to coil (spark signal) interrupt occurs. In thec interrupt function (one function for each cylinder) I check the flag and either pass the signal to the coil or retard it or kill it
5) in the mean time i log the data to an sd card (probably in the sam loop as in 1)

Do you have any thoughts on this? What should I pay special attention to? I know power supply must be very stable.
Any advice on the tilt angle? Should I use the Kalman Filter or the  Complimentary Filter to calculate tilt from gyro and acceleraion? Or maybe I should just forget about it and get a tilt angle sensor?

Anyway let me know what you think about the general working scheme I wrote above. Maybe it should be constructed differently? Can be done better? Tell me.

I was adviced to use LPCXpresso for this as it is powerful enough. Is this right? I have lpcxpresso 1769.

If you have some knowledge about ignition retarding I could really use some advice on that too :)

cheers,
--
Luke
0 Kudos
Reply
5 Replies

406 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dragilla on Wed Jan 04 13:26:03 MST 2012
Ok. I'm starting to understand the basic concept of capture and match in my application. I 'almost' understand the chapter 21 of UM10360 (Chapter 21: LPC17xx Timer 0/1/2/3).

The question is: how do I perform two functions:
1) regenerate a signal coming from a capture input on match output
2) do the same as in p.1 but delayed by time X (X is a parameter configured from within the software - dynamically based on sensor readings)

Please confirm my conclusions:
1) In my loop in the program I set the value of Match Register to X
2) I use interrupt generation on every capture input transition
3) in the ISR I start the TC
4) When the TC reaches the MR (I have a match) I toggle the match output and reset/stop the TC

Does this make sense? Will this work or should I do it differently? :)

regards,
--
Luke
0 Kudos
Reply

406 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dragilla on Wed Nov 16 10:50:53 MST 2011
Angelo. If you could spare some time I'd have some questions that you might know the answers to. But as the questions are more motorcycle electronics related than LpcXpresso related then maybe I could ask them directly and only to you. Write me an email at dragilla theAinAcircle gmail dot com.
I have some questions mainly about your power commander project - pulse widths, retarding sparks, etc. Let me know.
0 Kudos
Reply

406 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Polux rsv on Mon Nov 14 12:49:46 MST 2011
You guessed correctly. As I use a Motec ecu, I only need lean angle as a parameter for the integrated TC function.

The common method in various TC is ignition cut. It is also the simplest to implement in an external module. You can simply cut the power to all coils, or separately in order to modulate the cut. [B]But never use fuel cut[/B], it could cause overheating problems.
If you want to implement ignition retard, you must have acces to ecu signal and regenerating them. Not so much difficult using CAP and MAT function of timers. Measure frequency and pulse width, and regenerate them with delay if needed. But software crashes will cut the motor, with possible dramatic effects on the pilot.:mad:

The base algorithm is to measure and control the slip (rear wheel speed-front wheel speed) using a PID. Your algo will maintain the slip at a maximum value, This max value will change depending on speed, gear, rpm, throttle, etc...

Before landing on your keyboard and start coding, think about how you will change all these parameters during your track days. For another project, I used Tunerstudio (or Megatune) from the Megasquirt project (www.msefi.com). You can modify the software setup so it will display the tables and gauges it reads from your module

That's all for today :D.

Angelo
0 Kudos
Reply

406 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dragilla on Mon Nov 14 11:06:24 MST 2011
I could have guessed by your nickname :)
I work with Yamaha R1. I guess you have RSV Mille?
0 Kudos
Reply

406 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Polux rsv on Mon Nov 14 09:41:52 MST 2011
Not only you have the same than mine with your IMU setup, but you are working on the same project :D  What ECU are you using ?

What you call "tilt" is also called lean angle on motorbike. The algorithm SHOULD include centripetal correction. Centripetal forces act on accelerometers, and is related to speed. As a starting point, start reading documentation on RC drones, specially the DCM algorithm. I used the Kalman filter from the Gluonpilot project. But the DCM algorithm is probably faster.

More to come.

Angelo
0 Kudos
Reply