Hitachi WJ200 Setup

More
9 years 2 months ago #97581 by gjvander
Replied by gjvander on topic Hitachi WJ200 Setup
Andy,

Thanks for the response. I did try a few variation of device parameter, but all of them gave errors.

I will follow up with a post to show what I tried and what errors I got.

On the plus side, I have Classicladder talking to the WJ200 without errors. I can turn on the spindle and set speed with setp commands. Now I have to figure out how to connect to LCNC spindle logic.

Geo

Please Log in or Create an account to join the conversation.

More
9 years 2 months ago #97629 by andypugh
Replied by andypugh on topic Hitachi WJ200 Setup
It is important not to have spaces between device and = and the string

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago - 8 years 4 months ago #111461 by javelin
Replied by javelin on topic Hitachi WJ200 Setup
I am looking at the wj200 as well. If I understand this correctly the loadusr wj200 device="/dev/ttyUSB0" should work will it not? I know the Huanyang vfd drive is "hard coded" to ttyS0 but when using the usb 485 everyone uses ttyUSB0 for connection via the built in driver within lcnc.

I have been debating between going with another huanyang inverter after I blew mine up or upgrading it to the wj200. My problem is that I dont want to sink a lot of time into CL yet. At a later time I may come back to play with that part of lcnc more. It seems that most of the people here use the huanyang inverters for rs485 connections.
Last edit: 8 years 4 months ago by javelin.

Please Log in or Create an account to join the conversation.

More
8 years 3 months ago - 8 years 3 months ago #113537 by oro06
Replied by oro06 on topic Hitachi WJ200 Setup
i'm having same issue , eg unable to change default device value (even if source seems to have this implemented). i'm sure the wj200 is properly connected as
./modpoll -b9600 -d8 -s1 -pnone -r1 -c8 /dev/ttyUSB0 resturn correct value (50.00 Hz) in my case.

starting from base cd install , here what i did to compile the driver having changed the hard coded "/dev/tty0" with "/dev/ttyUSB0"

we need some aditionnal packages

needed packages (modbus-dev and linuxcnc-dev and git for the linuxcnc repo)
sudo apt-get install modbus-dev linuxcnc-dev git

#clone linuxcnc repo
mkdir dev
cd dev
git clone github.com/LinuxCNC/linuxcnc.git

cd linuxcnc/src/hal/user_comps/wj200_vfd

#some include and lib dirs need to be added manually so we need to generate .c from .comp
halcompile --preprocess wj200_vfd.comp
#now wj200_vfd.c is here you can edit it to change/test

#compile to have the cmd line
halcompile --compile wj200_vfd.com
#this will give an error but display the cmd line
#copy then paste it to a new cmd line

#change /tmp/xxxxxxx/wj200_vfd.c to ./wj200_vfd.c
#add at the end -I/usr/include/modbus because modbus.h include is in a subdir (this is a i)
#add -std=c99 because we got a for loop error
#add -lmodus because linker need it (this a L)

so the command should look something like this :
gcc -Os -g -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I/usr/include/i386-linux-gnu -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range -mhard-float -DRTAI=3 -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/usr/include/linuxcnc -Wframe-larger-than=2560 -URTAPI -U__MODULE__ -DULAPI -Os -o wj200_vfd ./wj200_vfd.c -Wl,-rpath,/lib -L/lib -llinuxcnchal -lmodbus
gcc -Os -g -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I/usr/include/i386-linux-gnu -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range -mhard-float -DRTAI=3 -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/usr/include/linuxcnc -Wframe-larger-than=2560 -URTAPI -U__MODULE__ -DULAPI -Os -o wj200_vfd ./wj200_vfd.c -Wl,-rpath,/lib -L/lib -llinuxcnchal -I/usr/include/modbus -std=c99 -lmodbus


#then you get a binary, it need to be moved to the proper place
#change owner
sudo chown root:root wj200_vfd
#change attributes
sudo chmod 755 wj200_vdf
#save original
sudo mv /usr/bin/wj200_vfd /usr/bin/wj200_vfd.orig
#move the freshly compiled driver
sudo mv wj200_vfd /usr/bin/wj200_vfd

#then start linuxcnc for testing...
Last edit: 8 years 3 months ago by oro06. Reason: move file to proper place

Please Log in or Create an account to join the conversation.

More
8 years 3 months ago #113586 by oro06
Replied by oro06 on topic Hitachi WJ200 Setup
pull request github.com/LinuxCNC/linuxcnc/pull/457 pending
looking forward some feedback

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #154700 by andypugh
Replied by andypugh on topic Hitachi WJ200 Setup
I have just realised that the WJ200 driver uses a different style of module parameter passing.

To change the device you need:

loadusr wj200_vfd --device /dev/ttyUSB0

Other options are:
--baud
--parity
--stopbits
--databits
--device

Please Log in or Create an account to join the conversation.

Time to create page: 1.250 seconds
Powered by Kunena Forum