Go Down

Topic: Steering wheel angle sensor by using MCP2515 Can Bus Shield  (Read 617 times) previous topic - next topic

sa_rafatnia

Hi
I decided to use the steering angle sensor in vehicles to collect the steering angle with a high sensitivity ratio. For this purpose, I use a steering angle sensor with 6002 sockets from Bourns. The sensor has not calibrated and I haven't seen any change in sensor outputs, despite all the calibration packages I sent. In this respect I'm trying to receive CAN DATA from Arduino UNO with MCP2515 Module. I can only receive data using a CAN-L and CAN-H pin. I tried my connection form in different combinations and the result was the same but i receive this messages from can bus,
Standard ID: 0x1E5 DLC: 8 Data: 0x00 0x00 0x00 0x20 0x00 0x00 0x00 0x5C
Standard ID: 0x1E5 DLC: 8 Data: 0x00 0x00 0x00 0x40 0x00 0x00 0x00 0x7C
Standard ID: 0x1E5 DLC: 8 Data: 0x00 0x00 0x00 0x60 0x00 0x00 0x00 0x9C
Standard ID: 0x1E5 DLC: 8 Data: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x3C
Standard ID: 0x1E5 DLC: 8 Data: 0x00 0x00 0x00 0x20 0x00 0x00 0x00 0x5C
Standard ID: 0x1E5 DLC: 8 Data: 0x00 0x00 0x00 0x40 0x00 0x00 0x00 0x7C
Standard ID: 0x1E5 DLC: 8 Data: 0x00 0x00 0x00 0x60 0x00 0x00 0x00 0x9C
Standard ID: 0x1E5 DLC: 8 Data: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x3C
Standard ID: 0x1E5 DLC: 8 Data: 0x00 0x00 0x00 0x20 0x00 0x00 0x00 0x5C
Standard ID: 0x1E5 DLC: 8 Data: 0x00 0x00 0x00 0x40 0x00 0x00 0x00 0x7C
Standard ID: 0x1E5 DLC: 8 Data: 0x00 0x00 0x00 0x60 0x00 0x00 0x00 0x9C
which are constant and i haven't seen any change in sensor outputs. I understand that, firstly i have to send a reset message and after that the "calibration" set message. The reset message is done by sending a single byte with the value 3 as integer to the sensor! but i dont know how do that? Could you give me some advice about how to fix it? Thank you in advance for all your help. I am using coryjfowler library " https://github.com/coryjfowler/MCP_CAN_lib ".

Klaus_K

If you are receiving CAN messages, your CAN bus is fine and your issue is on the application layer.

Here is what your CAN bus should look like.

- Two wires terminated with 120Ohm on each end. Some module have these on board. Make sure you disconnect any additional resistors.
- Each node must use the same bit rate setting e.g. 250kBit/s.
- You must have at least two nodes on your bus

The CAN protocol (handled in hardware by the MCP2515) will

- ensure the message is send without error
- the message has been read by at least one other node
- no node detected an error and created an error frame

So, when you can send or receive messages everything else is up to your application. If you need help with that you need to provide some more information about the sensor. e.g. links to data sheets, additional information about the application layer protocol. e.g. how do you know what messages (ID) you need to send ...

sa_rafatnia

Firstly, i have to express my thanks for your following up the issue and your supports. Your advice really help me to solve the problem i am facing.
I rechecked all your advice as follow:
- Two wires terminated with 120Ohm on each end.
- The message is send without error.
I have attached the catalog of sensor. Would you please check it? I dont know what messages (ID) i need to send.

Klaus_K

The message ID and message length does not fit the datasheet. You should receive messages with ID 0x280 and 4 byte length. I would expect the sensor to start sending messages without you sending anything.

Do you have a standard sensor or is the sensor a OEM variant that might have other OEM-specific messages?

The datasheet states you need to send SAS transmit identifier with the command. Is there any ID printed on the sensor? Its just 2 nibble ( 2 x 4bits ), so must be something simple.

Just FYI, the double CAN-LOW and CAN-HIGH signal pins are just for redundancy.

sa_rafatnia

 Dear Klaus
I attach the sensor pictures and technical details. only the OEM part number is printed on the sensor as 13587663. It also should be noted that, the sensor is used in Opel Astra J 1.7 vehicles.

sa_rafatnia

In this video also the arduino mega and mcp2515 is used to data  acquisition of this sensor:
https://youtu.be/pKJPpXw1DDM

Klaus_K

In this video also the arduino mega and mcp2515 is used to data  acquisition of this sensor:
I am certain the sensor in the video uses different messages. Maybe it even uses the ones in the datasheet. It clearly says Saab in the video description.
Your sensor has a GM logo printed on it. GM owned Opel for a while. The datasheet clearly states OEM can have their own special CAN messages. You will need to figure out what changes GM requested for the sensor. They are unlikely to share any information with you.
You could connect your CAN module to an active CAN bus from the original car and collect the data.

In the datasheet, the sensor uses a larger ID (0x7C0) for commands than for angle data (0x280). This means the sensor data have a higher priority. This seems sensible because the steering data is quite important. You can assume the GM variant will have the same pattern. So, when you try to find the command messages you can ignore all the messages with an ID lower than the ID of the messages used by the sensor for transmitting angle data. This will still require some detective work.

Do you have to use the OEM version? You could get an original from Bourns.

sa_rafatnia

You are right
I chose the wrong sensor!  :'(
So what do you think؟  I can not do anything with this sensor at all?

Klaus_K

So what do you think؟  I can not do anything with this sensor at all?
You can try to find some more information using Google. There seem to be a few pages with useful information about steering angle sensors.

Without some documentation it will be difficult to figure out what the sensor requires to start sending angle information. An alternative could be to find somebody with access diagnostic tools and knowledge about the calibration procedure. Maybe a local car repair shop is willing to help you.

sa_rafatnia

Dear Klaus
Thank you for following up my request. Your advises really helped me.
Sincerely

alexr32

Picking up on your message on the seed forum:
https://forum.seeedstudio.com/t/steering-wheel-angle-sensor-by-using-mcp2515-can-bus-shield/251751

Regarding the messages you are seeing, they are probably the documented error messages sent in bits 24 to 27 of the message, you are reading the whole of byte 3 as a decimal so 0000 is being appended so the decimal value isn't correct. The fault codes are:

Internal status:
111 = Calibrated and OK
101 = Not calibrated
110 = Fault
100 = Fault and not calibrated
000 = Not trimmed

Your are reading the whole byte and seeing decimal 96 which is 0110 0000 = Fault
64 > 0100 0000 = Fault and not calibrated
32 > 0010 0000 = ?

Reading the data sheet from Bourns to reset the zero position calibration it looks like you need to send:

canid 0x7C0
byte 0 bits 0-3 101 and then 011
If you are sending the whole byte this would be
10100000 binary to clear the old zero
01100000 binary to set the new zero

(I can see from the seeed forum that you have already found out about the "decimal 3"  (011) command but you actually wouldn't send decimal 3 in the data byte.)




Go Up