26 (edited by AlxBilt 28-01-2024 05:54:21)

Re: Numerical value to CAN D1:D0

Konstantin, CANNY logic wrote:

Please see here: https://stackoverflow.com/questions/318 … -ack-field


Q.

"When a receiving node would like to ACK acknowledge the receipt of a frame, what exactly is it supposed to transmit?

The same frame just with a dominant bit for ACK?"

A. "

No, every CAN node controller on the bus will usually listen to a message transferred and will automatically check this frame for correctness (CRC).

And it will usually also acknowledge the message by overwriting the recessive ACK=1 ("send" by the transmitter) with a dominant ACK=0 during message transfer. So there is no second message needed to acknowledge the first one.

That's also why you can't have any CAN bus with just one node, because there is no one else to acknowledge and check its sent frames.

Of course, in some controllers these checks can be deactivated or ignored, but not in the common use case."


Very interesting.

So basically in my scenario the engine's computer is either accepting the first message but no more (given the sporadic acceptance viewed through OBD2 PID)

or

the TX period (time) and / or quantity of frames per second are the issue.

27 (edited by AlxBilt 29-01-2024 05:09:33)

Re: Numerical value to CAN D1:D0

If you saw my video with Canny as the standalone Speed Module then the test below seems to be the next step for proper calibration of Canny settings.

My new plan is to use UART2 VCP to visually see the count of the pulse to verify they are adequate for debugging.

From there I can get a better understanding of what should be going to at the output of the TX CAN data.

I tried two COM port software. One called Terminal and the second is called HTerm 0.8.9.
Terminal seems to be ideal since it has a visual graph.
 
Next,  I loaded the UART2 Driver but-------I see UART2 TX output register is similar to CAN e.g. "D1:D0" etc.

I left the activation "Hello!" the same.

Test #1.

I placed a counter from Frequency Meter "output" to Counter "Increment" to UART2 TX "D1:D0."

Results:

Did not make sense to me.

Test #2.

Using HTerm.
Place a Constant value of "1500" as a testing baseline to "input" of UART2 TX "D1:D0"

Results:

1     2     3
220 005 000

Test #3.

Using Terminal.
Place a Constant value of "1500" as a testing baseline to "input" of UART2 TX "D1:D0"

Results:

DC 05 00

Which appears to be colors for coding.

Question:

1. What do you recommend to view the pulse count results from Frequency Meter output?


2. How do you add value result of UART2 TX D1:D0?

Post's attachments

Attachment icon 1_28_2024_VSS_ADC_CH8_CUMMINS_ECU_TX_215_0_27_UART2 USB VCP_4.cfd 19.83 kb, 74 downloads since 2024-01-29 

28

Re: Numerical value to CAN D1:D0

Question:

1. What do you recommend to view the pulse count results from Frequency Meter output?

2. How do you add value result of UART2 TX D1:D0?

Could the approach suggested in the attachment work for you?

Post's attachments

Attachment icon 1_28_2024_VSS_ADC_CH8_CUMMINS_ECU_TX_215_0_27_UART2 USB VCP_4_1.cfd 18.47 kb, 80 downloads since 2024-01-29 

29

Re: Numerical value to CAN D1:D0

Hello Konstantin,


I was able to download and run the diagram.
Thank you.

I sent you an email of the report and findings.

30

Re: Numerical value to CAN D1:D0

Correction*

I thought you meant this diagram.

1_28_2024_VSS_ADC_CH8_CUMMINS_ECU_TX_215_0_27_UART2 USB VCP_4_1.cfd 18.47 kb, 2 downloads since 2024-01-29

I just realize you sent one to my email.

The one above is no good. I will check the one in my email.

31

Re: Numerical value to CAN D1:D0

Possible my example is not what you exactly need. But once you launch it (unmodified), you will be able to observe the frequency meter output data in the terminal in human readable ASCII format.

32

Re: Numerical value to CAN D1:D0

Konstantin, CANNY logic wrote:

Possible my example is not what you exactly need. But once you launch it (unmodified), you will be able to observe the frequency meter output data in the terminal in human readable ASCII format.


I will use the original file and study from there.

Thanks

33

Re: Numerical value to CAN D1:D0

Hello Konstantin,

I am going in a different direction while I study the logic of CANbus. I am very close to getting it to work but as you saw in my videos the issue is the engine module do not accept Canny TX data without the ABS module being idle on the CANbus and then the messages are only accepted sporadically.

2nd Option:

I would like to see if the speed distortion I currently have with my original setup (sine wave>>ADC Yellow Box>ABS Module>CANbus) is caused by the ADC Yellow Box or the ABS module. I suspect the Yellow Box is the culprit.

I figure since Canny appears to be a pretty good wave counter then perhaps it would do a better job than the Yellow Box.

So here is the new project.

Continue using the Frequency Meter to input the sine wave on one channel (ch8 currently) and relay the count to Channel 7.

I.E. sine wave>channel 8>output to Ch7>ABS Module>CANbus.

My remap is not working. I do not see in Documents on the CannyLogic site an explanation of  "Strong VDD/Weak GND" or derivatives, to understand what each type does. I have tried all selections but none allows ch7 to output the input count from ch8.

I have also tried "DIO Output PWM Duty Setup Register, IO Channel 7" but that did work either.

I tried turning "Strong VDD/Weak GND" or derivatives to a constant "1" but that did not work either.

Can you point me in the right direction please.

Post's attachments

Attachment icon 2_9_2024_VSS_Counter_UART2 USB VCP_4_5_working69MPH.cfd 14.12 kb, 69 downloads since 2024-02-10 

34 (edited by AlxBilt 11-02-2024 03:06:43)

Re: Numerical value to CAN D1:D0

I have also tried (butchering) implementing your Gruner Controller v2.0 but that did not work either.

Post's attachments

Attachment icon 2_9_2024_VSS_Counter_UART2 USB VCP_4_5_working69MPH6.cfd 14.74 kb, 68 downloads since 2024-02-11 

35

Re: Numerical value to CAN D1:D0

AlxBilt wrote:

...

2nd Option:

...
Can you point me in the right direction please.

Please see the attachment for a completely suboptimal solution, just to demonstrate the principle.

Also, please see the related documentation:

For DIO PWM:
https://cannylogic.com/docs/c72duo/io/# … utput_mode

The CANNY 7.2 Duo's "Strong VDD/Weak GND" is equivalent of CANNY 7's "Output PLUS (100mA) / Output minus (1mA)" : 

https://cannylogic.com/docs/c7/io/#sec- … t_diagrams

Post's attachments

Attachment icon 2_9_2024_VSS_Counter_UART2 USB VCP_4_5_working69MPH_1.cfd 14.62 kb, 75 downloads since 2024-02-12 

36

Re: Numerical value to CAN D1:D0

AlxBilt wrote:

I have also tried (butchering) implementing your Gruner Controller v2.0 but that did not work either.

I don't quite understand what this is and how I can help here.

37

Re: Numerical value to CAN D1:D0

Pardon my writing if it is confusing.

I would like to know if  it is possible to count pulse - using the Frequency Meter  - on a channel and output the value on another channel?

Example.

Input pulse signal count value on ch.8
then
Output the count value on ch.0.


Essentially making Canny a counter gateway that count pulse on one channel and output the value on another channel.

38

Re: Numerical value to CAN D1:D0

What did you mean:

Output the count value on ch.0.

In what form?

39 (edited by AlxBilt 14-02-2024 02:24:43)

Re: Numerical value to CAN D1:D0

My idea is; 

Canny would read sine wave pulse (currently doing that)  from the vehicle's ABS module on ch.8  then
output the count value on ch.0 in square wave pulse form as an alternative to sending CAN data.

Essentially relaying the input pulse count (analog to digital converter) from analog pulse input  to digital pulse output.

40

Re: Numerical value to CAN D1:D0

AlxBilt wrote:

Canny would read sine wave pulse (currently doing that)  from the vehicle's ABS module on ch.8  then
output the count value on ch.0 in square wave pulse form as an alternative to sending CAN data.

Did you see the diagram in my comment above? This is the link: https://forum.cannylogic.com/viewtopic. … 1092#p1092

This is exactly what you are talking about, except that instead of channel 0, channel 7 is used and the output frequency is already scaled.

Essentially relaying the input pulse count (analog to digital converter) from analog pulse input  to digital pulse output.

As I said earlier, the ADC has absolutely nothing to do with it.

41 (edited by AlxBilt 14-02-2024 20:04:04)

Re: Numerical value to CAN D1:D0

"Did you see the diagram in my comment above?


Sorry no. I overlooked it since it was the same name-except with a 1 attached. I understand ADC with Canny does not apply in this application.

I meant ADC for the truck side. The truck appears limited to analog and the ABS module does not respond well with the analog signal. That is why I had to use the YellowBox as an ADC and multiplier.

Your diagram is interesting. I tried DIO PWM (duty / period) prior to these messgaes but I was thinking 1 to 1, meaning without Map and Division.

I am studying the Map and Division (X / Y) to try and understand  what is happening internally.


Thank you

42 (edited by AlxBilt 11-05-2024 04:03:07)

Re: Numerical value to CAN D1:D0

Hello Konstantin,

I have been meaning to add the results of your last debugging diagram on the forum.  Here is the messages sent to your email. Perhaps my research findings can help further development of my Canny project .

On:

Feb 21, 2024 5:24 PM

Wow!! I see..
Canny is now sending 0x215 D0_0E   and  D1_52 frames.
Awesome.
Thank you Konstantin.

I am looking forward to seeing how the engine ECU reacts.

Feb 21, 2024 7:35 PM

Hello Konstantin.

I was able to perform a vehicle test of your diagram (0x215.cfd) live in action.

I noticed the duration length of the speed (17 mph) acknowledge by Cummins through OBD2 PID stability is extended before it sporadically cuts out. Speed via OBD2 PID stability has definitely been extended. 

The results definitely equal progress.

I no longer need the ABS module to trigger the ECM to accept the speed.

Technically I do not understand the diagram function processes (step by step) or how the changes in your diagram allowed 0x215_D1 to have a working value. 

Overall I believe the Canny controller is capable of the task that I envision.
I just do not understand how to program complex diagrams.
I will try to implement 0x215.cfd further.

s/Alex

May 10, 2024 1:38 PM

Hello Konstantin,

I have been busy with other life’s tasks so I have not been able to tinker with Canny.
I continue to study the theory of CAN bus when I can.
As a result here are my findings with another individual who understands the checksum requirements of the Cummins engine module. Hopefully, a Canny diagram is able to be conceived in combination with Frequency Meter diagram.


Example:

A valid vehicle speed message ID: 0x215 must have D0 combined with D1 as well as D6.
D6 is the checksum.

For the 2006 Dodge Ram, speed combine is both D0 and D1 in the same manner as Canny format, 0x0E52.

First issue

At present I do not know how It would be possible to incorporate D0 and D1 as separate split values from the frequency meter output. Perhaps I could sniff a CAN bus from 0 to 65 mph and then mimic the results. (I will have to think further on the logic.)

Example of the required formula: D0 and D1 hex value /128 for km/h and 206 for mph = speed value.


Cummins takes ABS module ID 0x215 messages and does checksum parity check on it.

If the parity is even the ABS module will toggle 0x215_ D6 between 0x01 and 0x02 on every other CAN message.

If it’s odd then it toggle D6_ 0x00 and 0x03 on every other CAN message.

( Parity meaning that if D0 and D1 combined 1s value in binary is  even then toggle D6 = 0x01 or 0x02. )
( Parity meaning that if D0 and D1 combined 1s value in binary is odd then toggle D6 = 0x00 or 0x03. )

Example: 12800 for this example only.

If sum of both number combine is (Combine D0_0C and D1_320) =  X or 3200
Convert X to decimal 12800,
divide by 128 gets you 100km/h, then for 0x215_D6 checksum toggle value
you break down 12800 into bits 11001000000000 (binary)
and count the number of 1s  = 3. This will tell you if the checksum
parity (how many ones (binary bits) are in a byte) is even or odd.

Example:

The number 7 is 0111 in binary, it has 3 ones so it odd parity checksum, 0x215 D_6 toggles D6 = 0x00 or 0x03 every other two message ID frame.

Number 8 is 1000 in binary, it has 1 one and is odd parity checksum, 0x215 D_6 toggles 0x00 or 0x03 every other two message ID frame.

Example:

If speed value, 0x215 _D0 and D1 message is constantly [ 7 ] kmh/mph then toggle D_6  value = 0x00 and changes to 0x03 every other message frame,  meaning every two message frames if speed value does not change as in cruise control.

7 0x00
8 0x03
8 0x00
8 0x03

The second

issue to solve is if Canny can to alternate D6 every other frame message sent when the speed value is unchanged. (See the PDF email I sent for explanation.)

How does Canny Gateway function apply to checksum parity? I assume Canny must be able to execute the parity if it can perform gateway function to solve other problems. I am currently reviewing Docs for the solution.

s/Alex

43

Re: Numerical value to CAN D1:D0

AlxBilt wrote:

First issue

At present I do not know how It would be possible to incorporate D0 and D1 as separate split values from the frequency meter output.

Something like that? (see attached picture)

AlxBilt wrote:

The second

issue to solve is if Canny can to alternate D6 every other frame message sent when the speed value is unchanged.

I don't see any problem with this.  (see attached cfd-diagram source file)

Please don't forget to attach the cfd-diagram file to each your post showing your progress in solving the problem and what exactly didn't work on it.

Post's attachments

HL.png, 9.52 kb, 498 x 170
HL.png 9.52 kb, 50 downloads since 2024-05-14 

Attachment icon alter.cfd 1.21 kb, 55 downloads since 2024-05-14 

44

Re: Numerical value to CAN D1:D0

Hello Konstantin,

Thank you for taking the time to send another diagram.

Forgive me as I have no formal training in electronics. So my understanding may be inconsistent with the science.


The Ford ABS module is reading the AC pulse /frequency count from the vehicle speed sensor located on the truck's differential.  The Ford ABS module then outputs  the frequency pulse to Canny's frequency meter input channel.

Once Canny receives the frequency pulse reference on the input channel, the issue then would be for Canny to convert that reference  input pulse into the two bytes  D0 and D1 prior to output the data on the CAN bus in the form of 0xD1D0.

Prior to my conversation with David (another forum associate). I thought 0xD0 was the Cummins engine computer only required byte for speed value.

Both D0 and D1 are required to be combined together, 0xD1D0, (at my current understanding) possible for the checksum alternating variable at D6.

I do not see how Canny could be utilized to receive the Ford ABS module single analog pulse outputs then convert the value into two variables (D0 and D1) or rather 0xD1D0.

Perhaps I would need to sniff the CAN bus of the original Dodge ABS module to verify the speed variables of D0 and D1 from 0 mph/kmh  through 100 mph/kmh as a reference.

Afterwards use that reference data to program Canny to correlate the frequency count to the mph/kmh at a specific speed/ frequency pulse count.


>The second issue would be for 0x215_D6 checksum value to alternate every other frame message sent.

You said: "I don't see any problem with this. Please run attachment in the CannyLab's simulator."

There is additional logic that has to be taken into consideration.

Checksum D6 final variable =  ( 0x01 or 0X02 for even and 0x00 or 0x03 for odd)

is dependent on the amount of 1s of 0xD1D0 combination converted to binary. The 1s count total will equal an even number or odd number.

D6 = 0x01 or 0X02 for an even number of 1s.

D6 = 0x00 or 0x03 for odd numbers of 1s.

Example:

7 mph/kmh = 0111 in binary. There are three 1s, therefore D6 = 0x00 or 0x03 if the speed 7 mph/kmh is held constant as in cruise control.

8 mph/kmh = 1000 in binary. There are one 1s, therefore D6 = 0x00 or 0x03 if the speed 8 mph/kmh is held constant as in cruise control.

D6_0x00  alternating D6_0x03  every other message is the checksum of 0xD1D0.

Speed in mph/kmh example:

When the speed changes to 7 kmh / mph then this is the result.

7 0x00
7 0x00

alternating every two messages. This is how Cummins "ACKnowledge" the speed data message (0xD1D0) is accepted and not rejected.

7 0x03
7 0x03
7 0x00
7 0x00

When the speed changes to 8 kmh / mph then this is the result.

8 0x00
8 0x00
8 0x03
8 0x03

etc

9 0x01
9 0x01
9 0x02
9 0x02
9 0x01
9 0x01

etc.

D2-D3 and D4-D5 are omitted according to David. Assuming he is correct, D2-D3 and D4-D5 are not needed for the purpose of sending a speed message (0xD1D0) to the Cummins engine module. I believe D2-D3 and D4-D5 are counting either time or distance.

You: "Please don't forget to attach the cfd-diagram file to each your email/post showing your progress in solving the problem and what exactly didn't work on it."

Understood. The previous diagram (0x215)  you sent,  I used on February 21, 2024 in debugging. I made no changes to your efforts (because I do not understand the fundamentals as of yet).   I was able to use that diagram to better understand ACK (checksum) requirement for sending custom CAN frames.

This was accomplished by using your 0x215.cfd as a standalone debugging diagram to better understand the checksum required variable and the resulting value that was accepted by Cummins engine module via OBD2 PIDs.  0x215.cfd had no influence from Ford ABS pulse output. This was a direct custom injection of vehicle speed onto the CAN bus. Canny might be better suited as a Gateway rather than the application I am attempting to utilize.

When I get some free time, I plan on debugging with Canny to send a constant speed using the 0xD1D0 / (128 for kmh or 206 for mph) TX  formula as well as try to implement your diagram, alter.cfd,  to utilize Canny for D6 checksum.

Post's attachments

Attachment icon 0x215.cfd 2.93 kb, 50 downloads since 2024-05-15 

45

Re: Numerical value to CAN D1:D0

Forgive me as I have no formal training in electronics. So my understanding may be inconsistent with the science.

I see no reason to apologize. It's never too late to learn if you want to.

I do not see how Canny could be utilized to receive the Ford ABS module single analog pulse outputs then convert the value into two variables (D0 and D1) or rather 0xD1D0.

We already discuss the pulse counter and bytes separations early.
BTW: The "0x" prefix is used to indicate that the constant following it is hexadecimal: https://en.wikipedia.org/wiki/Hexadecimal
D1 and D0 here are register names, not constant values. Using a prefix with them confuses the reader.

There is additional logic that has to be taken into consideration.

I did not see the problem with it too. You should try to implement this yourself. Divide the problem into smaller ones, solve them in parts and then combine them. Read the documentation for function blocks. Link them together, step by step. Use the simulator for debugging. If you will have specific questions about the implementation, please ask brief and to the point and attach the diagram.

Canny might be better suited as a Gateway rather than the application I am attempting to utilize.

The best way to check is to implement both solutions. If you want my opinion - CANNY is good for both.

When I get some free time, I plan on debugging with Canny to send a constant speed

This is a great plan! This is exactly what I'm talking about - solving the problem piece by piece.