Thanos AMC1.6 USB 2DOF Motion Controller

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.

Thanos AMC1.6 USB 2DOF Motion Controller

Postby tronicgr » Wed 4. Jul 2012, 17:48

Note: For my private development AMC1280USB 6DOF controller contact me at my email: tronickod@yahoo.com


AMC1.6 2DOF DC motor controller:

This is the next generation of my AMC motion controller. It was long time ago that I published my first version, that went through lots of revisions and fixes all this time. This new version is all easy to make and use.




I decided to go USB all the way that means that except from using usb for communications I also use it in this board for providing power and self-programming. No need for power supplies and power regulators anymore. No need for external programming circuits, no need for Ponyprog or anything. A few jumper cables and a few clicks and you are ready to go in seconds.


Here is a short list of the new features (to be expanded):

1. I'm using Atmega644 MCU running at 18.432Mhz. Older chips are going obsolete so why bother with them?
2. a. Sparkfun FTDI USB module for serial communications @ 115kbps.
    b. +5V power over the USB module. No more external power supplies.
    c. FTISP (FTDI In System Programmer) provided by the USB module. This solves the chicken and egg problem :)
3. The LCD is attached on the main board directly. Added trim potentiometer for LCD Contrast.
4. Except of using just potentiometers for feedback, quadrature encoders will be available in firmware update really soon.




IMPORTANT CHANGE TO FIRMWARE:
Starting firmware v1.1d , there is now option to change the KP settings for the motors on the start-up of the board. The procedure is simple, turn on the AMC1.6 board, fill out the following string in the simulatorstart field: KP~255~~<Y_KP_value>~~<X_KP_value>~ or for a more detailed example: "KP~255~~4~~6~" to set KP4 for the Y motor and KP6 for the X motor.



If you wish to SAVE permanently the settings you can use ONCE the following command format:
KP~254~~<Y_KP_value>~~<X_KP_value>~
or for a more detailed example: "KP~254~~5~~8~" to save KP5 for the Y motor and KP8 for the X motor. In this case an additional message will appear on the second line of the LCD "Saved KP Setting".



Just to note that if you stop the converter and start it again it won't try to set the KP values again until next time you cycle the power to the AMC1.6. A useful reminder is that the Flash memory of the ATmega644 cannot be overwritten more than 20000-30000 times so once to find the suitable KP setting, remove that SAVE command line from the simulatorstart field.





Below are all of the project files you will need to build it and program it.

AMC1.6PCB files.zip
(189.93 KiB) Downloaded 1425 times


AMC1.6_partlist.rar
(702 Bytes) Downloaded 1262 times



This a simple and powerful terminal to use to for KP parameter changes.
Terminal20111230.zip
(321.35 KiB) Downloaded 1084 times



The USB board I used is from Sparkfun:
Breakout Board for FT232RL USB to Serial

But I lately noticed cheap knock-offs on ebay:
FT232RL USB to Serial Module USB to TTL level for Arduino 2560 UNO R3 ARM A033


The USB interface is based on a FT232R chip from FTDI (http://www.ftdichip.com). This chip's primary function is to act as a USB->Serial converter, allowing the user to get serial data without requiring a standard RS-232 serial port. The USB interface can also be used to reprogram the firmware in the AVR processor using a special utility, ftisp. No USB programming knowledge is necessary to use the USB port.

The USB programmer works on the bit-banging principle. It uses some of the ports of the FT232RL chip to send the proper SPI programming commands. The firmware that is carrying the x-sim3 logo is included in the following files:

FIRMWARE History:

Firmware 1.1d
FTISP for AMC1.6 1.1d.zip
Updated on 21/jul/2012
(11.35 KiB) Downloaded 643 times


Firmware 1.1e with added 10% deadzone near the end limits of the potentiometers to save them from mechanical damages. Note that it limits the motion range to 201 positions.
FTISP for AMC1.6 1.1e.zip
Added 10% dead zone on end positions of POT (25/Jul/2012)
(11.32 KiB) Downloaded 619 times


What are the numbers on screen mean?


Firmware 1.1f defines the range of the end limits deadzone with a potentiometer connected on pot3.
FTISP for AMC1.6 1.1f both crystals.zip
(21.98 KiB) Downloaded 491 times

In the zip file you will find two versions of the firmware, one for crystal 22.1184Mhz and another one for crystal 18.432Mhz in case your atmega644 can't handle the overclocking and resets.
More information about firmware 1.1f on this post:
http://x-sim.de/forum/viewtopic.php?f=39&t=132&start=110#p1758

For example if you set 5%, its the limit to each direction, so if you have 180 degrees position sensor:

180/2 = 90
90 - 5% = 85.5 degrees
Total allowed degrees will be 85.5 * 2 = 171 degrees!!

Using the same concept you can reduce a 270 degrees potentiometer to 180 degrees, but you must remember that you should expect less resolution available. This function is there to do micro fine calibration not to abuse!



Firmware v1.1g
As the above but added a cut-off function for users to be able to turn off PWM and Direction outputs, thus setting the motor into brake. To use it just connect the "A1" pin from the encoder header to the GND through a switch. Or you can use multiple switches if you like all connected to that single pin.
FTISP for AMC1.6 1.1g both crystals.zip
Fixed wrong display items in 18.432Mhz firmware
(22.03 KiB) Downloaded 447 times



Firmware v1.1h (latest)



In this Firmware v1.1h, I fixed problems with ADC noise that was affecting the potentiometer accuracy. Also the program loop speed was increased now to 9000 times per second (offline) and 7000 times per second on-line (receiving serial data).
FTISP for AMC1.6 1.1h both crystals.zip
Fixed ADC noise, increased program cycle to 9000 times per second
(15.09 KiB) Downloaded 504 times




FTDI D2XX Direct Drivers (CDM) drivers must be installed (Get drivers here: http://www.ftdichip.com/Drivers/D2XX.htm).
D2XX drivers allow direct access to the USB device through a DLL. Application software can access the USB device through a series of DLL function calls.



In these photos you can see how I attached the USB module on the old board (AMC1.5) to test it.


And here is a example video of the USB programming procedure:



Also one more thing you have to take care is to the remove the little short jumper on the sparkfun board that ties the VCCIO voltage to 3.3v. This is needed as on the AMC1.6 board I tie the VCCIO voltage to 5V !!! Its really important to do that!! Here is some photos where is it:



OR if you have the most recent version of sparkfun's board just unsolder the pad that is named "3.3" and solder the "5" one!





Datalogging:


As you can see in the video, the new firmware now outputs a string with identification and some useful information about the position of the feedback potentiometers. The string is in the form:
AMC1611 255 1023 255 1023

Its plain text that can be captured easily with a terminal program or can be implemented easily into a x-sim plugin for graphical representation of the position of the motors. The string is sended from the AMC every 115ms to decrease the load on the Communications and leave as much free resources in the microcontroller is possible.




Motor Driver selection:
Although you can still make and use my old DSMhb1.2b from the old * site, I strongly recommend the use of more powerful and modern motor drives like the following:

Pololu High-Power Motor Driver 18v25 for use with 12v motors max ampere 25A
Pololu High-Power Motor Driver 24v20 for use with 24v motors max ampere 20A



Looking for a cheap substitute? Try these for half price of the pololu boards:
High Current Dual Motor Driver Module Board with Heat Sink


And here is the old DSMhb1.2b if you feel like making everything by yourself.

Position feedback options:

For position feedback of the motor you can use any kind of potentiometer fits your simulator type. It can be simple 270 degree or 10-turn or anything that exists out there. The potentiometer value should be in the range of 10K for best noise immunity.

Other option is to use hall-effect ratiometric sensors that they can define a 180degree rotation position by using two external magnets for reference of their magnetic flux. A nice model is the SS495A that works with 5v voltages and has almost full range 0-5v output with very little drifting.
Another possible sensor you could use for 360degree rotation is the AS5145H-HSST. It has both analog 0-5v, quadrature A-B and SPI digital interface!!

A quick demonstration of the calibration procedure of a SS490 ratiometric hall effect position sensor.
It shows how to limit the range of the readings of the sensor on the AMC1.6 board (same applies to AMC644USB)



The SS490 ratiometric hall effect sensors are a nice contactless solution for position feedback that needs only two magnets to read accurately angles from 0 to 180 degrees. This can replace potentiometers that are normally not designed for too much motion because of the friction and have generally limited life cycle.

Another possible solution would be the AS5145 Automotive Rotary Encoder IC. Positioning of the motor is done using its PWM output signal thru a low pass filter to get analog out signal. The absolute angle measurement provides instant indication of the magnet's angular position with a resolution of 0.0879° = 4096 positions per revolution.It also has SPI (serial interface) as well Quadrature A/B (10 or 12 bit) and Index output signal, that could be adapted for use in special application.
http://www.ams.com/eng/Products/Magnetic-Encoders/Rotary-Encoders/AS5145H




Assembly of an actual AMC1.6 board:

I finally received a PCB for this AMC1.6 project which was donated by Gilles (France) which I would like to thank very much!

The quality of the PCB is not the best around but it works, I guess I got too much spoiled by the excellent quality of my AMC644USB pcb's last year.





There is no silkscreen on the top of the board and it looks kinda empty with the long distances between the parts, so I decided to mount a silkscreen on the board using a printout on normal paper and glue it on the board using rubber cement. Worked just fine!! No wrinkles or mess as anyone would think!







So in less that 2 hours I had this assembled and programmed. All is working as expected!








So this is my "WHITE" version I guess, after choosing to make my other board AMC644USB all "BLACK" :lol:





This project is shared with all you for use in non-commercial DIY applications. If you like to use this for a commercial application please contact me.

Thanos
Attachments
xSimCTRLv2.2eng.rar
(329.55 KiB) Downloaded 826 times
AMC16_mega644_22mHz_byALE_fix3.zip
(13.15 KiB) Downloaded 660 times
Last edited by tronicgr on Fri 30. Aug 2013, 08:28, edited 26 times in total.
Reason: Uploaded new Firmware v1.1h
User avatar
tronicgr
Global Moderator
 
Posts: 591
Images: 11
Joined: Tue 20. Mar 2012, 22:10
Location: San Diego, CA
Has thanked: 105 times
Been thanked: 37 times

Re: Thanos AMC1.6 USB Motion Controller

Postby floriske » Wed 4. Jul 2012, 19:47

Great project thanos! Almost makes me doubt about my jrk's ;)

I'll try to fix the youtube bb code asap
I am no longer an admin/active moderator at http://www.x-sim.de. Please contact one of the other admins or moderators if you have any questions. Thank you!

My sim-project: Floriske.nl's 2DOF Playseat GT Wiper motor Project (sold)
User avatar
floriske
 
Posts: 239
Images: 96
Joined: Mon 2. Jul 2012, 10:23
Location: The Netherlands
Has thanked: 8 times
Been thanked: 6 times

Re: Thanos AMC1.6 USB Motion Controller

Postby tonquites » Wed 4. Jul 2012, 22:50

Thanos Hello, how are you?
I have good news, it is with great joy that I announce that I will build an AMC 1.6. :-D :-D :-D :-D

I have a doubt, I can fit 2 h bridges on my AMC 1.6 project under this scheme:



A big hug.
Everton

Mod edit: Please use the forum "upload attachment" for images as much as possible, images on imageshack will get lost over time. Thanks!
The myth always limits infinity.
User avatar
tonquites
 
Posts: 82
Joined: Thu 19. Apr 2012, 17:47
Has thanked: 4 times
Been thanked: 1 time

Re: Thanos AMC1.6 USB Motion Controller

Postby ferslash » Thu 5. Jul 2012, 06:07

thanos how much did you invested to asambly your new control card?
ferslash
 
Posts: 228
Images: 4
Joined: Tue 3. Jul 2012, 18:08
Location: Mexico, Guadalajara
Has thanked: 8 times
Been thanked: 1 time

Re: Thanos AMC1.6 USB Motion Controller

Postby tronicgr » Thu 5. Jul 2012, 17:37

@ Tonquites
Yes. It just splits the signals to the two pairs of h-bridges. I don't see why its not going to work.

@ Ferslash
Do you mean how much it cost? Or how much time it took me for the design and/or assembly of it?
I'm not sure about the cost, the PCB board was donated to me and I already had all parts in my lab for years now, so I can't really tell how much they cost now individually. For the design of it, it took me a few days as I already had much experience due to my old AMC1.5 board. For the assembly time, about an hour. It doesn't have so much parts as the old AMC1.5 did.

Thanos
User avatar
tronicgr
Global Moderator
 
Posts: 591
Images: 11
Joined: Tue 20. Mar 2012, 22:10
Location: San Diego, CA
Has thanked: 105 times
Been thanked: 37 times

Re: Thanos AMC1.6 USB Motion Controller

Postby vicpopo » Sat 7. Jul 2012, 22:56

hi Thanos and everybody.PCB cost : 12€ (the cheapest I found in France) ,one board (pcb+ components) costed to me about 65 € with all delivery cost.
:)
User avatar
vicpopo
Global Moderator
 
Posts: 554
Joined: Fri 20. Apr 2012, 18:04
Location: Strasbourg France
Has thanked: 33 times
Been thanked: 72 times

Re: Thanos AMC1.6 USB Motion Controller

Postby vicpopo » Mon 9. Jul 2012, 21:28

tronicgr wrote:Hi Gilles,

You have mixed up the firmwares... My firmware is not compatible to talk to ALE's control program!!! The datalogging feature is not intended for that!!

You need to load this firmware that is compatible with his control program:
AMC16_mega644_22mHz_byALE_fix3.zip


That's why you can't connect to it...!!!!!


Hi Thanos ,
OK I supposed that Ale's control program was compatible with your soft.
I progressed a little bit ... it doesn't work 100%.I not yet connected a motor , I have to finish all this thinks for testing the amc1.6 with Prilad softwares (the controler and the program in Atmega).
In fact I just would like to reproduce what you shown in your blog , that means for me that my board works .
I saw your video testing the AMC 1.6 with the controler and I saw that you connected the jumpers as like as the board programmation and that you removed the 3 jumpers attached near the 4 DIP Switches.
Do I do reproduce the same configuration for using the software?
I put a picture above.


http://img560.imageshack.us/img560/2633/capturedcran20120703144.png

Thanks Gilles
User avatar
vicpopo
Global Moderator
 
Posts: 554
Joined: Fri 20. Apr 2012, 18:04
Location: Strasbourg France
Has thanked: 33 times
Been thanked: 72 times

Re: Thanos AMC1.6 USB Motion Controller

Postby vicpopo » Wed 11. Jul 2012, 13:16

Hi Thanos,
As I said in my last e-mail I have some problems with amc1.6 + your dual H-Bridge 1.2b.
First : I replace the wrong transistors with the goods one (IRF4905) , but I always have a bridge which became KO .One Transistor, I don’t know yet which one, had overheated !!
I become a little bit crazy with this thinks , and I don’t know yet how I can solve this problem.
The other H-bridge seems to be OK , and when I launch Profiler and Sender with the test tablet , the motor starts and runs without any positioning (SS490 sensor used for positioning)
Amc1.6 :
- The main problem is that the board shuts down (collapsing) ant restarts continuously, when I launch X Sim (Profiler + Sender) and starting the auto mode (effect 21 with plugin  test tablet )
You can find a video attached below.


 
- One another problem is , when I launch the test tablet effect 21 for motor positioning tests , the values in the LCD for the axis don’t move !!
(Axis 1 Axis 2 Pot 1 Pot 2- The string is 128 128 580 650)
There are still in the same values 127(128).Normally the must change ! When I look at Profiler inputs the values change , that means that profiler has got this values.
I just reached sometimes (just once or twice) testing axis values changing during the test but I can’t reproduce this all the time.
 
I suppose that the amc collapse and can’t communicate properly with XSim  except the pot values but not 100%.Sometimes the pot values are fixed eventhought I move it but not like the axis values (most of time axis values fixed).
 
- Just for your Information , I tested the amc1.6 like you with the terminal soft with the new firmware (1.1).I ‘ve got the right values strings like you, the values displaying are : amc1611 128 128 550 560
And when I move the pot the values are changing in the terminal soft.
 
Thanks for your help , I became a little crazy !!

PS : I test with Xsim 2.089 for the reasons we spoke together , I can test with XSim 3.006 if you think that is a solution. But I wouldn’t understand that XSim 2.809 was the problem.
As you saw into the video I always have the jumper between the crystal case and the capacitor leg for a better ground.
I tried too to put a powered usb hub for connecting the board for more current but without success!
Regards
Gilles
User avatar
vicpopo
Global Moderator
 
Posts: 554
Joined: Fri 20. Apr 2012, 18:04
Location: Strasbourg France
Has thanked: 33 times
Been thanked: 72 times

Re: Thanos AMC1.6 USB Motion Controller

Postby tronicgr » Wed 11. Jul 2012, 15:40

Hi Gilles,

I see you are still running the v1.1 firmware on the video. I replaced that with a new one (v1.1c) that fixes some things. Look in the project files for the "FTISP for AMC1.6 1.1c.zip"

I would like you to try this firmware and tell me if it stops restarting when you try to send data.

As I told you before this firmware is not compatible with ALE's xSimCTRLv2.2 software, you should use his modified firmware to use that!

Thanos
User avatar
tronicgr
Global Moderator
 
Posts: 591
Images: 11
Joined: Tue 20. Mar 2012, 22:10
Location: San Diego, CA
Has thanked: 105 times
Been thanked: 37 times

Re: Thanos AMC1.6 USB Motion Controller

Postby vicpopo » Wed 11. Jul 2012, 17:14

Hi Thanos,
I will try and give soon some feedbak!
I do right understood that your firmware is not compatible with Ale's software xsim controler.eng v2.2.
Any help for your H bridge ? I know that you prefer now pololu driver but .
For the connections between H-bridge and amc1.6 ,do I connect P1D1 to M1M1, P1D2 to M1M2 ,P2D1 to M2M1 ,P2D2 to M2M2 ?
Regards
Gilles
User avatar
vicpopo
Global Moderator
 
Posts: 554
Joined: Fri 20. Apr 2012, 18:04
Location: Strasbourg France
Has thanked: 33 times
Been thanked: 72 times

Next

Return to Controllers and Drivers Projects

Who is online

Users browsing this forum: No registered users and 1 guest