Mesa 5i20 - 7I52S support
- PCW
-
- Away
- Moderator
-
- Posts: 18527
- Thank you received: 5076
the theory is that you set the PID loop component so its output range is -234 to 234
then this number is offset by 234 so you get a 0 to 468 range fed to the PWM generator
Whether or not OUTPUT_OFFSET works I do not know, If not you would have to feed this through an offset component (COMP)
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
-
- Posts: 7884
- Thank you received: 2131
you will have to use a offset comp.
The output_offset option has been removed from the very latest PNCconf because of this.
actually only a couple components support output_offset, software PWM being one for instance.
I guess this should be mentioned in the docs...
Please Log in or Create an account to join the conversation.
- andypugh
-
- Away
- Moderator
-
- Posts: 23315
- Thank you received: 4944
you will have to use a offset comp.
The component called "offset" is a bit overkill for this use-case, it is intended to offset axis positions and handles feedback matching too.
The "scale" component will work, it has both scale and offset components so you could add 1 and divide by 2 to convert a -1 to +1 value into an offset 0 to +1.
Please Log in or Create an account to join the conversation.
- boyzo
- Offline
- Senior Member
-
- Posts: 76
- Thank you received: 3
Can you give me HAL example, based on the code I upload yesterday?
And thank you guys for all the support. It seems I am trying to do some not so ordinary configuration, but this might help someone else as well.
Bojan
Please Log in or Create an account to join the conversation.
- andypugh
-
- Away
- Moderator
-
- Posts: 23315
- Thank you received: 4944
Can you give me HAL example, based on the code I upload yesterday?
Using www.linuxcnc.org/docview/html/man/man9/scale.9.html
Add the lines in red:
loadrt scale names=x,y,z
addf scale.y servo-thread
...
net y-output => pid.y.output
net y-pos-cmd => pid.y.command
net y-pos-fb => pid.y.feedback
net y-output => scale.y.in
setp scale.y.gain 0.5
setp scale.y.offset 0.5
net offset-pwm-y scale.y.out => hm2_5i20.0.pwmgen.02.value
net y-pos-cmd axis.1.motor-pos-cmd
net y-enable axis.1.amp-enable-out => hm2_5i20.0.pwmgen.02.enable
Please Log in or Create an account to join the conversation.
- boyzo
- Offline
- Senior Member
-
- Posts: 76
- Thank you received: 3
Now I need to tune this thing (I am receiving folowing error for any encoder and motor direction, bot motor moves several mm).
What I suspect is my connection to 7I52S.
What is correct connection of PWM, PWM gnd, ENable. The pins are TX2A, /TX2A, TX2B, /TX2B. Is there any way to find this out from configuration files?
Please Log in or Create an account to join the conversation.
- PCW
-
- Away
- Moderator
-
- Posts: 18527
- Thank you received: 5076
Tuning is very premature unless you can verify that you get 50% PWM with 0 error
what I would do is disconnect your motor power
set a large FERROR and MIN_FERROR (say 100)
set all PID terms to 0 except a small P term (say 1)
now start EMC and see if you get a 50% duty cycle from the PWM pin (A VOM will read 2.5V)
this PWM (or voltage if you dont have a scope) should vary from 0 to 5V as you turn the motor shaft
If not there's no point in even starting to tune
As far as I can see the PWMs should be in order
TX0A = ENA0
TX0B = PWM0
TX1A = ENA1
TX1B = PWM1
etc
Please Log in or Create an account to join the conversation.
- PCW
-
- Away
- Moderator
-
- Posts: 18527
- Thank you received: 5076
BTW P3.3 (TX0A) is the proper polarity for an active high enable)
I also noticed an assembly error on the 7I52s cards (These are the first lot and were modified from standard 7I52's)
The error is that the termination resistors were left on the card (They are the receive data terminators on a standard 7I52)
when it was modified. These are 150 Ohm 1206 resistors R12,R13,R20,R21,R34,R35. These present a large load on the outputs which will reduce their drive ability and swing. If you can do SMT repair, these resistors should be removed, If not we can issue a RMA and modify the card.
Please Log in or Create an account to join the conversation.
- boyzo
- Offline
- Senior Member
-
- Posts: 76
- Thank you received: 3
Using PID output scale of 10 I defined offset -5.0. With this definition, I get expected result on PWM output pin and 50% PWM gives me +-0.003mm oscilation. I can jog on both direction, now I will start do tune for performance.
I dont think that returning card tu USA make sense as shipping cost are high. I will see what I can do here in Slovenia.
Thank you all for help and advise.
Please Log in or Create an account to join the conversation.
- andypugh
-
- Away
- Moderator
-
- Posts: 23315
- Thank you received: 4944
There is a Mesa stockist in CZ which might be more convenient for you?II dont think that returning card tu USA make sense as shipping cost are high. I will see what I can do here in Slovenia..
Please Log in or Create an account to join the conversation.