Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
Asked — Edited

H-Bridge Dual Dc Motor Controller

Hi,
I got my H-Bridge from Ez. I'm playing with tutorial 43 working with the HBridge. I can not get my robot to move. The H-Bridge work fine using Ez builder.

I updated the form load to use the same configuration in the EZBuiler.

private void Form1_Load(object sender, EventArgs e) {

ezB_Connect1.EZB.Movement.MovementType = EZ_B.Movement.MovementTypeEnum.HBridge;
ezB_Connect1.EZB.Movement.HBridgeLeftWheelTriggerA = EZ_B.Digital.DigitalPortEnum.D4;
ezB_Connect1.EZB.Movement.HBridgeLeftWheelTriggerB = EZ_B.Digital.DigitalPortEnum.D3;
ezB_Connect1.EZB.Movement.HBridgeRightWheelTriggerA = EZ_B.Digital.DigitalPortEnum.D5;
ezB_Connect1.EZB.Movement.HBridgeRightWheelTriggerB = EZ_B.Digital.DigitalPortEnum.D6;

// I added this to see if this would help.
ezB_Connect1.EZB.PWM.SetPWM(EZ_B.Digital.DigitalPortEnum.D2, 40);
ezB_Connect1.EZB.Movement.Speed = 40;
ezMovement1.SetEZB = ezB_Connect1.EZB;

I'm not sure where you set the PWM for speed? Is there something I'm missing. I"m using Visual Studio 2012. The code pretty straight forward not sure what i could be missing.

AI Support Bot
Related Content
Synthiam
PRO
Synthiam
#1  
If you have the HBridge configured to use PWM, you may need more PWM...

The below code will set the PWM to FULL:)

Code:


ezB_Connect1.EZB.PWM.SetPWM(EZ_B.Digital.DigitalPortEnum.D2, EZ_B.PWM.PWM_MAX);
#2  
Thanks for the reply.
Updated it and still nothing. I went back to the ARC and work fine with the settings
I did attached a Screen shot of my settings in ARC.
Note:
when i bring up debug window and select connect i see it connected. But when i click on Forward or any other positions i get nothing from the debug window. I did put a break point and it is going into the click event.

Any other thoughts?
PRO
Synthiam
#3  
You can double click on buttons within a Form to view the code behind the event. You can also simply click on an object and view the Events that are assigned to it in the properties window.

If the breakpoint is not working, that is because the code is not executing.:)

My suggestion is to start with a crash course on C# and Visual Studio. If the HBridge is connected to the ports specified, the example works flawlessly. Also, if you press the manual direction buttons on Example 43, the EZMovementControl will also display the direction by highlighting the buttons in green. I reviewed the example to verify, it works. Good luck:)
#4  
Thanks for the input. I re downloaded the SDK and started straight from the tutorial 43. As you can see I only changed the ports which i am using. If you look at the watch window you can see the screen shot that the RightwheelTrigger and below values are not correct. Can they only be certain values?

User-inserted image
#5  
I did try to edit the value in the watch window and it wont allow me to change other then what it show in the watch.
#6  
Can someone verify this condition? Not sure why there is a 2 values in there.
I set it to D6 but this after the assignment.

ezB_Connect1.EZB.Movement.HBridgeLeftWheelTriggerB D1 | D2 EZ_B.Digital.DigitalPortEnum
#7  
Bump.. I'll have some time to day i will set up my motor controller to how the default digital pins come in the Example. But I think one of them i blew when i was getting another motor controller to work. If that is the case i would have to use other then the default pins.