hmm. a quick search show that the function seems to be in motion.c, no mention however in motion.h.
the best is probably to pop into irc and ask the devs, or maybe the mailinglist.
Henrik
yngndrw,
I know some ozzie guys are currently testing a Mach plug in which they hope to release soon, not sure if they are going to release the code as open source.
henrikw,
I'll endevour to post the code, makefile, hal, pycvp over the weekend. Work is really really crazy at the moment with Christmas. There is still a bit of tidy up work to do on the code.
I'm trying to figure out how to use rtapi_print_msg to get messages into Axis but cannot figure out the header file needed for emc_message_handler. Any ideas??
Scott
hmm. a quick search show that the function seems to be in motion.c, no mention however in motion.h.
the best is probably to pop into irc and ask the devs, or maybe the mailinglist.
Henrik
Henrik,
Thanks for that. I'll try adding to the includes. I think that the comms error is in my interpretation of the return message from the vfd. Now that I am sending and receiving a lot of data to and from the drive it is not to easy to debug. If I can just send some messages into Axis then I might be able to track it down.
Scott
Can you not just log everything to a file ?
For example keep appending the following format to a file:
Code:[Description from code]: [Sent HEX] = [Received HEX]
Ok guys here it is. The following two archives contain the HAL component and the EMC2 config files.
Still trying to figure out why I'm getting comms errors but I'm starting to think that while the drive is running the processor is busy and not receiving all of the modbus requests. As soon as the drive is stopped the comms comes good again....
(next post will have the archives - need to convert them to zip, so back over to my windoz machine...)
Scott
Plese, these are beta files and any testing feedback will be much appreciated. You will need dev packages installed to compile. Lots of documentation still to do.
Scott
I'm curious to know how people are implementing an E-Stop with the drive, dropping the supply is the easiest, but not the most elegant. The external inputs don't seem to be active when under Modbus control.
Scott
You mean braking? I think there has been some effort here: http://www.woodworkforums.com/f170/t...d-users-96380/
It seems some of the internal hardware is missing..
Henrik
Last edited by henrikw; 12-16-2009 at 09:46 AM.
I think he means that one of the adjustable inputs may be configured as an emergency stop input. (Like the Mach 3 emergency stop.)
If you set PD001 to 2 it allows commands to be sent via Modbus, however this disables receiving commands from the multi-input terminals. I'm not sure if emergency stop is actually disabled so you should test it.
The external braking resistor is not needed for these spindles and VFDs as the internal one is fine for our use. It is simply there to stop the DC bus voltage from rising too much when stopping, but these spindles have very little rotating mass when compared to a large conveyor or dairy separator.
I was referring to the VFD processor. It seems to get busy and ignore the Modbus commands. I have modified my c code to resend the command if a comms error occurs.
I did play around with the mult input terminals. You can program one to be an emergency stop input but it does seem to get disabled when the the source of control commands it set to RS485.
Scott
I have all hardware and installed all soft to control the spindle through emc2 v2.4.1.
The colour of modbus communication led is red, and there is nothing happening when i'm trying to launch spindle.
I use HEXIN rs232/rs485 adapter, connected to serial com2-port (because com1 is broken).
How can i debug this construction to find the fault?
Thanks!
Hello.
My converter: http://www.hexin-technology.com/RS-2...oduct-257.html
Same problem appeared http://www.machsupport.com/forum/ind...c,14182.30.htm
message by bolingerbe for 15 april 2010
For data cable i use twisted shielded pair with 120 ohm resistors on both ends. Also I have connected ACM pin <-> shield of wire <-> cpu-case, to equalize potentials. Am I right?
Maybe main problem in that chinese converter. Can you give me model name of your converter?
I have a log from your hy_vfd:
Starting EMC2...
spindle-vfd: device='/dev/ttyS0', baud=9600, bits=8, parity='none', stopbits=1, address=1, verbose=1, PID=4837
Opening /dev/ttyS0 at 9600 bauds (none)
read_data: reading setup parameters:
query_length = 6
Modbus query = [01][01][03][04][00][00][7D][8F]
query_ret = 8
response_length_computed = 8
waiting for message (8 bytes)...
length to read = 8
read return = [01] bytes
msg_length = [01]
characters received =[00]
message was incomplete, length still to read = [07]
read return = [07] bytes
msg_length = [08]
characters received =[FF][78][0F][00][00][00][00]
ERROR invalid crc received 0 - crc_calc 3CAC (-16)
crc check = -16
read_setup: FAILED
query_length = 4
Modbus query = [01][04][01][00][41][89]
query_ret = 6
response_length_computed = 8
waiting for message (8 bytes)...
length to read = 8
read return = [02] bytes
msg_length = [02]
characters received =[80][00]
message was incomplete, length still to read = [06]
WAIT_DATA(): comms time out
ERROR Communication time out (-12)
read_data: FAILED
query_length = 4
Modbus query = [01][03][01][00][F0][48]
query_ret = 6
response_length_computed = 6
waiting for message (6 bytes)...
length to read = 6
read return = [03] bytes
msg_length = [03]
characters received =[FF][F8][00]
message was incomplete, length still to read = [03]
WAIT_DATA(): comms time out
ERROR Communication time out (-12)
write_data: FAILED
query_length = 4
Modbus query = [01][04][01][00][41][89]
query_ret = 6
response_length_computed = 8
waiting for message (8 bytes)...
length to read = 8
read return = [01] bytes
msg_length = [01]
characters received =[00]
message was incomplete, length still to read = [07]
WAIT_DATA(): comms time out
ERROR Communication time out (-12)
read_data: FAILED
query_length = 4
Modbus query = [01][03][01][00][F0][48]
query_ret = 6
response_length_computed = 6
waiting for message (6 bytes)...
length to read = 6
read return = [03] bytes
msg_length = [03]
characters received =[FF][F8][00]
message was incomplete, length still to read = [03]
WAIT_DATA(): comms time out
ERROR Communication time out (-12)
write_data: FAILED
query_length = 4
Modbus query = [01][04][01][00][41][89]
query_ret = 6
response_length_computed = 8
waiting for message (8 bytes)...
length to read = 8
read return = [01] bytes
msg_length = [01]
characters received =[00]
message was incomplete, length still to read = [07]
WAIT_DATA(): comms time out
ERROR Communication time out (-12)
read_data: FAILED
query_length = 4
Modbus query = [01][03][01][00][F0][48]
query_ret = 6
response_length_computed = 6
waiting for message (6 bytes)...
length to read = 6
read return = [03] bytes
msg_length = [03]
characters received =[FF][F8][00]
message was incomplete, length still to read = [03]
WAIT_DATA(): comms time out
ERROR Communication time out (-12)
write_data: FAILED
query_length = 4
Modbus query = [01][04][01][00][41][89]
query_ret = 6
response_length_computed = 8
waiting for message (8 bytes)...
length to read = 8
read return = [01] bytes
msg_length = [01]
characters received =[00]
message was incomplete, length still to read = [07]
WAIT_DATA(): comms time out
ERROR Communication time out (-12)
read_data: FAILED
query_length = 4
Modbus query = [01][03][01][00][F0][48]
query_ret = 6
response_length_computed = 6
waiting for message (6 bytes)...
length to read = 6
read return = [03] bytes
msg_length = [03]
characters received =[FF][F8][00]
message was incomplete, length still to read = [03]
WAIT_DATA(): comms time out
ERROR Communication time out (-12)
write_data: FAILED
query_length = 4
Modbus query = [01][04][01][00][41][89]
query_ret = 6
response_length_computed = 8
waiting for message (8 bytes)...
length to read = 8
read return = [01] bytes
msg_length = [01]
characters received =[00]
message was incomplete, length still to read = [07]
WAIT_DATA(): comms time out
ERROR Communication time out (-12)
read_data: FAILED
query_length = 4
Modbus query = [01][03][01][00][F0][48]
query_ret = 6
response_length_computed = 6
waiting for message (6 bytes)...
length to read = 6
read return = [03] bytes
msg_length = [03]
characters received =[FF][F8][00]
message was incomplete, length still to read = [03]
WAIT_DATA(): comms time out
ERROR Communication time out (-12)
write_data: FAILED
query_length = 4
Modbus query = [01][04][01][00][41][89]
query_ret = 6
response_length_computed = 8
waiting for message (8 bytes)...
length to read = 8
read return = [01] bytes
msg_length = [01]
characters received =[00]
message was incomplete, length still to read = [07]
WAIT_DATA(): comms time out
ERROR Communication time out (-12)
read_data: FAILED
query_length = 4
Modbus query = [01][03][01][00][F0][48]
query_ret = 6
response_length_computed = 6
waiting for message (6 bytes)...
length to read = 6
read return = [03] bytes
msg_length = [03]
characters received =[FF][F8][00]
message was incomplete, length still to read = [03]
Traceback (most recent call last):
File "/usr/bin/axis", line 4062, in <module>
o.mainloop()
File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 1026, in mainloop
self.tk.mainloop(n)
File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 1401, in __call__
def __call__(self, *args):
KeyboardInterrupt
Shutting down and cleaning up EMC2...
Cleanup done
Also I have tried SpindleTalker and other data-serial utilites and no success.
Thank for attention!
Originally Posted by scotta
Taras,
Please check your config files:
Starting EMC2...
spindle-vfd: device='/dev/ttyS0', baud=9600, bits=8, parity='none', stopbits=1, address=1, verbose=1, PID=4837
Opening /dev/ttyS0 at 9600 bauds (none)
You said you were using COM2 as COM1 was broken. If you are using my config file it is setup for COM1 ie device='/dev/ttyS0'
Scott
Taras,
In custom.hal you probably have
# Load the Huanyang VFD user component
loadusr -Wn spindle-vfd hy_vfd -n spindle-vfd
which is my setup which uses the hard coded default settings, see hy_vfd.c at line 515:
// assume that nothing is specified on the command line
baud = 19200;
bits = 8;
stopbits = 1;
debug = TRUE;
device = "/dev/ttyS0";
parity = "none";
slave = 1;
You can change this by adding command line options in custom.hal in the loadusr command
-d or --device <path> (default /dev/ttyS0) Set the name of the serial device node to use
eg for COM2 (need to check the tty dev on your actual computer)
loadusr -Wn spindle-vfd hy_vfd -n spindle-vfd -d /dev/ttyS1
Hope this helps.
Scott
Much time has passed since I wrote you the first message.
I've tried to launch on another computer with correct com-ports, different parameters in custom.hal (random speeds and ports, data-structures etc.) Serial ports are working correctly, I checked them with the help of a modem.
All that I can so is to buy another converter, the same as yours, and if this fails, then the problem in the VFD (absence of any hardware components).
Thanks!
Taras,
Don't get discouraged. I too had a lot of problems trying to get the comms up and going, and seems that a lot of people are as well. A few steps that may help:
1. Do not rely on the labelling of the RS485 converter, make your own measurements.
"Matching the potential of the terminals (relative to ground) was the key, ignoring the labelling. A [+5V] --> RS+ [+5V], B [0V] --> RS- [0V] and Ground -> ACM."
Get your multi-meter and make some measurements of your converter when it is plugged in to your comm port but without and cable attached. Check the voltage between ground (Pin 5) and Data - and Data + (Pins 1 and 2). One of the pins will be +ve and one will be -ve relative to the gound. Then wire the two +ves and two -ves together. Also connect the grounds - Pin 5 and the ACM terminal on the drive.
Note: The ACM terminal is the ground for the logic inputs for the drive and is not connected to the general ground of the drive.
So match all three potentials on the comms, +ve, -ve AND ground!
2. If you can, grab a second computer and RS485 adaptor and daisy chain the computers and VFD on the RS485 network. You will then be able to monitor the comms on the second computer. This is great for being able to verify that the comms is actually working and being spat out of EMC2
3. OK, knowing that the comms is working then make sure that the VFD comms is correctly configured
Be patient, you will get it working.
Scott
Hello, Scotta.
Sorry for my English.
At last your component succesfully began working with my huanyang "master kit"
The main problem was the lack of 75176B DIFFERENTIAL BUS TRANSCEIVER (http://www.alldatasheet.com/datashee...TI/75176B.html). There are men that struggling with this VFD. (http://www.machsupport.com/forum/ind...opic=14182.130)
I bought chip for 0.5$ and soldered it on the empty seat. After that everything worked from the first attempt, like an old swiss clock.
Using the hy_vfd (first look):
1. When I type S1000M3, spindle runs at the 7999 RPM and other with this proportion. How can I fix this?
2. There is some small delay among the F9 pressing and the START/STOP of the spindle. (it is unnecessary)
3. The minimum speed for my spindle is ~ 4000-5000, but component minimum is 7900. How can I expand the range?
4. F11/F12 keys that controls the speed of spindle. But when I'm pressing the F12 key couple times (3-4) the speed is not increasing, after 4-5 times everything all right with it and the VFD increases/decreases speed after each key pressing.
Thanks for good component!
Taras,
Great to hear that you figured it out. Great that they left the component of the circuit board.
I'll need to check my vfd settings. Not sure why your output is not as it should.
Regards
Scott