Driving h-bridge
09 Mar 2024 06:12 - 09 Mar 2024 06:25 #295490
by vre
Driving h-bridge was created by vre
I have an h-bridge that gets 1 input for pwm
and 2 inputs A1-A2 for direction
When A1=0 A2=0 and A1=1 A2=1 brakes
when A1=1 A2=0 is right
when A1=0 A2=1 is left
but pwmgen outputs only 1 pin for direction
How can do pwmgen to output 2 pins? 1 NOT logic gate?
and 2 inputs A1-A2 for direction
When A1=0 A2=0 and A1=1 A2=1 brakes
when A1=1 A2=0 is right
when A1=0 A2=1 is left
but pwmgen outputs only 1 pin for direction
How can do pwmgen to output 2 pins? 1 NOT logic gate?
Last edit: 09 Mar 2024 06:25 by vre.
Please Log in or Create an account to join the conversation.
09 Mar 2024 11:55 #295505
by COFHAL
Replied by COFHAL on topic Driving h-bridge
What card to use to control the H-bridge?
Please Log in or Create an account to join the conversation.
09 Mar 2024 12:23 #295507
by blazini36
Replied by blazini36 on topic Driving h-bridge
The pwmgen direction pin is only a hardware pin so I assume you're talking about using a hardware "NOT" gate, or an inverter. That could work, but you still need to do something for "brake"
If you're talking about a HAL "NOT" gate then yeah, you can use that too but you need to direct it to a separate output pin on whatever card you're using. You could use the pwmgen's dir pin for A1 and the NOT'd output pin to A2, but then you can't get "brake".
A better way to do it in HAL is to not use the pwmgen's dir pin and use normal 2 output pins on the card. If you don't need the brake then connect the joint or spindle's HAL direction pin to 1 card output and to the NOT input pin, connect the NOT output to the cards 2nd output and you have your 2 opposing output pins.
If you need the brake, the only way I can think of to do it in hal is to use a NOT and 2 ORs. The outputs of the 2 ORs each get connected to a card output. whatever HAL pin controls your brake gets connected to 1 input on both of the ORs. The other input on the first OR is connected to the dir pin, the other ORs 2nd input connected to the output of the NOT. With this, if the pin controlling the brake is TRUE, then both outputs will go high. Otherwise both outputs will be opposed to each other to control the direction.
If you're talking about a HAL "NOT" gate then yeah, you can use that too but you need to direct it to a separate output pin on whatever card you're using. You could use the pwmgen's dir pin for A1 and the NOT'd output pin to A2, but then you can't get "brake".
A better way to do it in HAL is to not use the pwmgen's dir pin and use normal 2 output pins on the card. If you don't need the brake then connect the joint or spindle's HAL direction pin to 1 card output and to the NOT input pin, connect the NOT output to the cards 2nd output and you have your 2 opposing output pins.
If you need the brake, the only way I can think of to do it in hal is to use a NOT and 2 ORs. The outputs of the 2 ORs each get connected to a card output. whatever HAL pin controls your brake gets connected to 1 input on both of the ORs. The other input on the first OR is connected to the dir pin, the other ORs 2nd input connected to the output of the NOT. With this, if the pin controlling the brake is TRUE, then both outputs will go high. Otherwise both outputs will be opposed to each other to control the direction.
The following user(s) said Thank You: vre
Please Log in or Create an account to join the conversation.
09 Mar 2024 14:03 - 09 Mar 2024 14:05 #295513
by vre
Replied by vre on topic Driving h-bridge
mesa card hostmot pwmgen to control h bridge
it will better to use 74hc14d chip or not in hal?
it will better to use 74hc14d chip or not in hal?
Last edit: 09 Mar 2024 14:05 by vre.
Please Log in or Create an account to join the conversation.
Time to create page: 0.088 seconds