rs485 huanyang speed control

More
10 years 4 months ago #75861 by sw3Dp
Replied by sw3Dp on topic rs485 huanyang speed control
I keep thinking there must be a typo somewhere but don't see it and the errors make me think I haven't got linux on the pc correctly using a live debian-wheezy would doing an dual boot install load differently? Going to run a cat5 to the garage see if that triggers something (then I'm just going to flap my wings and see if that helps.)

When the dongle is unplugged /dev/ is empty
halrun
loadusr -W -g hy_vfd -d /dev/ttyUSB0

loadusr: invalid option -- 'g'

then tried
loadusr -W hy_vfd -d/dev/ttyUSB0

open: permission denied
ERROR Can't open the device /dev/ttyUSB0 (errno 13)


here is boot log from linuxcnc 2.7, see error msg

RUN_IN_PLACE=no
LINUXCNC_DIR=
LINUXCNC_BIN_DIR=/usr/bin
LINUXCNC_TCL_DIR=/usr/lib/tcltk/linuxcnc
LINUXCNC_SCRIPT_DIR=
LINUXCNC_RTLIB_DIR=/usr/realtime-3.4-9-rtai-686-pae/modules/linuxcnc
LINUXCNC_CONFIG_DIR=
LINUXCNC_LANG_DIR=/usr/share/linuxcnc/tcl/msgs
INIVAR=inivar
HALCMD=halcmd
LINUXCNC_EMCSH=/usr/bin/wish8.5
LINUXCNC - 2.7.0
Machine configuration directory is '/home/user/linuxcnc/configs/sw3Dp'
Machine configuration file is 'sw3Dp.ini'
INIFILE=/home/user/linuxcnc/configs/sw3Dp/sw3Dp.ini
PARAMETER_FILE=linuxcnc.var
TASK=milltask
HALUI=halui
DISPLAY=axis
Starting LinuxCNC...
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting LinuxCNC IO program: io
Starting HAL User Interface program: halui
Found file(REL): ./sw3Dp.hal
Found file(REL): ./custom.hal
ERROR Can't open the device /dev/ttyUSB0 (errno 22)
vfd: ERROR: couldn't open serial device
Shutting down and cleaning up LinuxCNC...
Killing task linuxcncsvr, PID=443
5
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments

Debug file information:
open: Permission denied
./custom.hal:4: waitpid failed hy_vfd vfd
./custom.hal:4: hy_vfd exited without becoming ready
4435
PID TTY STAT TIME COMMAND
Stopping realtime threads

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

More
10 years 4 months ago #75863 by andypugh
Replied by andypugh on topic rs485 huanyang speed control

sw3Dp wrote: loadusr -W -g hy_vfd -d /dev/ttyUSB0
loadusr: invalid option -- 'g'

Odd, the manpage says that works. But never mind.

loadusr -W hy_vfd -d/dev/ttyUSB0

open: permission denied
ERROR Can't open the device /dev/ttyUSB0 (errno 13)


Error code 13 (according to a Google search) is a permissions problem.

I wonder if you are running from a normal user account rather than an admin account?

Maybe try plugging in the dongle and
Code:
sudo chmod 666 /dev/ttyUSB0 halrun loadusr -W hy_vfd -d /dev/ttyUSB0 show pin exit

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

More
10 years 4 months ago #75864 by sw3Dp
Replied by sw3Dp on topic rs485 huanyang speed control
I think you may be right there seems to be a deficiency in my linux understanding user accounts will try working that ... in the meantime tried calling on the beast for help and it produced this

halcmd: show pin
Component Pins:
Owner Type Dir Value Name
5 float OUT 0 hy_vfd.ACV
5 float OUT 0 hy_vfd.CNST
5 bit OUT FALSE hy_vfd.CNST-bracking
5 bit OUT FALSE hy_vfd.CNST-command-rf
5 bit OUT FALSE hy_vfd.CNST-jog
5 bit OUT FALSE hy_vfd.CNST-jogging
5 bit OUT FALSE hy_vfd.CNST-run
5 bit OUT FALSE hy_vfd.CNST-running
5 bit OUT FALSE hy_vfd.CNST-running-rf
5 bit OUT FALSE hy_vfd.CNST-track-start
5 float OUT 0 hy_vfd.CNTR
5 float OUT 0 hy_vfd.Cont
5 float OUT 0 hy_vfd.DCV
5 float OUT 0 hy_vfd.OutA
5 float OUT 0 hy_vfd.OutF
5 float OUT 0 hy_vfd.Rott
5 float OUT 0 hy_vfd.SetF
5 float OUT 0 hy_vfd.Tmp
5 bit IN FALSE hy_vfd.enable
5 float OUT 0 hy_vfd.freq-lower-limit
5 float OUT 0 hy_vfd.frequency-command
5 bit OUT FALSE hy_vfd.hycomm-ok
5 float OUT 0 hy_vfd.max-freq
5 float OUT 0 hy_vfd.rated-motor-current
5 float OUT 0 hy_vfd.rated-motor-rev
5 float OUT 0 hy_vfd.rated-motor-voltage
5 float IN 0 hy_vfd.speed-command
5 bit OUT FALSE hy_vfd.spindle-at-speed
5 float IN 0.02 hy_vfd.spindle-at-speed-tolerance
5 bit IN FALSE hy_vfd.spindle-forward
5 bit IN FALSE hy_vfd.spindle-on
5 bit IN FALSE hy_vfd.spindle-reverse
5 float OUT 0 hy_vfd.spindle-speed-fb

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

More
10 years 4 months ago - 10 years 4 months ago #75870 by sw3Dp
Replied by sw3Dp on topic rs485 huanyang speed control
Thank you andypugh for chasing my tail with me, much ado about nothing!! Such an idiot to have avoided dual boot pc ... learning curves, (fingers must be fully extended when flapping wings.)

I had been just running off a live disc install, seems obvious now, that didn't give me permission to really use linuxcnc, explains a lot of glitches and miss steps, now I gots speed and accuracy. No doubt the root cause of why the g540 with relay wasn't controlling the spindle but I like the simplified wiring of the rs485, like you said 'all too easy' when done properly.

Just had to really install linux first, live disc is FUBAR, but it inspired me to find simplified wiring and hook the garage to network, no more thumb drives.
Last edit: 10 years 4 months ago by sw3Dp.

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

More
8 years 4 months ago #112942 by BrendaEM
Replied by BrendaEM on topic rs485 huanyang speed control
I am having issues with my Huanyang VFD and 24000RPM. It does not work. The usb device seems to be showing up.

I have a very custom .hal, but at a point, I decided that I would need to backup my original .hal and .ini create a new ones with stepconf if I wanted the controls to show up. I did that, and merged the new stuff into a copy of the old files.

Still, the custom controls showing in the example weren't showing. I figured out how to add the .xml in the [Display] section of Axis's settings, then I had the speed indicator on the right.

Though the motor will not turn on, and I don't have the + - speed selectors.
So it seems that perhaps I have to this all over again, making some spindle speed settings in stepconf, but will this fix my problem?

Because I don't know RS485 is actually doing, I have no idea what to put in for speed settings. I don't know what settings actually apply to RS485 spindle control. Is PWM sent over RS285 or digital data, or is the PWM a breakout terminal pin thing?

What I would like to have is spindle control on/off and RPM from perhaps 6000-24000.

It would really be helpful if I had a known-good .hal and .ini that I could fish through.

[I might look into whether or not the extra spindle controls could be pasted in Axis under the spindle on control. I am planning to use Nativecam, and well, the indicators are pretty, but they take up room.]

Any help would be appreciated : )
Thanks for reading this far,
Brenda

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

More
8 years 4 months ago #112943 by andypugh
Replied by andypugh on topic rs485 huanyang speed control
The + / - speed buttons are not configured by stepconf per. se. They appear when the GUI thinks that there is a spindle to control.

Are you using Axis?

I have this in my HAL, I think it was to fool Axis into believing I had a spindle brake

net dummy motion.spindle-brake

The "magic" is these lines here:
github.com/LinuxCNC/linuxcnc/blob/master...cripts/axis.py#L3980

If your HAL file contains any of the pins in the "forget" function positions 1 onwards then the control in position 0 is enabled.

You might want to consider if that is clever or stupid in your GUI... :-)
The following user(s) said Thank You: BrendaEM

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

Time to create page: 0.175 seconds
Powered by Kunena Forum