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.

AMC1.6 complete1.JPG (684.9 KiB) Viewed 33445 times

AMC_1.6_USB.jpg (126.07 KiB) Viewed 33445 times

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.

AMC_1.6_USB_white.jpg (200.18 KiB) Viewed 33445 times

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.

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:

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.1gAs 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.

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).

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.

Ft232R_SPI.gif (18.76 KiB) Viewed 33445 times

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

USB_programmer1.JPG (287.65 KiB) Viewed 33445 times

USB_programmer2.JPG (207.81 KiB) Viewed 33445 times

USB_programmer3.JPG (241.2 KiB) Viewed 33445 times

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:

Soldered 3v3 VCCIO short.jpg (87.03 KiB) Viewed 33445 times

Unsoldered 3v3 VCCIO short.jpg (84.24 KiB) Viewed 33445 times

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!

new ftdi sparkfun board DSC04725.JPG (445.66 KiB) Viewed 33445 times

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:

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.

AMC1.6_PCB quality1.JPG (657.56 KiB) Viewed 33445 times

AMC1.6_PCB quality2.JPG (647.06 KiB) Viewed 33445 times

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!

AMC1.6_PCB paper_silkscreen1.JPG (471.01 KiB) Viewed 33445 times

AMC1.6_PCB paper_silkscreen2.JPG (423.87 KiB) Viewed 33445 times

AMC1.6_partial.JPG (349.84 KiB) Viewed 33445 times

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

AMC1.6 complete_bottom.JPG (681.89 KiB) Viewed 33445 times

AMC1.6 complete2.JPG (501.64 KiB) Viewed 33445 times

AMC1.6 complete3.JPG (764.97 KiB) Viewed 33445 times

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

AMC1.6_next_to_AMC644USB.JPG (518.53 KiB) Viewed 33445 times

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.

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

@ FerslashDo 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.

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.

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 560And 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!RegardsGilles

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 ?RegardsGilles