Crane controller

Bildschirmfoto 2014-08-08 um 13.16.02
Playing with development boards, some cool displays and stepper motors is always fun, of course. But what’s even nicer is controlling a real mechanical hardware thing. Like in my case, a hydraulic crane for forest work.

The concept of this project was to change or modify the old manual hydraulic valve box so that you can use joysticks to control the crane from the tractors cab. By moving the hand gear of each valve with a small but very strong servo motor, it was possible to control the crane from a distant position and over from the cabin.

Bildschirmfoto 2014-10-30 um 21.55.16

In this block diagram you can see the two parts of the controlling system. On the left there is the KranPower part which houses the microcontroller (Arduino ProMini), 6 of the shelf StepDown converter modules for 6 servo motors, 6 current shunts (INA138) plus a 8ch ADC (MCP3008) for measuring the current consumed by each servo, a johnson counter (74HC4017) for generating the PWM signal for the servos, RS422 transmitter (AM26LS31) and a Relay for shutting down a main valve in case of an emergency.
On the right side you can see the KranControl unit with a RS422 receiver (AM26LS32), a 1,8 inch TFT display, 2 three axes joysticks with buttons and a emergency switch.
The two parts are connected via a DVI cable, which is used because it is made for transmitting differential signals as I do with my SPI signal. This is necessary in the first place because it is just not possible to transmit a SPI signal with up to 4 MHz clock speed over 10 meters with steep enough edges. The cable length in combined with transmition speed is the problem. As I can’t decrease any of those two factors, I had to convert the SPI signals to a differential pair which is more or less described with RS422 and convert it back to a standard SPI right before I use the signal for the TFT display.

The Software for this project was written in C/C++ for an Arduino pro mini. Most of selected components are off the shelf parts so it was not to hard to find some easy to use libraries. One interesting part was the Display updating routine, as all of rendering runs in the main loop as well as the servo updating. To ensure smooth movements of the crane, the update rate must stay at least at about 20 fps (frames per second / servo updates per second).

Bildschirmfoto 2014-12-13 um 18.14.30

The picture on the right should show you how to update the pixels efficient so that you can achieve a significant speed boost. The first bar shows 3 green pixels out of 6 pixels total. If we want to update this bar to look like the second, we can write some simple for loop to print 6 new pixels. The second bar shows 6 new pixels, but as you can see at the third bar we only need to update 1 pixel to get the same result.
The code for that kind of update routine needs at least 10 times the effort to write and debug your code, but results in a performance boost of times 4. So we can achieve a update rate of 30 – 50 fps. The this simple routine as shown before we could at maximum get 8 – 13 fps.

You can find all the hardware designs, C/C++ code and a Power Point presentation on github and the links down below.

GitHub: KranSteuerung
Eagle files: KranPower / KranControl


Ein Kommentar

  1. Pingback: Crane controller UPDATE | DebuggingLab

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

Du kommentierst mit Deinem Abmelden /  Ändern )

Google Foto

Du kommentierst mit Deinem Google-Konto. Abmelden /  Ändern )


Du kommentierst mit Deinem Twitter-Konto. Abmelden /  Ändern )


Du kommentierst mit Deinem Facebook-Konto. Abmelden /  Ändern )

Verbinde mit %s