Arduino Open Source X-PID firmware incl.360°option

AMC, H-Bridge projects etc.
Please use the image gallery for your pictures, a short tutorial can be found here.
The first image in the first post will be shown in the project gallery.

Re: Arduino Open Source X-PID firmware incl.360°option

Postby sirnoname » Fri 10. May 2013, 17:04

I wrote this could be a problem, the standard is at 31kHz and the lower is 3,9kHz (selectable via plugin).
I think anyone should start with 3,9kHz.
The 328p does not support much frequencies, this two on the known PWM outputs, the other outputs are only with one frequency interesting.

I personally think this is a question of over current protection. As far I have looked at the china bridges and thanos bridge: they do not offer this.
The LM298 do! Ok less power but they have a over current protection. The JRK seems to have one but it does work on temperature as far I *

When I pushed "Clear Output" both dirs and the PWM is on. Of course it can happen due to that I have not attached the pots.

No, cannot happen - I thought this was fixed with the current version? This was the brake option and I changed this to be both ground.
This makes it impossible:
Code: Select all
//Motor 1
   if(motordirection1 != oldmotordirection1)
   {
      if(motordirection1 != 0)
      {
         if(motordirection1 == 1)
         {
            SetMotor1Inp1();
            UnsetMotor1Inp2();
         }
         else
         {
            UnsetMotor1Inp1();
            SetMotor1Inp2();
         }
      }
      else
      {
         UnsetMotor1Inp1();
         UnsetMotor1Inp2();
      }
      oldmotordirection1=motordirection1;
   }


analogWrite(PWMPinM1, 0); should kill the pwm at motor stop. Motor stop is the only situation where both pins and pwm are the same.
The direct port manipulation will switch with four CPU cycles, where the arduino code needs ms.
If a answer is correct or did help you for a solution, please use the solve button.
User avatar
sirnoname
Site Admin
 
Posts: 1829
Images: 45
Joined: Thu 1. Sep 2011, 22:02
Location: Munich, Germany
Has thanked: 35 times
Been thanked: 128 times

Re: Arduino Open Source X-PID firmware incl.360°option

Postby CraCk » Fri 10. May 2013, 17:21

wptm wrote:We believe in that the mosfets can be dead if both direction + PWM is open at the same time.

Look here. Maybe this will help solve the problem.
http://mal4x.ru/viewtopic.php?f=6&t=245
CraCk
 
Posts: 10
Joined: Sat 16. Jun 2012, 10:32
Has thanked: 1 time
Been thanked: 0 time

Re: Arduino Open Source X-PID firmware incl.360°option

Postby sirnoname » Fri 10. May 2013, 17:32

Hi crack, this help in electronic way but we like to solve it with less components.
As written above there may be something missing in the stop possition or outdated code.
If a answer is correct or did help you for a solution, please use the solve button.
User avatar
sirnoname
Site Admin
 
Posts: 1829
Images: 45
Joined: Thu 1. Sep 2011, 22:02
Location: Munich, Germany
Has thanked: 35 times
Been thanked: 128 times

Re: Arduino Open Source X-PID firmware incl.360°option

Postby tronicgr » Fri 10. May 2013, 17:42

Maybe if there was a dead gap around the target position? Something bigger than just one value to give time to mosfets settle down before changing direction?
User avatar
tronicgr
 
Posts: 624
Images: 11
Joined: Tue 20. Mar 2012, 22:10
Location: San Diego, CA
Has thanked: 130 times
Been thanked: 50 times

Re: Arduino Open Source X-PID firmware incl.360°option

Postby CraCk » Fri 10. May 2013, 17:43

sirnoname wrote:Hi crack, this help in electronic way but we like to solve it with less components.

You can only use 74НС14 without 6n136
sirnoname wrote:As written above there may be something missing in the stop possition.

Sorry do not understand this sentence. Translator does not work on this site In Russian and Ukrainian language :(
CraCk
 
Posts: 10
Joined: Sat 16. Jun 2012, 10:32
Has thanked: 1 time
Been thanked: 0 time

Re: Arduino Open Source X-PID firmware incl.360°option

Postby sirnoname » Fri 10. May 2013, 17:50

Code: Select all
As written above there may be something missing in the stop possition.

I will say: check the code! There are different versions at this point. Only the last one do set to GND instead of HIGH.
The directions pins cannot be both high in the latest code!

The old code with HIGH on direction pins was for my own H-Bridge because this bridge supports the brake option on both GND or both HIGH.
In one of the first posts, here in this thread, we discussed this is bad for other bridges and it was changed.
If a answer is correct or did help you for a solution, please use the solve button.
User avatar
sirnoname
Site Admin
 
Posts: 1829
Images: 45
Joined: Thu 1. Sep 2011, 22:02
Location: Munich, Germany
Has thanked: 35 times
Been thanked: 128 times

Re: Arduino Open Source X-PID firmware incl.360°option

Postby tronicgr » Fri 10. May 2013, 18:46

Well. depending on the potentiometer quality, there is going to be noise in the ADC line that will make the direction pins "flicker" faster than you might be able to see it even happening. Again, that might lead into ON timing overlap of both mosfets that form an h-bridge.
User avatar
tronicgr
 
Posts: 624
Images: 11
Joined: Tue 20. Mar 2012, 22:10
Location: San Diego, CA
Has thanked: 130 times
Been thanked: 50 times

Re: Arduino Open Source X-PID firmware incl.360°option

Postby sirnoname » Fri 10. May 2013, 19:25

This plugin/code has a pot feedback deadzone which is set to not jitter and can be increased if needed.
If a answer is correct or did help you for a solution, please use the solve button.
User avatar
sirnoname
Site Admin
 
Posts: 1829
Images: 45
Joined: Thu 1. Sep 2011, 22:02
Location: Munich, Germany
Has thanked: 35 times
Been thanked: 128 times

Re: Arduino Open Source X-PID firmware incl.360°option

Postby wptm » Fri 10. May 2013, 19:34

Thanks again for everyone!

You're right Sir! I was using xpid.ino v1.3 when I did those tests. Now I've upgraded it to the latest v1.4. And did a similar test. Now there was not that both directions + PWM were on at the same time. If you are interested in, I did a new video of this test:


CraCk wrote:Look here. Maybe this will help solve the problem.
http://mal4x.ru/viewtopic.php?f=6&t=245

Thanks! A nice solution indeed. I was learning Russian in the school, but I needed google translate. Well, at least I can still read cyrillic.
User avatar
wptm
 
Posts: 64
Images: 57
Joined: Tue 29. May 2012, 21:43
Location: Hungary
Has thanked: 8 times
Been thanked: 4 times

Re: Arduino Open Source X-PID firmware incl.360°option

Postby tronicgr » Fri 10. May 2013, 22:57

BTW... to prevent resets when using arduinos with x-sim: http://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection

A simple resistor...
User avatar
tronicgr
 
Posts: 624
Images: 11
Joined: Tue 20. Mar 2012, 22:10
Location: San Diego, CA
Has thanked: 130 times
Been thanked: 50 times

PreviousNext

Return to Controllers and Drivers Projects

Who is online

Users browsing this forum: No registered users and 1 guest

cron