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 motiondave » Sat 9. Feb 2013, 08:20

Continuing off topic.
I cannot see the 6 dof project as nothing except funding for them selves.
To retail such a beast would add 5 times the build cost.
User avatar
motiondave
 
Posts: 997
Images: 1
Joined: Tue 20. Mar 2012, 16:36
Location: Sydney Australia
Has thanked: 11 times
Been thanked: 13 times

Re: Arduino Open Source X-PID firmware

Postby ericRacer » Sat 9. Feb 2013, 13:58

motiondave wrote:Continuing off topic.
I cannot see the 6 dof project as nothing except funding for them selves.
To retail such a beast would add 5 times the build cost.


you 're right ! off topic ! ;) :D
User avatar
ericRacer
X-Sim Supporter
 
Posts: 80
Images: 36
Joined: Wed 28. Mar 2012, 15:04
Location: Canada, Qc, Jonquiere
Has thanked: 3 times
Been thanked: 2 times

Re: Arduino Open Source X-PID firmware

Postby telfel » Sun 10. Feb 2013, 14:31

Hi

Just had a 68 amp chinese H bridge running a 24 volt 180watt motor, fail after 5 secs run and motor stop

These H bridges to me dont have the correct size of terminals or tracks to handle the rated currents.

So been looking for an off the shelf high current 24 volt H bridge

Found the Talon Robot Speed controller which uses just RC PWM for direction and speed.

My question is how easy is it to rewrite the firmware and are their any disadvantages using this method of control

Talon manual attached

regards Terry
Attachments
Talon_User_Manual_1_2.pdf
(286.5 KiB) Downloaded 1095 times
User avatar
telfel
 
Posts: 108
Images: 54
Joined: Thu 22. Mar 2012, 19:05
Location: Borders Scotland UK
Has thanked: 2 times
Been thanked: 9 times

Re: Arduino Open Source X-PID firmware

Postby ericRacer » Sun 10. Feb 2013, 15:19

telfel wrote:Hi

Just had a 68 amp chinese H bridge running a 24 volt 180watt motor, fail after 5 secs run and motor stop



Your motor seem too small for your board : 68 amp x 24volt = 1632 Watts :o and your motor only 180 watt :shock: there are somethig wrong !

Did you protected your setup with fuse :?:


telfel wrote:Hi

Found the Talon Robot Speed controller which uses just RC PWM for direction and speed.

My question is how easy is it to rewrite the firmware and are their any disadvantages using this method of control

Talon manual attached

regards Terry


I didn't use this king of board but it seem working with phase locking, IMHO it is designed for working with VELOCITY control setup and not POSITION control :idea:

I used this formula for mine and i've got better and easier result than arduino PID librairie from brett beaureguard
http://public.iutenligne.net/automatiqu ... ntenne.htm

good lock !
User avatar
ericRacer
X-Sim Supporter
 
Posts: 80
Images: 36
Joined: Wed 28. Mar 2012, 15:04
Location: Canada, Qc, Jonquiere
Has thanked: 3 times
Been thanked: 2 times

Re: Arduino Open Source X-PID firmware

Postby sirnoname » Sun 10. Feb 2013, 17:05

If you like to rewrite the code for this controller you must first remove all the direction pins and pwm outputs. You need only one RC PWM for one motor. This PWM include the direction of the motor. Be carefull, some RC motor controller have a limited and slower backward speed.
After this you have to look and ask in the arduino forum for a script of a RC hobbyist which tells you a arduino sketch file which should work with this motor.
I.e. you have then a 0 to 255 motor speed control of this bridge where 127 is no movement.
After your samples are working with speed and reverse control you must combine both sketches to get back the pot feedback control.
You have to copy the sketch of the sample control into the xpid code. You get out of the X-PID PID function a -255 to +255.
Now you scale the PID result to 0 to 255 ( :2 +127) and use the imported motor control source with that value.
This is all you need but you have to make it with your own experience, that is the goal of this thread :)
Ask the arduino guys in their forum only for samples of PWM and your RC motor control, and do not ask the whole code, noone will program for you but help you with sample stuff.
Using a RC controller of RC models could be a nice idea for our forum. I do not know if such things are cheaper than the china solutions ...
Make a new thread if you decide to give it a try.
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, 00:59

Like eric says, the arduino with a FTDI chip has problems.
It seems to be communications error with atmel and FTDI chips because of the frequency.
Some have solved this with a special comport speed that is not 115200 but a little bit lower. Which frequency would be the best for the atmel 328?
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 tronicgr » Wed 13. Feb 2013, 01:27

Sorry for the intrusion but the problem lays in the arduino libraries. The serial communication commands they use are not optimized for speeds higher than 57kbps...

My latest AMC1280USB (that uses the ATmega1280 of an unmodified arduino mega pcb) can reach 500kbps with 16-bit data for 6DOF and 1khz updates on the serial transfer module. But Of course I'm not using the arduino IDE or its libraries, but my own custom code (assembly) that is highly optimized for this task, allowing other timing critical tasks (like PID math) to run along with it.






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

Postby sirnoname » Wed 13. Feb 2013, 01:40

The UNO R3 (own serial converter) is working without one error.
All arduinos with FTDI have problems. But I will try your FTDI settings tomorrow (serial printer, newest driver etc.).
It seems you have also a FTDI onboard.
My problem is: The firmware upload is done with 115200 without problems! (verified with serial port monitor)
After the upload the nano works better than after a normal connect.
Most of the sample software for the nano is 115200 and is verified with the nano hardware. (Do they lie?)
Setting the hardware lines (CTR, DTR) reduce the amount of errors.
In the worst case the arduino serial library will get removed but the others do not have such problems.

Regards,
Martin
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 tronicgr » Wed 13. Feb 2013, 02:06

The firmware upload is done correctly because it is implemented as STK500 ISP programmer bootloader. It was coded in assembly for specific reason to load the new firmware in blocks of data.

I don't think that setting that "serial printer" setting will solve much. I had to do it by direct manipulation of the Uart registers in my last firmwares.

Most of the sample software for the nano is 115200 and is verified with the nano hardware. (Do they lie?)


No they don't lie... It really works in 115kbps... but with long pauses between each data to avoid buffer issues! I don't use buffer anymore and that solved all my problems ;)

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

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

Yes I read about the buffer problem.
The problem of my detection are 4 character that are not detected. As far I have read the web, the buffer problem beginns with higher buffer counts.
Do you think 4 bytes are too much for this library and above 56kbaud?
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

PreviousNext

Return to Controllers and Drivers Projects

Who is online

Users browsing this forum: No registered users and 1 guest