7i76E one PWM needed

More
10 Jan 2016 12:57 #68155 by sirhc
7i76E one PWM needed was created by sirhc
Hello,

I have a 7i76E card setup and running. Now I need a PWM generator to control a L298 H-bridge.
I've already install the Xilinx software and I'm able to compile bit files. Which PIN file is supplied with the 7i76e file when it's shipped?
Is it possible to add one PWM generator and have PWM functionality on one of the GPIO pins? How should I proceed?

Kind regards,

Chris

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

More
10 Jan 2016 16:16 - 10 Jan 2016 16:17 #68157 by PCW
Replied by PCW on topic 7i76E one PWM needed
PIN_7i76x1D_51.vhd is the pin file used for creating the default 7I76E config
You would need to add the PWM to one of the expansion port pins (or steal a step/ dir pin if you dont need all 5)
Last edit: 10 Jan 2016 16:17 by PCW.
The following user(s) said Thank You: sirhc

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

More
10 Jan 2016 16:38 #68158 by sirhc
Replied by sirhc on topic 7i76E one PWM needed
I only use three stepgen generators so I can use the fourth for PWM. I'll give it a try this evening.

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

More
11 Jan 2016 21:52 #68200 by sirhc
Replied by sirhc on topic 7i76E one PWM needed
I've got it working! Thanks for your help!

Regards Chris

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

More
11 Jan 2016 23:26 - 11 Jan 2016 23:26 #68209 by PCW
Replied by PCW on topic 7i76E one PWM needed
That's great. Its a really big help when people can make their own custom bitfiles

(I realize not everyone can or wants to do this)
Last edit: 11 Jan 2016 23:26 by PCW.

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

More
23 Jan 2016 00:12 #68945 by sirhc
Replied by sirhc on topic 7i76E one PWM needed
Hi,

I ran into a little annoying issue. When I close Linuxcnc or turn off the PC the PWM value will go to 100% (5V). How can I change this behaviour so it will be 0% (0V)?

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

More
23 Jan 2016 01:27 #68948 by PCW
Replied by PCW on topic 7i76E one PWM needed
Chose the other differential pair output (so its 0V when the 7I76E is idle) and invert the PWM output in HAL

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

More
23 Jan 2016 10:25 #68958 by sirhc
Replied by sirhc on topic 7i76E one PWM needed
Must have been too late :silly: Don't know why I forgot it's differential.. Thanks!!!

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

More
23 Jan 2016 14:49 #68968 by sirhc
Replied by sirhc on topic 7i76E one PWM needed
Okay this works, but there is some sort of glitch of a few 100ms during startup of Linuxcnc. The negative pin is low when linuxcnc is not running which is good. At startup of linuxcnc the pin will go high and stay high until the invert command is executed.

So I'm not sure it can be solved in linuxcnc. Is it possible to change the FPGA code so when I use the positive pin PWM will stay 0 if Linuxcnc is closed?

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

More
23 Jan 2016 15:22 - 23 Jan 2016 15:23 #68969 by PCW
Replied by PCW on topic 7i76E one PWM needed
Yes, you would probably have to change the FPGA code to get a glitch free startup
You will always need to use the negative output as this is the only output that will stay at 0 when linuxcnc is not running

What is required is to make the FPGA PWM output active low. To do this as a hack you would
change ( in pwmpdmgenh.vhd )
when "00" =>
    pwmouta <= pwm; 			-- normal sign magnitude
    pwmoutb <= dir;
when "01" =>

to
when "00" =>
    pwmouta <= not pwm; 			-- normal sign magnitude
    pwmoutb <= dir;
when "01" =>
Last edit: 23 Jan 2016 15:23 by PCW.

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

Moderators: PCWjmelson
Time to create page: 0.088 seconds
Powered by Kunena Forum