yes I get bldc.0.init-done in response to bldc.0.init
OK, you seem to have a 14 pole motor.
Do you see the motor twitch when you init?
It will be quite slight with a 14 pole motor
, but if I disable hm2_5i20.0.8i20.0.0.amp_enable it goes loose
That's good :-)
my problem is: increasing the hm2_5i20.0.8i20.0.0.current increases the holding torque, but doesn't cause rotation
of sourse I'm set to 6 poles
You definitely need 14 as the poles parameter
Then it might work. If it doesn't try a negative number in the scale parameter
Just to really confuse matters, you might also need to negate the PID Pgain.
now i have 11 positions!
There is probably something curious happening
Is the PID active?
yes, "net init-done bldc.0.init-done pid.0.enable 8i20.done"
kill that for now?
Yes. In fact to count poles, set the cfg=n in the loadrt line and comment out anything else bldc-related
(Not the PC, just Axis or HAL)
Are you in Axis or Halrun or something else?
I'm sourcing a script in halrun - want me to pastebin it?
That's the simplest way
OK, so, source your reduced script
show pin bldc* should show you a frequency pin?
[00:12:43] <mshaver> http://www.pastebin.ca/2004228
I think you might need to comment out everything except the loadrt and addf lines. What I am proposing is to run in dumb vfd mode at a tiny current to count the motor poles
ok, because with everything commented out I get no pole detents
let me see if I can enable the drive and dial in a little current in "n" mode
Actually, commenting out everything was perhaps a little too much. I think you still want the links between angle and current on bldc and 8i20.
However, what you have now will work
setp hm2_5i20.0.8i20.0.0.current 0.1
setp hm2_5i20.0.8i20.0.0.angle 0
setp hm2_5i20.0.8i20.0.0.enable 1
I did all but the angle and get 4 poles
or 4 positions
That's an 8 pole motor then.
ok, restoring the other stuff to try again!
So, set poles to 8, and uncomment the angle, enable and current links. Leave the rest out for the time being
ok, now I have 8 detents with poles=8
[00:29:11] <mshaver> http://pastebin.ca/2004237
- current 8i20.hal
initing the motor causes a small jog, maybe 30 degrees, then a return to the starting point and it's done
What do you get if you setp pid.0.in to 1?
then try switching the signs of bldc.0.scale and pid.0.Pgain
well, I have setp pid.0.maxoutput 1, so pid.0.output is limited to between 1 and -1 for any pid.0.command - is that what we want?
Yes, that sets the 8i20 driver to max or reverse max
[00:36:55] <andypugh> http://pastebin.ca/2004242
what I get is (perceptibly) larger holding torque and more audible squeal
Ought to at least make the motor spin
loading your pastebinned file
had to comment out setp bldc.0.scale 2000 in "n mode"
And probably poles too.
in fact: http://pastebin.ca/2004246]
OK, in "n mode" I have 4 detents
what happens if you setp frequency?
I went too far, need to uncomment line 33 :-)
ok, looking at this...
You know what I don't see? net bldc.0.out hm2_5i20.0.8i20.0.0.current
I might be missing it, but I don;t think you have a current input to the 8i20
I changed frequency (was 4) to 10 - no change
setp hm2_5i20.0.8i20.0.0.current 1
(Or net it to bldc, and set bldc.value)
changing the current changes the holding torque
what does frequency do?
Can you see bldc.0.rotor-angle changing?
what to look at?
If you set the frequency to (say) 0.5 you should see the rotor angle moving between 0 and 1 every 2 seconds,
yes, it is creeping in a positive direction about .1 every 10 seconds
yep, at .5 it is incrementing much faster
the motor shaft is stationary through
That's 2 wierd things then
The rotor angle should be moving smoothly between 0 and 1, then instantly back to 0, and then up again.
And the motor really should be following
that's what the number is doing
but not the motor
No, PID, and rotor_angle netted directly to the 8i20 angle input?
Can you put the halmeter on 8i20 angle and 8i20 current?
8i20 angle is a constant 0, current is .5
Looks like a flaw in the HAL wiring then
#net angle hm2_5i20.0.8i20.0.0.angle bldc.0.rotor-angle
this is commented out in the file i'm currently running
I suggest quickly entering it at the command promot
and the shaft turns!
I am doing this bit for 2 reasons, firstly to get a definite pole count, and secondly so you can at least see the motor spin
setp frequency to 1 and see how many seconds per turn, I guess 8
then setp 50 and watch it jump off the table
at freq=1 1 rot is about 5 secs
it's a little jerky
at freq=5 it's a little less than 1 rpm
at freq=10 the shaft rocks back and forth in one place
sorry, rps yes
servo thread period?
it's meant for 220vac rectified, plus we have the current limited
Try a little more current, but be careful as this mode is inefficient
In fact, the poor performance might be because we are in dumb VFD mode
ok, at current=2 i could get to freq=20
the leap to freq=50 didn't work
Time to go to proper commutation I think
i can get to 50 by 5's
Go to type q, put in the PID, make sure the bldc.0.out to 8i20 current link is there, and see how that goes.
should bldc.0.out be tied to current or frequency?
In any mode with a feedback you don't have the frequency pin.
just taking the time to fix up and save this working example...
If you get a squeel when the angle and torque are constant, you may need to detune the current loop somewhat
I am not sure we have a way to do that at the moment
(Unless you mean the EMC2 PID loop)
I wonder why I _have_ to load trivkins?
You should just get noise (like white noise) from Hall sensors
Heres how we dot it with a batch file where %1 is KP and %2 id KI
wpd kqp %1
wpd kdp %1
wpd kqi %2
wpd kdi %2
btw, this drive works really well, even in vfd mode
(don't tell Pete we are using VFD, it's all direct-field)
It really cant work well in VFD mode until we have voltage mode supported
Its constant current now like a step motor (if you dont have the rotor alignment and encoder feedback working)
I guess what I mean is: Compared to the Chinese brushless motor drives we are currently using, this one has the ability to be tweaked to perform well. It's not a "take it or leave it" deal.
Do put a plastic shield around the 8I20 when testing, we have blown up two (firmware bugs on one and driving a 120V desk lamp from 360V as brake on the other)
Now you tell me! So on the living room carpet under the TV is not the best place?
Well, how many Joules do your PS caps store? Quite a bang is possible
We did find the 120V bulbs quickly become shorts at 360 VDC
I have 1uF @ 70V (a lot less scary than the 2uF @ 700V my other motor drive had)
You should use proper 240V bulbs
Well we we using the lamp when experimenting with the brake at low voltage (very visible)
but forgot that is was still across the brake resistor when we did a full voltage test...
I am surprised it became a short, not OC
how do i git v2.4.6? i have v2.5.0-pre0
However, back to business
tom3p: 2.5 is better :-)
ok, i have faith :)
Short long enough to blow up the 8I20 (we had 900 uF of filter at 360V)
pcw_home: Just as a very simple loopback test to check the 7i64 input pins, is there a handy 5v anywhere on the board when it is cat5 powered?
Yes the 5V power terminals can be used (all 5Vs are common)
I was going to try 5V O1+ O1- I1+ I1- GND
7i64 would have saved skunkworks a lot of relay cards, I think
I think he has some AC ins and outs so for that IO module racks may be a better choice
We do a loopback to test the 7I64s (24X 10 Ohm loads with 24V looped back to the inputs) rotating 'on' test
(since we dont have enough current to power all 2.4A loads at once)
Couldn't you just wire them all in series with each other and one load?
Or is that what you mean
Does the general class GPIO include analogue?
I am trying to decide how to name the analogue inputs.
The drop for all in series might turn on in input
(To save linguistic friction I prefer to avoid using the word "analogue" or "analog")
Abbreviating to "anal" seems like a poor plan.
You know, I am not sure this question has arisen before, is this the first analogue input pin into a HAL driver
motion has analog inputs
it's not really a driver though
So, I'm back where I started I think. My current hal and pyvcp xml files are http://pastebin.ca/2004293
- When I dial in some input to pid.0.command, the pid.0.output, bldc.0.value, bldc.0.out, and hm2_5i20.0.8i20.0.0.current pins follow in lock step until 1.0 (or -1.0). I get 6 encoder counts or movement and 0.016 (+ or -) of rotor angle, and that's all.
negate the encoder scale
And/or the pid.Pgain
Electrical phase needs to "run away" from the rotor, and if the rotation sense of the rotor and encoder is different then they converge instead.
Right, that's 7i64 working in all senses.
I tried all 4 permutations of hm2_5i20.0.encoder.00.scale and Pgain - same basic results
3 days hardware to driver, I call that a good service :-)
did you mean bldc.0.scale?
mshaver: Err, sorry, I was unclear. Not _that_ encoder scale. The bldc.scale
i tried 2.4.6 and got "emcsvr: symbol lookup error: emcsvr: undefined symbol: _ZN15RCS_CMD_CHANNELC1EPFilPvP3CMSEPKcS6_S6_i"
then tried to go back to 2.5.0~pre, same message
do i need to wipe the dir ( i got a b/u)
same message on any of several startup menu choices
tom3p: Try a restart?
lsmod might be interesting, I suspect you might have orphan rtai modules loaded
lsmod shows no rt-blah, no emc-blah
I guessed wrongly then
what do you mean by 'restart'? restart linux?
It is the only way I know to unload stuck modules, though the evidence seems to point away from that being the problem
OK, so it runs and I can control the speed up to a point, but only in one direction.
You want both directions!
it won't go the other way
well, I had hoped
I might have fixed that
But I didn't know it was broken.
I put in an absolute-out for a specific kind of drive.
it also doesn't get up to the max speed
so, I need a new bldc.comp?
I am not sure, it all gets very confusing, as if you are not careful you flip the phase by 180 degrees and reverse the current at the same time, and end up going the same way.
A negative current into the 8i20 should reverse the motor
on accelerating, I have some "rough spots" as I go up in velocity
How are you trying to reverse the motor?
I have a pyvcp dial that is tied to pid.0.command - it's a float
do negative inputs give negative currents to the 8i20?
(and if not, is it the bldc comp that flips them?
hmm, I think, let me look
Any idea how fast you are getting?
when I go in the minus direction, everything is minus (pid.0.output, bldc.0.value, bldc.0.out, and hm2_5i20.0.8i20.0.0.current), in the plus dir it's all plus
I can only go minus, probably a few hundred rpms max
Negative current gives torque in the opposite direction (angle for 8I20 is always just rotor position)
sometimes I have to give the shaft a spin to get it started
I think that the homing is not working right
(was going to say as much)
It's probably worth working out what the encoder offset it.
Are you using 7.5 A to align the rotor to start?
I think he is using 0.2A.
Well that wont work...
I have "setp hm2_5i20.0.8i20.0.0.max_current 7.5"
(Sorry, that would be (0.2 * 7.5A)
This is a 1kW motor
But still, try bldc.initvalue 1
asymmetrical operation (forward and reverse not equal) almost guarantees that the rotor alignment is not working
big jump on init with that 1.0 initvalue
no change in operation
I would like to see it homing to index.
andypugh: this is the same bldc.comp that I have
I have an index pulse
Are you sure it is the same bldc.comp? Not that I can recall when I last changed it.
Anyway, they are not that different
the new file has an extra CR at the end (I use meld for a GUI diff util - I highly recommend it)
To find the index offset...
Motor zero is one of the places where the motor sits with +V on A phase and -V on B and C phase.
(Probably mark it with a pen)
You then need to set encoder-latch and turn the shaft until the encoder counts zeros.
Mine are U. V & W, but - do you mean get a dc supply and do this?
Then turn the shaft back to the zero point. (I guess if you reversed that sequence you would not need the marker pen). The encoder offset for bldc is the counts shown by an index-zeroed encoder when the motor is at the zerp position.
Suppose I was willing to hook up the Hall sensors?
Yes, current-limited DC supply. (It's a pain, but the only way to be sure with semi-smart drives)
That would be the best way.
I think that's what I should do - Is that what you are doing?
Having the halls wired lets you start at full torque from rest without any odd wiggles or funny sequences
My motor has no Hall sensors.
because they have a known alignment to the coils?
Homing to index should be just as good, but needs work to determine offset.
so you did the encoder offset procedure?
No, my motor is a pain it has a resolver
I am still trying to get it working properly. (I have used all the options with another smaller motor I have, with halls and encoder and index, so I have tested everyhting but only with one motor, and with an 7i39 not an 8i20)
All the motors (I think) we're going to use will have Hall sensors - I think I'll just get my boss to send me a 7i37 board (or make a Hall to RS-422 board)
You can probably wire the Halls direct to the 5i20. I do.
true - for test purposes anyway
You then have the fun of figuring out the hall pattern
One test to try though, simplify things some more.
comment out the PID
I'm really happy with the results we got today. I think I'm going to stop and take the time to hook up the Hall sensors and proceed from there.
Now set the bldc value to 1 and -1 and see how it runs.
(And check you are seeing -1 or 1 at the 8i20 too)
What's your 8i20 max current at the moment?
I removed the pid and just hooked the pyvcp dial to bldc.0.value
It takes off in the negative drection and runs jerkily (if at all) in the positive.
current setting tracks the dial
it's not oriented to the magnets - I think you all are right about that
it would be nice if the drive could be programmed to supply the current to hold the motor in a home position, then emc could be used to figure out the encoder offset somehow
I would be tempted to halscope the encoder angle during homing (triggering off of init). It ought to fly into lock, then rock +90, -90 and then back to 0 degrees. (or whatever that is in encoder counts)
That is sort-of what the alignment does now. It flips the field around to find the rotor then moves it back and forth, then takes an encoder reading.
It is entirely possible I have broken something.
Once you knew the number of counts from the index position, is this ever necessary again?
I could send you a motor
"it would be nice if the drive could be programmed to supply the current to hold the motor in a home position, then emc could be used to figure out the encoder offset somehow"
Thats supposed to be one of the startup modes
Yes, that is the mode we are using now. Though it seems to not be working
( and thats what we have done in testing)
mshaver: You are in cfg=q ?
mshaver: Sending a motor to the UK would be expensive.
well, these machines come all the way from China to begin with, so...
I know my boss Michelle is pretty jazzed about making this work, so who knows!
You could try guessing the encoder offset, for fun.
What this gives us is a 0- motor_max_rpm spindle drive with no belt changes
is there a command that you could send to the drive that says, "snap the rotor to home ans stay there"
Well belt changes will give you more torque at low speeds and higher speed capability
You know, I am not sure that we can home an 8i20 magnetically this way.....
yes just apply current with angle = 90 degrees (or -90 not sure off hand)
true, but we'd have to redesign the head casting and get the Chinese to make a multi-pulley system, etc - we're hoping to improve on the current situation which is that you can stall the spindle motor with your hand at low speed
the other problem is that the other drive they supply refuses to go less than 400 rpm
that (alignment method) works everytime for us
mshaver: Ah! I know what is wrong!
If its a BLDC it should work fine as a servo with full torque at 0 speed
yep, that's what I think re: BLDC
you see that "drive-offset" parameter? It is there specially for the 8i20.
But I forgot to actualy ever use it....
mine is = 90
Yes, but the internal calcs ignore it.
andypugh, i had used the 'make install-menus' per http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Installing_EMC2#Getting_the_source_with_git
to fix... i did 'make clean' and followed same instructions SANS make install-menus and its ok now
Oh, suuurre you are!
Can I fix it tomorrow? 4am here, and it will need clear thought.
Oh please do this tomorrow! It's 10:55pm here and I'm an old man.
I want to go to bed and sleep for a while myself!
We will eventually allow setting 'D' current (no offset) in SSLBP but unforch needs 8I20 firmware upgrade
Night! THANKS !!
Big progress all around I think.
archivist_emc is now known as archivist
jepler-: in the HAL manual 6.5 Per-instance data storage CTYPE is a simple one-word C type, such as float, u32, s32, int, etc. Is this wrong and should be __u32 and __s32?
What are the symptoms of the issues with probing inside subroutines? Is it only a problem with MDI_COMMAND or something more widespread?
andypugh: I probe with my plasma torch in a subroutine (separate file) without problems
OK. You have probably guessed why I am asking.
The tool-lenght measuring forum thread
I'm a bit slow this morning
* jthornton is reading the thread now
I completely skipped the morning after being up till 4am doing remote hal component testing.
I "touch off" my plasma torch for each cut using G92 to set the Z0 after I use G38.2 to touch off
No auto tool changer on the Plasma then ? :-)
lol, only one tool but several tips
T1 = plasma, T2 = waterjet, T3 = laser, T4 = oxy-fuel T5 = Sharpie?
the plasma torch is on a floating mount with a micro switch
T6 spotting drill
jthornton: yes, I think you're right
jthornton: Which versions is your timer in? (I am editing the SimpleCycleTimer wiki page to point out an easier way)
SteveStallings is now known as steves_logging
wiki updated to release 2.4.6
are you still working on vec2ngc?
I just noticed that it scales up an inch drawing by 24.5 or something like that when it generates the g-code
I'll try and figure it out if I can
my goal is to use it for my plasma table
micges: did you just loose interest in it or is there a problem with it?
loose interest and no time
but I can fix it for you
send me some dxf that you have problem
ok, one moment
<swears at Aram's email>
Can't we persuade him to use Mach?
beware he's using pre-hostmot2 documentation
more importantly re-hostmot2 software
I'm not sure hm2 was even in emc2.2
no yes no
abort retry ignore cancel delete
oh right, forgot that one
usually using floppy disks
He's out of support contract then, isn't he :-)
I think he used up all 5 support incidents already
some time in 2008, actually :)
I think he used up all chances for a support contract renewal too
jepler, cradek: may i request merge of gladevcp branch?
I can do it
[19:36:33] <psha> http://psha.org.ru/cgit/psha/emc2.git/commit/?h=gladevcp
it's HAL Bar widget (like PyVCP one but with gradients), custom user signal handlers and gladevcp HAL file execution
based on today master branch
$ git fetch git://psha.org/ru/psha/emc2.git gladevcp
psha.org[0: 188.8.131.52]: errno=Connection refused
i've not .org domain yet :)
there are some cybersquatter sitting there!
psha: I don't know how to test those changes so I blindly ran the testsuite and trusted you otherwise :-)
there is test for gladevcp now
cd lib/python/gladevcp; halcmd -f gladevcp-test.hal
i'll send announce to dev list as usual
EMC: 03cradek 07master * r5732974471f2 10/src/hal/user_comps/gladevcp.py: add -h <halfile> option to gladevcp for post-init hal commands
EMC: 03cradek 07master * r5c87bb5637df 10/lib/python/gladevcp/makepins.py: gladevcp: Fix errors with several UI files
EMC: 03cradek 07master * r2b78027d2982 10/lib/python/gladevcp/hal_widgets.py: gladevcp: Add inverted pins to toggle switches
EMC: 03cradek 07master * r84ff560c4eac 10/ (docs/man/man9/gladevcp.9 src/hal/user_comps/gladevcp.py): fix gladevcp_makepins warning
EMC: 03cradek 07master * r6c3c38c5eef4 10/ (3 files in 3 dirs): gladevcp: make -h give usage, use -H <halfile>
EMC: 03cradek 07master * ref4672400eee 10/ (88 files in 34 dirs): Merge branch 'master' into gladevcp-modules
EMC: 03cradek 07master * r8eb0fe608786 10/ (3 files in 3 dirs): Merge remote branch 'mhaberler/gladevcp-halfile' into gladevcp-modules
EMC: 03cradek 07master * r40c7236ea9bc 10/src/ (emc/motion/control.c hal/components/time.comp): Merge remote branch 'origin/master' into gladevcp-modules
EMC: 03cradek 07master * r586eb6d140d6 10/lib/python/gladevcp/ (hal_bar.py hal_python.xml hal_pythonplugin.py): gladevcp: Added HAL Bar widget like one in PyVCP
EMC: 03cradek 07master * ree48a44055f9 10/lib/python/gladevcp/ (widget-gladevcp-hal_hbar.png widget-gladevcp-hal_vbar.png): gladevcp: Added icons for HBar/VBar widgets
EMC: 03cradek 07master * r0452519669e3 10/lib/python/gladevcp/ (gladevcp-test.hal gladevcp-test.ui): gladevcp: Added HAL HBar/VBar to tests
EMC: 03cradek 07master * r83c97888b197 10/src/hal/user_comps/gladevcp.py: gladevcp: Added user defined callbacks
EMC: 03cradek 07master * rbcabb9532b43 10/lib/python/gladevcp/ (7 files): Merge branch 'gladevcp-bar2' into gladevcp-modules
Is it possible to setup halrun in such a way that error messages are visible?
andypugh: in gladevcp?
No, in generic emc2
For example, mshaver was setting his 8i20 to 20A (halcmd: setp hm2_5i20.0.8i20.0.0.maxcurrent 20) which causes an error message (you can't go that high, I am ignoring you) but you don't get to see those messages in halrun.
They only seem to appear in dmesg
they're messages from kernel modules, so they generally go to the log
I think there's a way to print RTAPI messages to the console or to a file, but I don't know the mechanism
OK. I guess I will just have to stop making errors.
Isn't that just a different masking level?
I am talking about RTAPI_MSG_ERR messages. They get printed (and appear in Axis) but not the halcmd prompt
halcmd is userspace program and it's use printf
so it's showed in terminal
drivers and rest realtime code can't do that so they write to log
OK, so I guess that the messages get into Axis by Axis polling the log?
no, there's a "send user message" function in RTAPI (or somewhere in the RT/kernel code anyway)
those messages go through the NML error channel I believe
Anyway, the point is that I am not missing a trick, Axis displays error messages from RT code, but halrun doesn't. I just thought it might be an option
I don't think halrun could do it, since you generally aren't running emc with halrun
SWPadnos: yes there are 3 nml channels: cmd stat and error
emc is what gets all those NML channels set up
Talking of NML...
micges, I know that. I don't know which particular 3-channel "connection" is the one that AXIS gets it info from though :)
oh, NML talk. time for me to take a shower or make coffee or something :)
There is an NML set acelleration command/symbol/token. Is that any use to Spiderdab?
I'm not sure whether you can (a) issue that command while the machine is on or (b) assume that it will have any effect on already planned motion or (c) assume that it will do anything for HAL (since HAL doesn't really deal with NML)
OK, will give up on that than.
Or, alternatively, is there a way to search the IRC archives
andypugh: theoretically they should be indexed
so the search on the linuxcnc.org page should get them
Worth a try
pcw_home: Are you awake?
Ah, I was composing a lengthy email.
It probably works better that way anyway.