Close

RS485 works, board is fully tested

A project log for Open Concentrating PV Solar Tracker Controller

Achieve better than 0.1° sun tracking accuracy with a compass a tilt sensor and a shading beam sun sensor.

ruediger-f-loeckenhoffRuediger F. Loeckenhoff 09/24/2022 at 21:400 Comments

I almost lost my nerves trying to figure out the RS485. The task sounds simple. The field control should send a “Ping” to the tracker and the tracker should answer with “Pong” when it received the “Ping” correctly or with “Piep” if it didn’t get it. It didn’t work. The problem proved to be that with RS485 in half-duplex there must always be a device that controls the line. When the line is loose, a lot of gibberish is coming in. Once I understood that problem, I made sure that there is an overlap when both devices control the line. First, the field control asks the tracker for data and still controls the line to give the tracker time to react. The tracker also takes control of the line and for an overlap time no device tries to send data. When the tracker has waited long enough to be sure, that the field control has released the line, it sends the requested data string.

Now here is the printout from the "field control" that sent the traffic to my computer through the normal Arduino Serial port. It doesn’t look like much but it certainly took a lot of time.

Ready for a match!
Ping_Pong
Ping_Pong
Ping_Pong

Now the Ping can be a request to a certain tracker to send data. The Pong can be that data.

This is what the "Ping" looks like on the scope:

And this is the Ping_Pong where you can see some differences between the voltage levels of the two RS485 chips.

At the time of the trigger (middle of the screen) the field control holds the bus. Then, both RS485 chips control the bus together. Then the tracker controls the bus alone to sends its "Pong" and releases it after a short while to the field control again.

Now the present board is fully tested and working fine and I am waiting for the new tilt sensor as the last part missing. When this is working too, Ermanno can get the final version of the board ready to be produced by PCBWay, who offered to sponsor us in this way. Exciting! We are so close to a professional all in one board solution.

Discussions