1

Topic: Problem with canny 5.2 can gateway

I am trying to do some simple filtering and alteration of can message, but I can't seem to make the gateway work.  Hopefully I'm just missing something obvious.

I've attached my cfd file.

In testing:
- I added a line to my logic to turn on the led. That works so I know the diagram has loaded and is running.

- I know I have good CAN1 input.  I can move the input lines over to my Canny 7 and see the traffic.

- I hook the Canny 7 up to CAN0 on the 5.2 and I see nothing. The led on the 7 is blinking red/green so I know it's looking for messages.

- I've tried eliminating the FTCAN setting and I've stripped down my test to eliminate all the filtering (and just run the gateway).  I still get nothing through.

Can someone tell me what I'm doing wrong?

Post's attachments

Attachment icon canny test 2.cfd 2.99 kb, 258 downloads since 2018-12-10 

2

Re: Problem with canny 5.2 can gateway

I just thought of something.  Does the 5.2 need termination resistors on either side?

3

Re: Problem with canny 5.2 can gateway

There were several errors on your diagram. But that's OK - our English doc is not very detailed. We fixed your diagram (see attachment) and added some examples to the English wiki: http://wiki.cannylogic.com/index.php?ti … way_Driver

You should always delete termination resistors for FT CAN. You can do it for CAN1 by cut a trace: http://wiki.cannylogic.com/index.php?ti … and_layout

CAN0 does not have built-in termination resistor.

Post's attachments

Attachment icon canny test 2a.cfd 3.52 kb, 256 downloads since 2018-12-10 

4

Re: Problem with canny 5.2 can gateway

Thank you!!

I never would have looked for the resistor.  My 5.2 is now happily passing messages.

Changing the IDL on 0x271 messages to 273 is working

For 0x351 messages, it appears that the change for the reverse signal is always being applied no matter what the state of IO channel 8 and I'm not sure why you're resetting the Gateway configuration, but I will figure those out.  You shouldn't have to debug my logic.

Your response was much appreciated.

5

Re: Problem with canny 5.2 can gateway

CAN1 has a built in resistor?!  I never knew...

I will have to go and check my installation now, I think I have 3 resistors in the network!

6

Re: Problem with canny 5.2 can gateway

Okay, I have this working.  My problem was that the default state for DIO channels 8 and 9 is +12v and they have pull up resistors to reset the level for an open circuit.  Just using my brake light line for the reverses signal put 12v on a DIO channel that was already at 12v and without the brake lights the input wire is just open so the channel is still at 12v.  No change is ever detected.

Two viable solutions.
Use the brake signal to close a relay that grounds the DIO channel.  This works.
Use channel 10 in ADC mode.  I haven't tried this yet because there are no RED or FED registers in ADC mode and it will change the logic a little.  I'll try it later...just for the exercise.

7

Re: Problem with canny 5.2 can gateway

I took a shot at using the ADC for this but couldn't get it to register.  The documentation only shows two registers for the ADC and no indication of how to calibrate the input...or what the DIO Register should read for any supplied voltage.  How many bits should a 12v input generate?  Am I missing something here too?

8

Re: Problem with canny 5.2 can gateway

You missed nothing. Wiki page for it was poor and not translated. Now fixed: http://wiki.cannylogic.com/index.php?ti … ADC_Driver

9

Re: Problem with canny 5.2 can gateway

Works perfectly.

This may be a little off topic for this thread, but is there anyone in the community who has played with older Audi vehicles?  In particular I'm interested in the properties of the GALA wire, which is also known as the V-speed wire.  Is transmits the pulses from either an ABS sensor or a transmission speed sensor.

I'd like to be able to use it as a DIO input and measure pulses/per second.

I'm impressed with all this little device can do.  Put me on the order list for a 7.2 when you have them.

10 (edited by cubic_nz 16-12-2018 05:59:05)

Re: Problem with canny 5.2 can gateway

vmoses wrote:

Works perfectly.

This may be a little off topic for this thread, but is there anyone in the community who has played with older Audi vehicles?  In particular I'm interested in the properties of the GALA wire, which is also known as the V-speed wire.  Is transmits the pulses from either an ABS sensor or a transmission speed sensor.

I'd like to be able to use it as a DIO input and measure pulses/per second.

I'm impressed with all this little device can do.  Put me on the order list for a 7.2 when you have them.

I am also interested in whether the Canny can perform a pulse frequency measurement function, as many older cars also use this method for speed signalling.  It could be useful for adapting dashboards and speed sensors that were not intended to work together.

11

Re: Problem with canny 5.2 can gateway

vmoses wrote:

I'd like to be able to use it as a DIO input and measure pulses/per second.

cubic_nz wrote:

I am also interested in whether the Canny can perform a pulse frequency measurement function...

CANNY 7.2 duo will handle it.
CANNY 7 can handle it now: http://wiki.cannylogic.com/index.php?ti … unter_mode
CANNY 5.2 duo can handle it now too: http://wiki.cannylogic.com/index.php?ti … _Registers
But CANNY 5.2 duo may work unstable with counters on high load, e.g. in CANGW mode.

See rough example for CANNY 5.2 duo below.

But please keep in mind, you may need to shift the electrical levels of the sensor signals for CANNY input with external level shifter.

Post's attachments

PPS.png, 71.35 kb, 767 x 262
PPS.png 71.35 kb, 373 downloads since 2018-12-16 

12

Re: Problem with canny 5.2 can gateway

It just depends on the electrical properties of the signal and the sensor attached, which will vary by vehicle. My old Audi runs off a transmission sensor that I think generates 8 pulses per transmission revolution but I'm not positive. it may also send a lighting signal on the same wire.  If I had a scope it would be easy to see what going on.  I don't, so I dropped the question in here.

Technically, the pulses are sending distance information and are used to drive the odometer first and then converted to speed and mapped to drive a stepper motor for the speedo.  I just want to sense the pulses, count them and generate a hex pulses per second to stick in a can message for my nav system.   

To translate transmission pulses to speed, you also have to know the differential ratio and the tire circumference, then do the math.  Newer cars store that conversion factor in the instrument cluster ecu and many allow the the tire circumference to be modified.  Most new cars also eliminate the transmission sensor and just pick up pulses from one of the ABS wheel sensors, which eliminates the need to know the differential ratio.

13

Re: Problem with canny 5.2 can gateway

The diagram K posted above looks very much like the one I've written but there are some interesting differences.  K's logic is always very good so I'll see what I can learn from it.

14

Re: Problem with canny 5.2 can gateway

Here's what I had.  I didn't use the built-in counter but I think the result should be the same.  I have no idea which would be the most efficient.

Post's attachments

Attachment icon Example.png 34.05 kb, 163 downloads since 2018-12-16 

15

Re: Problem with canny 5.2 can gateway

Here's what I had.

The most important difference between my and your diagrams is in the using Async Counter mode of input channel.
If you don't use it, you may and will miss certain pulses then the pulse frequency is higher than diagram can process. The diagram can sample channel's state in normal mode only synchronously, once per a running loop (1~20 ms depends on diagram size): http://wiki.cannylogic.com/index.php?ti … tion_order
If the channel's input states changed twice or more times between this samples, you will never know about this pulse(s).
In Async Counter mode, driver collect all the pulses much faster and in background, regardless of the diagram execution loop and store the pulse count in a special register for you.

16

Re: Problem with canny 5.2 can gateway

Thank you.  Based on how I think the speed wire in my car works, I'd start losing pulses at around 20 mph?

17

Re: Problem with canny 5.2 can gateway

It depends on the width of the pulses. Quite short pulses can be lost at any speed.

Post's attachments

pulses.png, 7.12 kb, 757 x 381
pulses.png 7.12 kb, 357 downloads since 2018-12-18 

18

Re: Problem with canny 5.2 can gateway

After bench testing the logic, I finally installed the Canny5.2  in my old Audi.  I'm isolating the
instrument cluster on the infotainment bus (100k FT), so I put the cluster on Can1 and set as FT.  The rest of the car is on Can0 (Radio/Nav, Phone and and Audi gateway).

The only things I'm trying to do at this point are (1) switch the ID for the ignition message and (2) add the reverse signal to the speed message.

It didn't go well.  I will try to do some monitoring in the car later today or tomorrow, but the Can0 side is not playing well with the rest of the vehicle.  It appears to be dragging the bus way down .  Radio cycles on and off.  Steering wheel buttons get through only occasionally. Phone powers up but doesn't execute  pairing cycle. The phone and steering wheel signals don't even go through the Canny.   I suspect it is either the Canny isn't fast enough  or more likely that it is just creating problems for the FT on Can0.. Any suggestions?

If I'm right one suggestion for the 7.2 may be to allow both can ports to be set as fault tolerant.   

I'm sure it will get sorted out so all that aside....Happy New Year to everyone watching.

19

Re: Problem with canny 5.2 can gateway

Did you use the built in gateway function, or build a gateway with logic blocks?  I've used the 5.2 with the built in gateway function on the 500k networks for both the body and the transmission in my Toyotas and had no issues with speed. 

I did initially build the gateway from scratch using logic blocks, though, and that was a very different story!

20

Re: Problem with canny 5.2 can gateway

I  am using the gateway function  with some very simple additional logic.  I change the ID for one message and use the 12v line from my back up lights  on the ADC port to add reverse information to one other message.  I agree that speed is probably not the problem.  My logic file is attached.

My 2001 Audi has three networks.  The powertrain network is just like your car, 500k standard CAN.  The other two are 100k fault tolerant networks.  Without going into a lot of detail, those networks are idesigned so that if one wire is lost the network will continue to function.  The signal levels utilized are different than standard.

Post's attachments

Attachment icon canny test 2adc.cfd 2.76 kb, 246 downloads since 2018-12-29 

21

Re: Problem with canny 5.2 can gateway

I like the way you have used comment boxes to divide up your diagram, I might look at doing that in future!

Using the ADC to read the digital input from the reverse lights seems an odd choice.  Why not just treat this as a digital input?

I'm also not sure about setting the gateway configuration update permanently to 1.  I've always thought this needed to be pulsed, as the wiki page says it "must be shortly set".  I'd be interested to get confirmation from Konstantin on this.

I'd suggest pulsing the gateway update via a rising edge detector and see if that makes a difference.

Post's attachments

Attachment icon canny test 2no adc.cfd 2.79 kb, 267 downloads since 2018-12-29 

22

Re: Problem with canny 5.2 can gateway

Colleagues, it seems that there must be an inversion before Sleep Mode register. Without it, your diagram is constantly trying to fall asleep.

cubic_nz
The perfect advice! Also, you can do without updating the CAN GW settings when it is not necessary.

Post's attachments

Attachment icon canny test 2no adc no pwm.cfd 2.82 kb, 257 downloads since 2018-12-30 

23

Re: Problem with canny 5.2 can gateway

Thanks everyone.  I really appreciate the help. and will take your suggestions.

For the reverse signal I originally tried using leading edge detection on  channel 8, but since my backup light signal goes open instead of to ground when i'm not  in reverse....the pull-up resistor kept it from working.  Channel 10 doesn't have a resistor so it may work there.   The ADC approach may have been slower but it was very simple to code and it did work, so I don't thinks that's the reason the rest of the bus is being jammed up.

I didn't notice the unit trying to go sleep when i was bench testing it.  It did when I pulled the can input, which was what I expected. but this could well be the problem.

I'll retry and see what happens.Thanks again.

24

Re: Problem with canny 5.2 can gateway

Using an ADC can be justified in your case and will not noticeably affect the controller's speed.

You have set the  "CAN GW Selector 0 Linked CAN IF" = 1, and "CAN GW Selector 1 Linked CAN IF" = 1. This means that messages going in the direction from panel (CAN1) to car (CAN0) will changed. It is correct?

As for CANNY 5.2 duo and FT-CAN: When the CANNY is connected to the FT-CAN network of two or more FT-CAN devices, it is not necessary to switch on the transmitter mode. So, you can safe connect CAN0 interface to car network. When the CANNY is connected to a single CAN-FT device, you must to enable FT-CAN mode of CANNY CAN interface for for proper CAN Sleep Mode functioning. You can enable FT-CAN mode only on the CAN1 interface. So your hardware configuration when the car is connected to the CAN0 and the panel to the CAN1 is correct. CANNY 5.2 duo  are widely and successfully used on VAG with 100k FT-CAN. The situation you described with inadequate car equipment behaviour is typical for improper connection or a faulty on-board CAN network. I am sure that you will be able to resolve this issue. You can count on our help.

Post's attachments

Attachment icon canny test 2adc-3.cfd 3.1 kb, 244 downloads since 2018-12-30 

25 (edited by cubic_nz 31-12-2018 03:56:09)

Re: Problem with canny 5.2 can gateway

So it is confirmed that we cannot leave the gateway update permanently set to 1?  What happens (in simple terms) if we do this?

Also, I like the use of the buffer to detect the change of state, I have used RED and FED for this purpose in the past, but the buffer method could be used for more than just digital signals.  I will remember this one!