EMC: 03seb 07master * r3646840e462a 10/src/hal/drivers/mesa-hostmot2/ (hostmot2.h pwmgen.c): Revert "fix pwmgen memory leaks, & simplify pwmgen a bit"
cradek: did you get emc2-sim to build on your 10.04 laptop yet?
I had to install tcl8.5-dev and tk8.5-dev, NOT tk-dev and tcl-dev
[14:22:38] <jepler> http://media.unpythonic.net/emergent-files/sandbox/0001-Add-a-relative-tolerance-for-arcs-rev2.patch
^^ another patch I have laying around that maybe should be applied to 2.4
I remember we talked about it one day pretty thoroughly
yes I recall we studied that pretty hard
iirc the only outstanding objection was to the error message itself
which I agree is sucking harder and harder every day
(though I suppose I could leave the error message unchanged)
just skip changing the error, I guess. we don't want to disrupt the strings if we can avoid it, anyway.
[14:26:46] <jepler> http://emergent.unpy.net/files/sandbox/0001-Add-a-relative-tolerance-for-arcs-rev3.patch
arc_radius and radiu2 are guaranteed positive, right?
(oh I can see they come from 'hypot' right there in the patch context)
oh, I *did* put that patch on master
jepler: what's up?
just trying to get through the week of work
and hoping to package up 2.4.0 this weekend
would be cool
I also have 4000 europe vacation photos to sort through, and a blog entry to write on my fpga hardware rng from back in march
maybe I'll also create blog
if so it will be very irregulary updated ;)
micges: mine is pretty irregular too
micges: I'd rather people don't write blog entries when they have nothing to say, just to keep to some imagined schedule
micges: so I'd say "go for it"
jepler: I agree
hi folks :-)
seb_kuzminsky: will you have few minutes to look at stepgen bug before 2.4.0 ?
jepler: how was europe?
micges: ah right, i should fix that
i'll do it tonight
seb_kuzminsky: pretty good on the whole
missed you when i came to lincoln
seb_kuzminsky: but the air travel problems have me thinking twice about international travel
seb_kuzminsky: yeah, too bad
chris told me some of the fun surrounding moving boss
time to get a pilot's license
pilot's license or not, I don't think it's financially viable to fly my own plane from nebraska to germany..
hi cradek :-)
cradek: i think a friend in boulder will buy my x2, then we'll use the bp to make the cnc conversion parts for it
that should be an easier rigging project...
yes, does it require both hands to move, or just one?
maybe both if you pile the vise & clamp kit etc on the table first
did you get some parallels longer than 2" yet?
i'm waiting to sell the old parallels first
it's neat that you're using it for home repairs already.
bleh, still having boot problems with rtai patched kernel on 10.04
boots fine on one machine (with intel onboard graphics which were more problematic), and not at all on another machine with an nvidia card.
yuck. you have my sympathies.
this is with the latest patch from magma which was supposed to have some boot fixes.
looks like somewhere the kernel versioning got broken again too. I now have to disable kernel module versioning in the kernel config to get things to work.
I think I need a bit of advice on how to handle something the "EMC way"
The three-phase PWM function in Hostmot2 has a readable enable bit and a readable fault bit.
The enable bit is mirrored as an output to a pin. The fault bit depends on the input to a pin.
If fault is active and you write to enable, nothing changes.
if the fault bit is high, but there is no current fault and you write to enable, then fault goes low, and enable goes high
Oracle Open Office Standard Edition is a complete, feature-rich office productivity suite
wrong channel ;)
andypugh: why is the fault bit high?
if enable is high and a fault happens, then fault goes high, and enable goes low
external fault input
so when external fault goes low.. shouldn't the fault flag go low too?
or it's more of a latching thingie?
But the state of the bit in the register latches
ok.. so enable acts as a reset?
it latches till the enable bit is driven high
But, here is the issue. The enable bit is only actively written to if the state in HAL has changed.
In fact, it is a little more complex than that in the driver at the moment, as the last-written state is compared to the current state of the bit, and it is transmitted to the card if it differs.
So, should the enable HAL pin mirror the register bit, or not?
enable is usually a HAL input to pwm, so pwm can't drive it
I am thinking it probably should. Normally it will be written to by an external function every servo thread (from a button or an axis output). If it keeps getting reset by the driver_read function then it will not match the last-written value, so will keep being rewritten, which will toggle the bit and clear the fault...
jepler: In that case I guess I need to arrange for the enable register to be written and read every cycle, whether it has changed or not?
(Because I don't know if it has changed or not)
if you want to write it only on change, then keep the old value in your structure somewhere
I am doing that, but that causes a problem.
Because I only write it when the hal pin has changed, I don't toggle the register bit when it has been hanged by the FPGA because of a fault input.
Though I could check if the hal pin matches the bit, rather than testing if the hal-pin matches the last-read
if you blindly write it all the time, it seems like you can miss a fault if you write it between the time the fault is registered in the fpga and the time the fault register is read by emc
I don't _think_ I can over-ride the FPGA's opinion of whether the enable bit can be set or not. If the fault bit is active, the state of the enable bit can't be changed.
oh, you mean if it's a continuous fault
I don't like the current situation, where the hal-fault can show true with the hal-enable showing true, but the register-enable is false and the PWM is off.
Then if the fault clears, you have hal-fault showing false, hal-enable showing true, but the register enable bit is still false, to the PWM stays off.
is the "hal-enable" the IN-direction pin that will be connected to e.g., axis.0.motor-enable-out ? If so, it's no bug in your driver that it can say TRUE while the PWM is actually off due to an external fault condition
It is indeed that type of pin
(because it's not your driver putting the value on that HAL pin, it's whatever OUT pin is connected to the same signal)
you can decide whether to clear a fault you want to require the HAL enable pin to be driven FALSE and then TRUE (a rising edge) to clear it after the external fault is removed, or whether driving it TRUE when the external fault disappears should be enough..
(I don't think we've had that specific situation before with another driver)
No, that is exactly what I don't want me, personally, to decide. I want the EMC developers to decide for me.
in a sanely hooked-up emc system (with the fault going to axis.#.amp-fault-in) you will be able to depend on that rising edge the fault is cleared
Bit if I did have to decide, I think I would go for attempting to enable the PWM if the hal-pin is true, the drive is not faulted and the pwm is currently disabled.
in a sanely hooked-up emc system (with the fault going to axis.#.amp-fault-in) you will be able to depend on that rising edge after the fault is cleared
(amp-fault-in takes you at least to "machine off" so the amp-enable-outs all go FALSE)
* alex_joni is seeing double
No, if you read very carefully, he changed a word
now if only I'd read what andy says as carefully as he reads what I say..
Does axis-amp-fault-in reset axis-amp-enable?
In that case I think my proposal covers both sanely and "insanely" wired systems.
if there's a delay of more than one period (between amp-fault-in going TRUE and amp-enable-out going FALSE) that's unintentional and should probably be fixed
there's no good reason for it to be other than instant
ie the pwmgen (and its enable-out physical pin) will only go back high when the fault is cleared and the hal-enable is high (regardless of whether it has been toggled to false in the interim)
It won't work for anyone who uses setp 3phase-pwmgen.0.enable = 1 in their hal file, but that serves them right
sounds OK to me. we can revisit the decision later if experience starts to indicate otherwise.
Supplementary question. I have gone for calling the function tp_pwmgen in the code, and 3phase-pwmgen in the user-facing bits. Does that seem OK?
(Numerals at the beginning of variable and function names is a no-no I think?)
3phase-pwmgen is a bit long. have you considered 3pwmgen?
(yes, C identifiers can't begin with a numeral)
except roman numerals
It was 3ppwmgen until earlier this evening...
what about pwmgen-3phase ?
or pwmgen-3p ?
pwmgen3 might work
(that looks rather l33t )
And the declaration parameter, currently num_3phase_pwmgens is definitely rather long.
3pwmgen works. I will go for that.
alex_joni: you're mistaken about roman numerals, by the way. The unicode characer U+2160 "roman numeral one" is not acceptable at the beginning of an identifier by gcc, even when the c99 "universal identifer" feature is enabled.
how about capital i ?
(and yes, I've spent the last 5+ minutes determining that :-P)
alex_joni: what about capital i? That's a letter.
if you think it's also a roman numeral, you're mistaken.
Roman numerals are based on seven symbols: a stroke (identified with the letter I) for a unit
you're like the people who think that Σ and ∑ or β and ß are the same
you make me sick
I won't dispute that people often incorrectly "transliterate" Ⅲ as III.
"The characters in the range U+2160.217F are present only for compatibility with other character set standards which provide these characters. For ordinary uses, the standard Latin letters are preferred. "
I think cradek said that ;)
unfortunately for me, The Unicode Stnadard, Version 5.2, page 467 agrees with wikipedia
Roman Numerals. For most purposes, it is preferable to compose the Roman numerals from sequences of the appropriate Latin letters. However, the uppercase and lowercase variants of the Roman numerals through 12, plus L, C, D, and M, have been encoded for compatibility with East Asian standards. Unlike sequences of Latin letters, these symbols remain upright in vertical layout.
are you home already?
(but personally I'd rather see the roman numeral Ⅲ typeset with a single continuous bar above and below than as III)
home -- from work? no.
about to leave, I think
I'd imagine that would be better than reading about unicode roman numerals
I doubt any romans will come to check if we use unicode or not