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 » Wed 8. May 2013, 16:58

I did post this baud problem some pages behind without response.

The XPID communication is with checksum and save! The checksum error is zero on UNO R3 and zero on the others with 9600Baud.
Only the FTDI chips on most of the older arduinos do not get into the higher speeds. 9600 baud is stable on all arduinos and this firmware do not need any more speed if we compare the loop counter in the dialog. The question would be if a ftdi is able to make uncommon baud rates, which seems to be selectable.
We are free to use any baud rate, common or not. Tell me a comspeed which is in sync with 16MHz and around 100000 and we can try this baudrate. But as written, there is no need for a high baudrate, the communication is binary and without overhead.

USB cables should be 1,5m as maximum. The motor GND cannot be connected to the elctronic side. (YokoYokos post)
PWM frequency must be set low, else you might overheat your H-Bridge. The PWM offset is set to zero for first tests.
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 wlady » Wed 8. May 2013, 17:16

wptm wrote:
wlady wrote:I've conntected pots to analog pins A0 and A1; values are read correctly for 5 seconds about and then the software stops to read values.


What kind of pots do you use? I've had a strange situation with my cheap pots when I removed the stop cam to get free turn.
When it was positioned in the area where with the stop cam should not be, it's made a short and my arduino was blinking and restarting. Then I repaired it not to have there the sort.
So I'm just thinking if you have a similar situation there, after the 5 sec.

I still suggest to you not to change the original firmware. Just wire everything according to the red boards pins.
You can also do a test with leds connected to the pinouts of the arduino firmware. This is just to assure you, if the communication works between computer and arduino. I've just finished such a board for testing purpose.


I'm actually using two different type of pots (one poor quality, one medium) but result is the same.
I'll try with changing usb cable and baud rate and let you know

Thanks for feedback
wlady
X-Sim Supporter
 
Posts: 6
Joined: Wed 24. Apr 2013, 12:35
Has thanked: 0 time
Been thanked: 0 time

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

Postby tronicgr » Wed 8. May 2013, 17:17

sirnoname wrote: The question would be if a ftdi is able to make uncommon baud rates, which seems to be selectable.
We are free to use any baud rate, common or not. Tell me a comspeed which is in sync with 16MHz and around 100000 and we can try this baudrate.


I use custom baud rates with my FTDI chips all the time. I have no errors even in high 500kbps speeds!

The calculator I provided in my previous post can tell you what baud rates give 0 errors in 16Mhz clock speeds.

Thanos
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 » Wed 8. May 2013, 20:40

Ok, if I understand that calculator I enter 16MHz and make only the cross right near the edit box of 16MHz.
Then I search a baudrate with .00 as zero error. In my case "100000" or "125000". Is this correct?
Error have not special row in that tables.
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 » Wed 8. May 2013, 21:07

sirnoname wrote:Ok, if I understand that calculator I enter 16MHz and make only the cross right near the edit box of 16MHz.
Then I search a baudrate with .00 as zero error. In my case "100000" or "125000". Is this correct?
Error have not special row in that tables.



Correct... I used 125000bps for my digital dashboard v2 code (with twin display):
http://x-sim.de/forum/viewtopic.php?f=40&t=155&start=60#p7780

However, I had to do some tricks to keep the arduino nano from resetting at that speeds as its serial buffer was getting over-flooded. Its so hard to make the standard arduino libraries to work reliably!

Thanos
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 RafBR » Thu 9. May 2013, 18:35

Racerr87 wrote:
RafBR wrote:How many dof one arduino uno is able to control with the current firmware?
If I want to build a 4dof do I need to use two UNO's ?

Thanks!


Correct :) i believe the arduino is limited to 2 dof due to speed of calculation.


So how simple is to setup two or more ard's for more dof's? Anyone have it done to be able to explain?
The truth is that I may have to have five motors :shock: so I would have to get three ard's running together and I dont know if it is even possible :?

My regards!
User avatar
RafBR
X-Sim Supporter
 
Posts: 136
Images: 24
Joined: Tue 20. Mar 2012, 21:53
Location: Brasil
Has thanked: 6 times
Been thanked: 4 times

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

Postby wptm » Fri 10. May 2013, 11:35

Am I right that H-Bridge goes wrong if both direction for the same motor are open as well as the PWM at the same time? I've had an h-bridge from ebay, and I use recently my selfmade Thanos-Tronicgr dsmhb1.2 . Both went wrong already, I suppose due to that both direction was open. I've chosen dsmhb1.2 that I can repair it. I did repair it 2 times already.
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, 14:24

In my opinion and experience, Its mathematically matter of time to burn any h-bridge on a non balanced platform using DC motors. I was running my DSMHB1.2 without problems on my balanced joyrider and I only had to replace 1 mosfet just once, during the Athens Digital Week 2008, when a "heavy bone" news reporter was trying it and managed to touch the two metal motor towers together. So they still burned because of short circuit not from overload.

Seat movers are not balanced platforms no matter what. They get unbalanced as soon they lean a few degrees, in parabolic rate too.

So if you ask me what to use, I would propose AC motors... Why? Because even if the AC motor gets "locked" in place due mechanical error it WILL NOT burn anything. I have seen this first hand a few days ago during testing of the 6DOF platform, while experimenting with weird rod angles, BOTH front motors were locked FIRM to the front and the platform stuck nose down! Nothing burned, the motors just kept whining trying to re-position themselves, and not even the VFD's felt anything wrong was going on, to trip any safety errors faults for overload!!


Thanos
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 wptm » Fri 10. May 2013, 15:56

Thanks for your replies! The thing is that I have more frequently the smoke from the mosfets than it should. I've already ordered some replacement again.
However, until they arrive, I do some tests, and also having a discussion with other Hungarian builders about it. We believe in that the mosfets can be dead if both direction + PWM is open at the same time.
Well, I started to investigate if this can happen with this open source x-pid firmware. Actually I could simulate when both dirs and the PWM was opened. I did a video about it. At first I tried out the "Set Output" and "Clear Output" functions, as I did with my ebay h-bridge before. 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. If that the reason, then I still not safe as they can be wrong sometimes too. Here's the test video:


And then I've built a simple circuit which makes PWM off when both directions are open at the same time. I'm not sure, but believe in that it can defend my h-bridge. I've used in this video a custom arduino code to turn in one than the opposite and then both direction at the same time. You can see in the 2nd part, that if both direction + PWM is open then it makes PWM off. I could not try it with my h-bridge, as it's waiting for mosfet replacement. However you can tell me your opinion. Here's the video:
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, 16:22

Can I ask what PWM frequency the Arduino code is using?

Very high PWM can defeat the On-OFF timing of Mosfets and many of them have for example slower Turn-OFF than Turn-ON timing. So its very easy for the ON timing of two mosfets to overlap in a fast change of 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

PreviousNext

Return to Controllers and Drivers Projects

Who is online

Users browsing this forum: No registered users and 1 guest

cron