Mesa 7i96S

More
28 Apr 2023 10:10 #270105 by tommylight
Replied by tommylight on topic Mesa 7i96S
Choose the card from the menu, do not use discovery.
Create the config, save, then start that config.
Post the Debug info, if it fails to load.
The following user(s) said Thank You: Vector

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

More
28 Apr 2023 11:49 #270111 by andypugh
Replied by andypugh on topic Mesa 7i96S
pncconf does call mesaflash so if you don;t have mesaflash that might explain why discovery is not working.

Does "sudo apt-get install mesaflash" work?

Did you manage to create a config in Debian 12? If you did, then that same config should work in 11.
The following user(s) said Thank You: Vector

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

More
28 Apr 2023 21:25 - 28 Apr 2023 22:11 #270135 by Vector
Replied by Vector on topic Mesa 7i96S
Thank you, tommylight and andypugh!

Your combined responses gave me the confidence to power on everything and actually try it even though the "driver" selected in the dropdown during pncconf was 7i96 not 7i96s.

Wonderful now: I have servo motor motion, so that's a big step forward.

Follow up question, during the wizard, on the Mesa Card 0 page, the TB1/TB2 tab, I am trying to use what should be the second Num 0... ie, below Num 4: Unused StepGen, for the PWM spindle. But it doesn't seem to provide a PWM option. Then when it writes the .hal file, the loadrt hm2_eth config parameter has "...num_encoders=1, num_pwmgens=0..."  which is internally consistent but not what I need.

(for clarity regarding placement on the hardware, I'm talking about the "top" of the board, ie if you hold the board so that the words printed on it are right side up, this is the topmost 4-wire socket in the TB2 column, where the pins are marked NC, Spin-, Spinout, and Spin+. I'm wired to Spin- and Spin+)

I can manually change the .hal file to try and work it out, but it does make me worry that I've somehow got a wrong driver on the linuxcnc side (my understanding is that board already has it's firmware, according to documentation and the fact that servos are working.)

Any thoughts or insights?

Would compiling mesaflash and querying the board change the options on the tab?

(my repos do not allow me to sudo apt install mesaflash... package not found)
Last edit: 28 Apr 2023 22:11 by Vector.
The following user(s) said Thank You: tommylight

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

More
28 Apr 2023 23:20 #270143 by PCW
Replied by PCW on topic Mesa 7i96S
You should not need to use mesaflash if you are using the
analog spindle output as this is supported with the stock firmware

What version of LinuxCNC are you running? pnnconf should support
the 7I96S

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

More
29 Apr 2023 00:16 #270151 by Vector
Replied by Vector on topic Mesa 7i96S
The dpkg version is linuxcnc-uspace version: 1:2.9.0~pre arm64
ie the splash screen says 2.9.0~pre0

Are you saying use the analog spindle output like it's a potentiometer attached to the spindle power supply?

I know the spindle power supply came with that as a possible configuration for manual speed control.
I had the concept (probably left over from trying to go straight through gpio pins) that the 7i96s was going to generate PWM and feed that through the power supply like its an amplifier.
But if I get what you are saying, the board just becomes like the potentiometer dial that came with the spindle control, except that it's controllable through LinuxCNC, right?

(Thanks)

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

More
29 Apr 2023 00:19 #270152 by PCW
Replied by PCW on topic Mesa 7i96S
Yes, the 7I96S has a potentiometer replacement type analog output
(Typically powered by 10V)
The following user(s) said Thank You: Vector

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

More
29 Apr 2023 08:36 #270173 by Vector
Replied by Vector on topic Mesa 7i96S
That's spinning it... can you help me in the next baby step... why is it leaking .25 v? That's enough to make it spin at a lazy 150 rpm. I can hold it still with my hand at that slow speed.

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

More
29 Apr 2023 15:01 #270210 by PCW
Replied by PCW on topic Mesa 7i96S
The The 7I96S minimum analog output voltage should be less than 50 mV
with PWM at 0%. Is it possible you have an offset in the hal settings or there is back current from the drive?

You can check the actual PWM value by reading hm2_7i96s.0.pwmgen.00.value
with halshow

You could check for any back current by testing with spinout disconnected from the drive
The following user(s) said Thank You: Vector

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

More
30 Apr 2023 08:40 - 30 Apr 2023 09:52 #270296 by Vector
Replied by Vector on topic Mesa 7i96S
Wow! You are sooo right.

By saying "back current" from the drive, I presume you were anticipating that there's a voltage potential on the "signal" input terminals to the power supply that drives the spindle motor.

Meanwhile, the "signal" cable from the mesa card is rock-solid at 0.000volts.

That back current must be somewhat common? (Or more common with cheaper drives, which is what I surely bought by buying a spindle kit for about $100.)

Any quick advice for best fix? You mentioned an offset in the hal settings... can this be set to be the negative that cancels out the the small voltage? Or is it a hardware fix? (I see three adjustable pots inside the grille, behind the giant yellow sticker that says "high voltage, no user serviceable parts inside) Or do I need to buy a better power driver?

The relevant parts of the .ini and .hal file that pncconf generated:

(when I tested the spindle with 5v and 10v inputs, the RPM was 6700 and 13500 respectively) The wizard then calculated that encoder scale number = 4.
I tried to do the open loop test, but I didn't know how to make it work, so I skipped it.

.ini file:
[SPINDLE_0]
P = 0.0
I = 0.0
D = 0.0
FF0 = 1.0
FF1 = 0.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 6700.0
ENCODER_SCALE = 4.0

.hal file:

loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hostmot2
loadrt hm2_eth board_ip="10.10.10.10" config="num_encoders=1 num_pwmgens=0 num_stepgens=5 sserial_port_0=0xxxxx"
...
loadrt pid names=pid.x,pid.y,pid.z,pid.a,pid.s
loadrt abs names=abs.spindle
loadrt lowpass names=lowpass.spindle
loadrt scale names=scale.spindle
loadrt near
...
addf pid.s.do-pid-calcs       servo-thread
addf scale.spindle            servo-thread
addf abs.spindle              servo-thread
addf lowpass.spindle          servo-thread
addf near.0                   servo-thread
...
#*******************
#  SPINDLE
#*******************

setp   pid.s.Pgain     [SPINDLE_0]P
setp   pid.s.Igain     [SPINDLE_0]I
setp   pid.s.Dgain     [SPINDLE_0]D
setp   pid.s.bias      [SPINDLE_0]BIAS
setp   pid.s.FF0       [SPINDLE_0]FF0
setp   pid.s.FF1       [SPINDLE_0]FF1
setp   pid.s.FF2       [SPINDLE_0]FF2
setp   pid.s.deadband  [SPINDLE_0]DEADBAND
setp   pid.s.maxoutput [SPINDLE_0]MAX_OUTPUT
setp   pid.s.error-previous-target true

net spindle-index-enable  <=> pid.s.index-enable
net spindle-enable        =>  pid.s.enable
net spindle-vel-cmd-rpm     => pid.s.command
net spindle-vel-fb-rpm      => pid.s.feedback
net spindle-output        <=  pid.s.output

# ---Encoder feedback signals/setup---

setp    [HMOT](CARD0).encoder.00.counter-mode 0
setp    [HMOT](CARD0).encoder.00.filter 1
setp    [HMOT](CARD0).encoder.00.index-invert 0
setp    [HMOT](CARD0).encoder.00.index-mask 0
setp    [HMOT](CARD0).encoder.00.index-mask-invert 0
setp    [HMOT](CARD0).encoder.00.scale  [SPINDLE_0]ENCODER_SCALE

net spindle-revs             <=   [HMOT](CARD0).encoder.00.position
net spindle-vel-fb-rps       <=   [HMOT](CARD0).encoder.00.velocity
net spindle-vel-fb-rpm       <=   [HMOT](CARD0).encoder.00.velocity-rpm
net spindle-index-enable     <=>  [HMOT](CARD0).encoder.00.index-enable

# ---setup spindle control signals---

net spindle-vel-cmd-rps        <=  spindle.0.speed-out-rps
net spindle-vel-cmd-rps-abs    <=  spindle.0.speed-out-rps-abs
net spindle-vel-cmd-rpm        <=  spindle.0.speed-out
net spindle-vel-cmd-rpm-abs    <=  spindle.0.speed-out-abs
net spindle-enable             <=  spindle.0.on
net spindle-cw                 <=  spindle.0.forward
net spindle-ccw                <=  spindle.0.reverse
net spindle-brake              <=  spindle.0.brake
net spindle-revs               =>  spindle.0.revs
net spindle-at-speed           =>  spindle.0.at-speed
net spindle-vel-fb-rps         =>  spindle.0.speed-in
net spindle-index-enable      <=>  spindle.0.index-enable

# ---Setup spindle at speed signals---

net spindle-vel-cmd-rps    =>  near.0.in1
net spindle-vel-fb-rps         =>  near.0.in2
net spindle-at-speed       <=  near.0.out
setp near.0.scale 1.000000
setp near.0.difference 3.333333

#  Use ACTUAL spindle velocity from spindle encoder
#  spindle-velocity bounces around so we filter it with lowpass
#  spindle-velocity is signed so we use absolute component to remove sign
#  ACTUAL velocity is in RPS not RPM so we scale it.

setp     scale.spindle.gain 60
setp     lowpass.spindle.gain 1.000000
net spindle-vel-fb-rps        =>     scale.spindle.in
net spindle-fb-rpm               scale.spindle.out       =>   abs.spindle.in
net spindle-fb-rpm-abs           abs.spindle.out         =>   lowpass.spindle.in
net spindle-fb-rpm-abs-filtered  lowpass.spindle.out 

Thanks again!
Last edit: 30 Apr 2023 09:52 by Vector. Reason: Add ini and hal files

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

More
30 Apr 2023 20:03 #270334 by PCW
Replied by PCW on topic Mesa 7i96S
Its not common (offset current) It just explains the behavior
I would probably just disable the spindle below some minimum speed
It sounds like a fairly high speed spindle so probably not useful below
some minimum RPM anyway

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

Time to create page: 0.196 seconds
Powered by Kunena Forum