CanBus for Beginners - Super Simple

What module have you got? The CS pin 9 or 10 catch’s most people out when it’s not working.

They ones at the very top of this thread are in my opinion the easiest to use and definitely fast enough for tractors.

Lately we are trying some different types but they are the best if your still working it out.

A Module like this. i’m probably going to buy a shield so i don’t have to deal with wiring etc.
My Connections is:

VCC-5V
GND-GND
CS-PIN10
SO-PIN12
SI-PIN11
SCK-PIN13
INT-PIN2

Maybe you spot a wrong Connection.

Looks ok, and you have the correct clock speed set 8mhz or 16mhz

Yes 8mhz but cant get it to work Properly

I just test your wiring, loaded the “show all messages” but change the 16mhz at top of Arduino program to 8mhz and it all works fine.

So maybe it that’s what you have done it might be faulty. It’s really easy when you have two and talk to each other on the bench.

1 Like

Yes, thats why im going to buy 2 Modules and test them on the bench.

1 Like

Did some progress today with a virtual test setup, files here: GitHub - jkonno/AOG-virtual-testing

It’s very raw and unfinished, but already running. So I’m imitating a couple of CAN sensors, the PVEA-CI valve and a rudimentary steering cylinder. This will allow me to run the “tractor” on the python code and hook up the Teensy board that’s actually running the AOG code on the desktop. Just need to add a routine for the steering geometry to close the loop to the wheel angle sensor. Here some screenies from the test program, first it runs some random angles for the SASAIID steering wheel angle sensor and sends out the traffic to CAN, then the same thing for the WAS. Next, it’s waiting for user input so when I’m manually sending the valve flow command to bus, it gets parsed, converted to flow value and ultimately to piston movement, in the code it’s just advancing with a fixed timestep of 0.1 sec.

image

image

4 Likes

And now with the steering rack added, takes as input the pin, rod end and rack end positions to calculate the steering angle from cylinder displacement, this is for the right wheel so you’ll get the asymmetry as you get with the actual steering. It also picks the angle and sends the message back to CAN now. Git updated, also added a 20 Hz loop so the “steering” runs in the background in the demo.

image

I have done Project one succesfully. Project two i can’t do because a don’t have a autosteer-ready tractor. So i used the Show_All_CAN_Messages.ino to read the canbus of my Fendt 926 gen3. Now the problem is that i can read the G-bus, but not the K-bus. If i connect can_low left and can_high right on the K-bus the screen of the tractor gives the message ‘Can-bus shut off’ and the software from the tractor reboots. So i tested voltage and had negative right and positive left. (In the manual it is the other way around.) Then i connected Can_low right and Can_high left, but that gave no can-messages.
Can someone tell me what’s wrong?

Diagram for Arduino nano and mcp2515 8 mhz
CanBus Nano Diagram

3 Likes

The virtual test setup is alive - now true hardware in the loop. Need to do some tidying up, teensy is running modified ino to read was from can and send commands to pvea-ci valve.

4 Likes

Successful day yesterday trailing shoe tanking on steep ground with AOG via teensy can bus doing a brilliant job of following the line as can be seen on the video. No gaps. No overlap.

9 Likes

…and here, operating the go and end buttons via can bus , for section control.

Wiggly first two runs driven manually. I couldn’t find the picker view for creating AB lines!:see_no_evil:

5 Likes

Section controlling the tanker is more a proof of concept. In reality it’s unnecessary and OTT for the tanker. Manual operation with work switch actuated by the go and end buttons would be better. Easy enough to implement with only a few lines of code.
Steer is direct AOG steerAngleSetPoint sent to the Fendt steer angle. Requires taming of the AOG settings but works quite well. I did implement another method on 4.3.10 with the arduino setup. Running a steer variable that was sent to the fendt. This variable was then incremented or decremented by the AOG pwmDrive value. Unfortunately I’m really struggling to re implement this and can’t understand why!! There are some volatile interactions with WAS reading, steer variable and variable types that my head is struggling with!! :dizzy_face:

The beauty of this type of installation is it can all be easily packaged within the radius of the antenna ground plane and plugged into the fendt via a single plug, with just USB or Ethernet to the tablet. Neat.

4 Likes

Hello nice work?
So what is your Basic Configuration?
Was your Tractor before GPS prepared with Valve Block and so on? What have you done? Put GPS Signal to Tractor? Telling the Tractor where to drive? Is it not Normally locked by the OEM that the Feature does not work if you dont buy it?
Would be cool when you explain a little bit.

Regards

1 Like

Steer ready Fendt 724.

Basically just sending a steer angle to the tractor and reading when to activate steer and when it cuts out due to steering wheel movement etc.

Reading this topic from the very start, @CommonRail describes in detail, with working examples, how it is implemented.

Hei, I will read it. Is it in General for every Tractor possible? I have a Deutz Fahr with the Steuer ready Equipment.
Regards, Peter

1 Like

I’m 99.9% sure it will work on a Deutz, if you get yourself the parts listed in the very first post I can help make it go in the Deutz.

It works like the Massy / Valtra ones so Project 3, (Post 56) is what you want to build.

Hello, sounds promissing :+1:
I order the components and will contact you after that, mean while i read through the forum.
Where are you from?

Regards Peter

I’m also going to try it on a Deutz, but both of my boards aren’t here yet.