Hal configuration for BISS encoder

More
1 year 8 months ago - 1 year 8 months ago #321432 by pmchetan
In many HostMot2 firmware builds the PWM frequency isn’t a runtime‐adjustable parameter. Typically the pwmgen component would export a parameter called either “pwm_frequency” or “pwm-freq” to let you set the carrier frequency, but in your firmware configuration only the two basic pins (enable and value) are exported. This means that the PWM frequency is fixed by the bitfile you flashed.

To change the frequency at runtime you would need to use (or build) a firmware configuration that exports that parameter.


PWM mode selected on the drive, I can switch the SV pin to COM with hand and the motor spins. Suspect is that the 7i76 generated 20 kiloherts PWM signal is too high for the drive to handle. So runtime frequency option is needed so that I can choose in HAL file. This was what I was referring to in my last post, I assumed all possible pin names will all be listed somewhere but I guess those need to be made available by the firmware. Can you included everything to be exposed at runtime: we can use what is needed and ignore the rest right?
Also I wanted to ask the .vhd file you gave is it the complete firmware design files that can be compiled into a bit file in suitable version of xilinx ISE?
Last edit: 1 year 8 months ago by pmchetan. Reason: Added extra context.

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

More
1 year 8 months ago - 1 year 8 months ago #321443 by PCW
In many HostMot2 firmware builds the PWM frequency isn’t a runtime‐adjustable parameter. Typically the pwmgen component would export a parameter called either “pwm_frequency” or “pwm-freq” to let you set the carrier frequency, but in your firmware configuration only the two basic pins (enable and value) are exported. This means that the PWM frequency is fixed by the bitfile you flashed.


That's not true, all hostmot2 firmware with a PWMgens exports pwm_frequency and pdm_frequency parameters. Note that these are parameters, not pins.

Also I wanted to ask the .vhd file you gave is it the complete firmware design files that can be compiled into a bit file in suitable version of xilinx ISE?

No, that file only has the constants that define that particular configurations set of modules and pinout. You need to download the 5i25.zip file from the store or www.mesanet.com to get the full sources.
Last edit: 1 year 8 months ago by PCW.

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

More
1 year 8 months ago - 1 year 8 months ago #321446 by pmchetan
I've been using AI to solve this issue. They give a lot of imagined stuff when they can't solve an issue.
setp hm2_5i25.0.pwmgen.00.frequency 1000 threw error: ./5i25_7i76PWM_7i74.hal:21: parameter or pin 'hm2_5i25.0.pwmgen.00.frequency' not found

How else do I set the PWM frequency then?
Last edit: 1 year 8 months ago by pmchetan.

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

More
1 year 8 months ago - 1 year 8 months ago #321447 by PCW
halcmd show all | grep pwm

(the PWM frequency is for all PWMgens)
Last edit: 1 year 8 months ago by PCW.

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

More
1 year 8 months ago - 1 year 8 months ago #321536 by pmchetan
I found the parameter:     36  u32   RW     0x000007D0  hm2_5i25.0.pwmgen.pwm_frequency through halcmd :)
Now the motor partially spins. The PWM signal is set at 2 khz and scale of 5.0 and when I click the jog '+' button in axis, the motor had two distinct activation ( it spins for a quater turn, stops and then spins a couple of turns in the same direction) I measured the PWM voltage on mesa 7i76 board it matches the observations with a small 0.25 volts spike right after the click, it goes back to zero and then goes to 4.8 volts.
The same small voltage spike also exist in direction output too and this spike when I click '-' button makes the motor turn a quarter turn in reverse direction, stop and then turns in the same direction as the '+' jog button would make it spin.
I have uploaded the HAL config I used for this testing, it has fake position feedback to mitigate joint follow error which I tried widening the max error allowed but nothing worked.
Is there a way to suppress that initial voltage spike? Or am I doing something wrong in the HALfile?


 

File Attachment:

File Name: 5i25_7i76P...2-14.hal
File Size:1.11 KB

 
Last edit: 1 year 8 months ago by pmchetan. Reason: Added clarity in the explanation

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

More
1 year 8 months ago #321558 by PCW
You could plot the velocity command to see why the PWM behaves that way

 The PWM average output voltage will simple follow the PWM value its given

Note that you also have to make sure you don't exceed the maximum PWM
values (+- PWM scale)
 

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

Time to create page: 0.117 seconds
Powered by Kunena Forum