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

Postby tronicgr » Wed 13. Feb 2013, 02:26

Probably. It depends if you are using HEX or Binary. HEX is twice the length and the buffer might run out if not emptied in time.
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

Postby sirnoname » Wed 13. Feb 2013, 02:36

I will get into it tomorrow,
n8t
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

Postby sirnoname » Wed 13. Feb 2013, 11:26

http://binglongx.wordpress.com/2011/10/ ... unication/

Given the design of Arduino architecture, generally the controller runs the foreground code in loop(). When an interrupt happens, the foreground code is suspended and the corresponding interrupt service handler (ISR) is run. If the controller is running an ISR and another interrupt happens, the new interrupt’s ISR is not run until the current ISR returns (no interrupt on interrupt). Because the UART has 3-char buffer, this means if another ISR is ongoing and does not return timely, when the UART ISR runs it could be too late and a new character could have been lost if the 3-char buffer is full. From the perspective of code, one character is missing in the received characters. This is called UART buffer overflow. HardwareSerial then reads the received characters and puts them in its 32 or 128 buffer for client fetching, often from loop(). If this buffer is full, the character is not stored and is discarded, and therefore it is another chance to have a missing character from the perspective of HardwareSerial user. This is called HardwareSerial buffer overflow.


This is hard! 3 bytes OK, my 4 bytes are a big problem. Now I have to find out why the ISR is delayed and why the UNO R3 is working good.
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

Postby sirnoname » Wed 13. Feb 2013, 12:19

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

Postby wptm » Thu 14. Feb 2013, 10:37

Hello Friends,

Can you please look if the following dual h-bridge
http://www.ebay.com/itm/New-3-36V-Dual-H-Bridge-DC-Motor-Driver-Peak-60A-Controller-for-Robot-Smart-Car-/221187919149?pt=LH_DefaultDomain_0&hash=item337fd3cd2d
is compatible with this topic's Arduino solution? It costs with shipping $ 30,98.

Thanks!
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

Postby sirnoname » Thu 14. Feb 2013, 10:56

Yes, one inp pin is not used and the script must be changed to PWM 0 instead of 255 as written in a former post.
It should also work with other prilads firmware but must be checked.
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

Postby prilad » Thu 14. Feb 2013, 11:30

wptm wrote:Can you please look if the following dual h-bridge
http://www.ebay.com/itm/New-3-36V-Dual-H-Bridge-DC-Motor-Driver-Peak-60A-Controller-for-Robot-Smart-Car-/221187919149?pt=LH_DefaultDomain_0&hash=item337fd3cd2d
is compatible with this topic's Arduino solution?


Yes, It should be work, I agree with Sirnoname.
User avatar
prilad
 
Posts: 174
Images: 1
Joined: Tue 3. Apr 2012, 14:20
Location: Dubna, Moscow reg., Russia
Has thanked: 3 times
Been thanked: 37 times

Re: Arduino Open Source X-PID firmware

Postby wptm » Sun 17. Feb 2013, 11:42

Thank you Sirnoname and Prilad! I've ordered it, as well as the Arduino UNO R3. I'm already investigating XPID.ino file.
In the time they will be delivered, I want to understand this script.
Do you mean Sirnoname that in function: void SetPWM()
analogWrite(PWMPinM1, 255); need to be analogWrite(PWMPinM1, 0); , as well as for PWMPinM2 ?

Regards,
wptm
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

Postby sirnoname » Sun 17. Feb 2013, 15:35

You got it!
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

Postby rohithkumar » Sun 17. Feb 2013, 22:19

Hello every one,

I am happy that i found this post :D
I have recently started working on 2DOF scaled version. Can any one please provide me X-PID interface plugin for X-sim???
rohithkumar
 
Posts: 25
Joined: Sat 26. Jan 2013, 21:45
Has thanked: 0 time
Been thanked: 1 time

PreviousNext

Return to Controllers and Drivers Projects

Who is online

Users browsing this forum: No registered users and 3 guests