C185 CAN Transmit Message Setup

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

C185 CAN Transmit Message Setup

Postby rac70 on Thu Aug 03, 2023 10:26 am

Hello. I have a C185 Dash and am trying to set up a CAN communication to trigger an accelerometer to zero itself with a button press.

The accelerometer is set up on Base ID 0x470 and 0x471. The following is listed on the accelerometer datasheet for zeroing the sensor, but I'm not sure whether these need to be added as single or compound messages.

Message Structure (ID 0x010):
Byte 0 = 0x69 // i
Byte 1 = 0x6d // m
Byte 2 = 0x75 // u
Byte 3 = 0x71 // z
Byte 4 - 0x65 // e
Byte 5 = 0x72 // r
Byte 6 = 0x6f // o
Byte 7 = 0x7a // z

I have set up a transmit message parameter with the Base ID 010 and Trigger "CAN Tx Trigger," with each byte and provided ID set up as a compound message identifier all with a FFFF ID Mask. The reference channel will be set up for the button used to zero the sensor. Am I going about this the correct way? Thanks!
rac70
 
Posts: 10
Joined: Thu Aug 03, 2023 6:43 am

Re: C185 CAN Transmit Message Setup

Postby Stephen Dean on Fri Aug 04, 2023 10:04 am

Hi,

Can you post the configuration from the C185, as well as information on the accelerometer that you are using thanks.
Stephen Dean
MoTeC Research Centre Melbourne, Australia
User avatar
Stephen Dean
Site Admin
 
Posts: 1741
Joined: Tue Dec 02, 2014 10:29 am
Location: Melbourne

Re: C185 CAN Transmit Message Setup

Postby rac70 on Sat Aug 05, 2023 4:04 am

Here is some more info. I wasn't able to post photos before.

The accelerometer I am using is a race grade 6-axis IMU. The full data sheet is located here:
https://www.milspecwiring.com/assets/im ... U%20v2.pdf

Here is the text on zeroing the sensor:
rg-imu-zeroing.png
rg-imu-zeroing.png (54.63 KiB) Viewed 5119 times


Here are the transmitted channels.
rg-zero-parameters.png
rg-zero-parameters.png (23.83 KiB) Viewed 5119 times


I tried setting it up as a compound message, but I believe all of this is incorrect. I also tried setting up each byte as an individual unitless channel.
rg-transmitted-channels.png
rg-transmitted-channels.png (19.4 KiB) Viewed 5119 times


I apologize for the lengthy post. This is my first time trying to transmit messages on the C185.
rac70
 
Posts: 10
Joined: Thu Aug 03, 2023 6:43 am

Re: C185 CAN Transmit Message Setup

Postby quadcam on Sun Aug 06, 2023 1:19 pm

Try this;
Set up a Constant (in Calculations - Constants) with a value of -1
Constant.jpg
Constant.jpg (32.52 KiB) Viewed 5101 times

Then add the following 4 channels to your transmit message, noting the differences in Offsets and Bit Masks;
channel_1st.jpg
channel_1st.jpg (50.61 KiB) Viewed 5095 times

channel_2nd.jpg
channel_2nd.jpg (48.46 KiB) Viewed 5095 times
quadcam
 
Posts: 39
Joined: Thu Dec 17, 2020 10:00 pm
Location: Queensland

Re: C185 CAN Transmit Message Setup

Postby quadcam on Sun Aug 06, 2023 2:08 pm

channel_3rd.jpg
channel_3rd.jpg (26.29 KiB) Viewed 5095 times

channel_4th.jpg
channel_4th.jpg (26.84 KiB) Viewed 5095 times

That should do what you want.
quadcam
 
Posts: 39
Joined: Thu Dec 17, 2020 10:00 pm
Location: Queensland

Re: C185 CAN Transmit Message Setup

Postby SOReilly on Mon Aug 07, 2023 2:21 pm

The method quadcam has shown will work well.

This could also be simplified further by setting the transmit length to 4 which allows you to set the mask for 4 bytes in a single channel.

masked const.JPG
masked const.JPG (36.75 KiB) Viewed 5059 times
SOReilly
MoTeC
 
Posts: 90
Joined: Wed May 04, 2022 12:28 pm
Location: Melbourne

Re: C185 CAN Transmit Message Setup

Postby quadcam on Mon Aug 07, 2023 5:18 pm

@SOReilly, I actually did that first then edited the reply to the 2-byte masking as the constants appear to be 16-bit and I wasn't sure if 4-byte masking would work. Good to know it will.
quadcam
 
Posts: 39
Joined: Thu Dec 17, 2020 10:00 pm
Location: Queensland

Re: C185 CAN Transmit Message Setup

Postby rac70 on Tue Aug 08, 2023 4:20 am

Thanks for the quick and detailed responses! I will give those a try.

Similar to the first question but I also wondering if it is possible to use the same button to transmit two different messages so I can zero two different types of sensors. I know the dash manager doesn't let you use the same channel multiple times.
rac70
 
Posts: 10
Joined: Thu Aug 03, 2023 6:43 am

Re: C185 CAN Transmit Message Setup

Postby SOReilly on Tue Aug 08, 2023 11:24 am

@Quadcam, that's a fair assumption. most values in the dash exist as 16 bit signed integers unless it's something special e.g the GPS lat/long or the output of advanced maths.

Even though the channel value can't exceed -32767 you have still specified you want to use 4 bytes (32 bit) to transmit this. For example the 32 bit representation of -32767 would be FF FF 80 01 and -1 would be FF FF FF FF.
32bit -1.JPG
32bit -1.JPG (83.71 KiB) Viewed 5015 times


@Rac70 The trigger channel you have specified can be used again for another message.
trigger channel.JPG
trigger channel.JPG (28.06 KiB) Viewed 5015 times


When this channels value is anything other than 0 the message will be transmitted once.

You might have the output channel of a user condition used as the trigger channel for multiple triggered messages.
SOReilly
MoTeC
 
Posts: 90
Joined: Wed May 04, 2022 12:28 pm
Location: Melbourne

Re: C185 CAN Transmit Message Setup

Postby rac70 on Wed Aug 09, 2023 3:44 am

Thanks. Yeah I was mistaken and didn't realize some channels can be set up in multiple places.

I have a few follow up questions because I want to make sure I understand the logic behind the CAN programming. I'm very new to working with CAN and Motec so I apologize if these are basic questions.


I might just be misunderstanding Hex, but I am confused on how the program interprets the different bit masks. In quadcam's original example, wouldn't it be interpreted as "6572" spread across 2 bytes instead of "65" and "72" as separate bytes?

I'm also a little confused on why the Constant channel with a -1 value is required. I know this is sometimes used when there are unused channels in pre-existing CAN templates, but I'd like to understand the reasoning behind it.
rac70
 
Posts: 10
Joined: Thu Aug 03, 2023 6:43 am

Next

Return to Colour displays

Who is online

Users browsing this forum: No registered users and 25 guests