ABB B23 Modbus RTU

CONCEPT MESSAGE.

Connecting to ABB B23 Modbus energymeter.

I have the USB-RS485 plugged into a Debian Linux pc system (x86_64). I used the ModPoll tool from modbusdriver.com for basic connection testing.

#./modpoll /dev/ttyUSB0 -b 9600 -p none -m rtu -a 1 -r 23296 -t 4:int -c 6
  • Offset addres 23296 (or hex 0x5B00) should have L1-N voltage.
  • Read 6 next values also (-c 6)
  • Gave me L-to-N and L-to-L voltages.

Wrote a small C application to poll every second and write to MariaDB/MySQL database table. Should be possible to recompile for Raspberry-PI (ARM) to.

Uses libmodbus(-dev) and libmariadbclient(-dev).

See attachments.

 

 

LM2576T-5 step down switching regulator

First switching power supply working.

I have an ARM board to be powered, which draws between 0.5 and 1.5 ampere’s on 5 volt. Tried using an standard 7805 (2 ampere spec), but the system would not boot. VOut dropped to 4.5 volts and 7805 was getting to hot with +/- 24 volt VIn.

So i made an circuit based on the LM2576T-5.

Partslist:

Part Price
IC1: LM2576T-5 € 1,60
L1: Inductor 100uH € 1,45
D1: SR504 Recoverd from PC PSU 5.0 Amps Schottky Barrier Rectifier
C1: 470uF 35v Reused from other project
C2: 3300uF 10v Also recovered from PC PSU
F1: Fuse holder and 400mA Stock, price n/a

lm2576t-5-schemaInput voltage is an battery+solar power supply that varies between 23-24 to 29 volts.

Working power supply (left) with active load.
img_20160925_184405_edit

Bad output: (spikes)
What happens if an normal (or to slow) diode is used:
Yellow is regulator V-OUT.
Blue line represents voltage output for load (feedback signal).

img_20160924_194739_edit

Good output:
No load:

noload

100mA load

100ma_load

 

Borrowed lm2576 library for Eagle PCB Design from eaglecentral.ca | LM2576 circuit

LinuxCNC 2.7 on Jessie

Running LinuxCNC on fresh Debian Jessie (8) install using custom compiled longterm kernel 4.1.15.

Start with a fresh install of Debian.

Most of the step can be done as a normal user. For apt-get and dpkg commands log in as root or use sudo.

Compile Kernel 4.1.15 with RT patch

With some help from https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO and http://www.cyberciti.biz/faq/debian-ubuntu-building-installing-a-custom-linux-kernel/ .

Install required tools

# apt-get install build-essential ncurses-dev fakeroot kernel-package

Extract kernel and patch

# mkdir /opt/kernel
# cd /opt/kernel
# wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.1.15.tar.xz
# wget https://www.kernel.org/pub/linux/kernel/projects/rt/4.1/patch-4.1.15-rt17.patch.gz
# tar xvf linux-4.1.15.tar.xz
# gzip --decompress patch-4.1.15-rt17.patch
# cd linux-4.1.15
# cat ../patch-4.1.15-rt17.patch | patch -p1

Copy current kernel config into this build

# cp /boot/config-$(uname -r) .config

Configure kernel

# make menuconfig
-> Processor type and features
-> -> Preemption Model (Fully Preemptible Kernel (RT))
-> -> Timer frequency (1000 HZ)
<Save>

menuconfig

Compile kernel

# make-kpkg clean
# fakeroot make-kpkg -j4 --initrd kernel_image kernel_headers

Where -j specifies number of cpu cores.
This might take a while and raise room temperature. 🙂

Installing kernel

Execute de following commands as root or use sudo.

# cd ..
# dpkg -i linux-headers-4.1.15-rt17-10.00.Custom_amd64.deb
# dpkg -i linux-image-4.1.15-rt17-10.00.Custom_amd64.deb
# shutdown -r now

Adding LinuxCNC repository to APT

I do not compile my own LinuxCNC, maybe later, for now i am using LinuxCNC APT archive.

Follow http://linuxcnc.org/docs/html/getting-started/getting-linuxcnc.html#_installing_on_debian_wheezy_with_preempt_rt_kernel

Run the following commands as user root or use sudo.

Add the LinuxCNC Archive Signing Key to your apt keyring:

# apt-key adv --keyserver hkp://keys.gnupg.net --recv-key 3cb9fd148f374fef

Now edit /etc/apt/sources.list and add the following line:

deb http://linuxcnc.org/ jessie base 2.7-uspace

and update aptitude.

# apt-get update

Now you can install LinuxCNC by using this line:

# apt-get install linuxcnc-uspace

Please let me know if i wrote something wrong.

ELO Intellitouch 2700 on Debian Jessie

Calibrating ELO IntelliTouch 2700 USB.

Not to hard to do, after finding the right solution 🙂

Get ‘xinput-calibrator’ from Debian repositories and follow its instructions.

# apt-get install xinput-calibrator

Selection_089_kleinIn your desktop envorinment there will be an menu item ‘Calibrate touchscreen’. Click it!

Your screen will turn white and asks to tap on the screen at pointed locations.

After some samples a terminal will show up with a xorg.conf sample config.

Open a new terminal.

# sudo mkdir /etc/X11/xorg.conf.d
# sudo vi /etc/X11/xorg.conf.d/99-calibration.conf
or
# sudo nano /etc/X11/xorg.conf.d/99-calibration.conf

Paste the sample config, save and reboot.

Omniksol-4k-TL wifi kit

Capture inverter data yourself? Or want to process generated data? Instead of using the Omnik Portal App?

I found out that it is possible to configure the wifi kit to send TCP/UDP packets to an remote server. After that i started googling around. With some minimal data i started write a small C program.

Some other related project on the internet:

  1. GitHub – Woutrrr / Omnik-Data-Logger | Language: Python | Found first
  2. GitHub – micromys / Omnik | Language: PHP
  3. GitHub – arjenv / omnikstatus | Language: C | Found after completing my own script 🙁

Those scripts are polling the inverter each few minutes. When my research started, i found out, by configuring the web interface, that Omnik also offers the possibility to push TCP or UDP packets to an specified server. With this enabled i started testing en developing.

Reading the message (which byte means what?) was based on the GitHub projects. So someone else did the hard work 😉

Getting started… (read on)
Lees verder