C185 Serial Connection to Arduino Uno

D153, D175, C125, C127, C185 and C187 forum

C185 Serial Connection to Arduino Uno

Postby david_stemen on Mon Apr 11, 2022 7:36 am

Hi Guys,
FSAE student here getting pretty stressed over my senior capstone project. We're trying to make a rear wheel steering system that uses steering angle and vehicle speed as an input, so I want to pull the steering angle and wheel speed signals from the dash via the TX pin to an Arduino to compute the actuator outputs.

I'm only familiar with serial communications as of about a week ago though, and I'm starting to reach the limit of my own learning before I need some help. I was able to use the following scripts from the Arduino forums to get two Unos to communicate with one another via the serial connection, but I'm struggling to swap the sender Arduino with the C185.

https://forum.arduino.cc/t/serial-input ... ted/382007

The issue is I don't know what exactly I'm supposed to be receiving. I've set up the RS232 connection in the dash manager to only send steering data for now, so I know the motec is sending what it should, but I don't know how to see that. Are there starting and ending characters, or is it just a constant stream of data? And should I be expecting a certain data type (i.e. char, floats, etc.)

I'm sorry if this is a broad question, I'm just really out of my depth here and none of the forums I've checked over the last week seem to be addressing this issue; they're mostly about serial connections to ECUs. Any help understanding is appreciated!
david_stemen
 
Posts: 3
Joined: Thu Apr 07, 2022 12:49 am

Re: C185 Serial Connection to Arduino Uno

Postby Stephen Dean on Mon Apr 11, 2022 10:16 am

Hi,

Do you need to specifically use Serial for the communications? I would recommend using CAN instead.
Stephen Dean
MoTeC Research Centre Melbourne, Australia
User avatar
Stephen Dean
Site Admin
 
Posts: 1726
Joined: Tue Dec 02, 2014 10:29 am
Location: Melbourne

Re: C185 Serial Connection to Arduino Uno

Postby david_stemen on Mon Apr 11, 2022 1:15 pm

I guess I just figured it would be easier since it's a single wire connection vs trying to interface with CAN, which is something I'm unfamiliar with. Our steering potentiometer is not a CAN sensor, does that mean we can't take from the CAN network coming from the dash? Or will the C185 transmit that data along the CAN line if requested?

A lot of the added difficulty in troubleshooting this for me has been I don't yet have an effective means of reading the CAN data in the first place, so even if I think I have the settings correct in the dash manager I can't check that with any of my Arduino code.
david_stemen
 
Posts: 3
Joined: Thu Apr 07, 2022 12:49 am

Re: C185 Serial Connection to Arduino Uno

Postby Stephen Dean on Mon Apr 11, 2022 1:29 pm

Hi,

Personally, CAN is much easier to use compared to Serial.

If you have the steering angle sensor wired into the C185, then you can transmit that data out over CAN, you just have to add the channel into the CAN Transmit template.

We have a CAN inspection tool called CAN Inspector, that gateways through the Dash and shows all of the data that is being transmitted on the CAN Bus in raw form, it is installed as part of the MoTeC Utilites Package.
Stephen Dean
MoTeC Research Centre Melbourne, Australia
User avatar
Stephen Dean
Site Admin
 
Posts: 1726
Joined: Tue Dec 02, 2014 10:29 am
Location: Melbourne

Re: C185 Serial Connection to Arduino Uno

Postby david_stemen on Tue Apr 12, 2022 3:37 am

This is great, I'll check it out later this afternoon and see if we can find where along the line our issues are. Thanks!
david_stemen
 
Posts: 3
Joined: Thu Apr 07, 2022 12:49 am


Return to Colour displays

Who is online

Users browsing this forum: No registered users and 8 guests

cron