Beruflich Dokumente
Kultur Dokumente
INTRODUCTION
In this guide you can find some basic information and read about concepts for creating a motion simulator platform.
Using X-Sim software along with AMC and DSMhb electronic interface to drive two standard windshield wiper motors, developers
have made it possible to simulate motion in two degrees of freedom (2 DOF). By having 2 DOF available, immersion feeling achieved
is very good. It really feels like you're behind a wheel of a real race car, or in the cockpit of an airplane. Of course, there are many
different type of simulators, but if you're on a road of low budget, rather simple simulator, this is the way to go.
Further on, you'll find all information on how to make a micro-controller interface (AMC) and dual PWM motor driver (DSMhb).
This guide will also show you how to produce the PCB boards for electronic interface, and some tips on proper soldering of
components.
Step by step programming instructions for Atmel micro-controller using PonyProg software will also be shown and some instructions
on how to connect all the parts together.
It is recommended to use TWO separate PCs for X-Sim SW installation. Read more about it in X-Sim documentation!
All information regarding X-Sim software, its operation and user guides can be found on http://x-simulator.de
As you've read in the previous pages, there is an electronic component in our motion simulator. This component is made of two
parts. First is AMC, which is AVR Motion Controller, and the second is DSMhb which is DIY MOSFET H-bridge motor driver.
When you finish setting up your X-Sim software and you start it, USO component is sending some kind of data through selected
COM (serial) port to Atmel micro-controller. Program code (FW - firmware) running inside the AMC, process the data received and
specific results are converted to PWM signals. These signals are further processed by DSMhb circuit which finally operates the
motors connected to it.
There's no need to go into detail of this process because the theory behind it, is very well documented and can be found online, just
"Google" for it.
Main thing to understand is the "program code" or FW version used in micro-controller, and a couple more settings which enables
certain features provided with the FW used. The great thing about AMC board is that it already has a programming circuit built in.
You'll notice two DB9 serial connectors. One is for connection with X-Sim PC, and the other one is for connection with PC that is
running the programming SW. This port is used only during the AMC programming sequence, but it is a nice feature - no need for
additional programming boards.
Another important aspect of electronic part of motion simulator are "feedback potentiometers", which should be linked to motor
and they are giving the "return" information needed by micro-controller. This way, controller knows the position of motor, and
knows in witch direction to move them and how much, or when to hold them in one position. You'll se later how to calibrate the
travel of these potentiometers in order to determine the travel of motor arm.
Again, there are various types of motor controllers but mainly commercial ones and their price exceeds the price of DSMhb. If you
follow the basic instructions found in this guide, you'll have no problem finishing the build of it and making it operational.
As you probably know, there are companies that are producing the PCBs (Printed Circuit Boards). When you choose to use their
services you'll get professionally produced PCB, with all kind of protections, precision drilled holes, solder masks, .... but this costs a
significant amount of money.
If your circuit is so complex that it requires a multi-layered PCB (circuits shown here are not complex at all)
If you plan to use SMD components, or your PCB design requires "narrow" or thin circuit leads (not used here)
If you need mass production of PCB (2 boards or maybe 4 if you're building one extra sim for a good friend is not mass
production)
If you don't want to DIY or think you don't have the skills to DIY (read further and you might change your mind)
If you take a DIY road, this guide will show you how to do it. It is not that hard at all and this is rather cheap solution that results in
almost "professional-like" PCBs. You can even do a "silk" layer and protection film if you want. Don't be afraid to try, and don't
despair if you don't succeed at first try. Next chapter will help you not make too many mistakes, so you'll be able to produce nice
looking and functional PCBs.
In order to successfully finish PCB production, you're going to need certain items available. Following is a list of those items:
Printer paper (I'm using the paper for Color laser printers, it must be thicker/heavier than normal paper, and needs a glossy
finish)
Old iron (you can borrow mom's iron, it won't be damaged in the process)
2 pieces of pertinax or vitroplast board (160x100 mm) with coper on one side (pertinax is cheaper and easyer to drill holes,
vitroplast is hard to drill but it is almost transparent which makes troubleshooting the circuit easyer)
Hydrochloric acid HCl (or Muriatic acid, cheap chemical found in stores, mainly used for unclogging the drains, don't use
comercial products for drains!)
Hydrogen peroxide H2O2 (3% solution is most common, but you should use stronger, 10-12% solution as used for dying a
hair)
PLASTIC (PVC) dish big enough to fit the board (here you'll mix your etching chemicals, be sure it's PLASTIC)
Plastic dish big enough to fit in the previous one (here you will have warm or hot water to speed up the etching process.)
You don't need to use the second dish, but the etching process is significantlly faster if you do!
Safety equipment (surgical gloves or similar, protection glasses, old clothes or some kind of protective apron). Hydrogen will
bleach clothes, and acetone leaves staines also.
1.
2.
3.
4.
5.
6.
7.
8.
9.
This is a link for video clip showing the process explained above:
http://www.youtube.com/watch?v=QQupRXEqOz4
4.
5.
6.
Take the bigger PVC dish and fill it with hot water.
Fill the smaller PVC dish with 200ml of acid and 50ml of hydrogen, and finally put the board in, circuit lines facing you, so
you can see the progress. (ACID/HYDROGEN RATIO CAN VARY, try it and see what works best for you)
Carefully take the small dish and put it in big one, so the hot water can heat up the etching solution and speed up the
process.
You can gently move (like rocking the cradle) the smaller dish as it floats in order for acid to pass over coper side of board.
Depending of strength of hydrogen used, you should see some progress after a couple of minutes, and everything should be
done in 10-15 minutes max.
Take out the board and rinse it with water, use acetone to clean the toner.
Repeat the process with another board, and add more hydrogen if the process is slow. Best results are achieved by using
fresh solution after each board.
When finished, dispose the remaining solution keeping in mind that it will corrode metal parts. BE CAREFUL!
You can see the video clip on http://www.youtube.com/watch?v=MJ-I_6kgcRg , or you can find many more video guides about this.
AMC V1.5
PARTS LIST
Part name
ATMEGA8535-16PU
Quantity
1
Info
micro controller
DIL40
MAX232
DIL16
LM2940CT-5
BC547
transistor
18.432 MHz
crystal
1N5231
10 uH
10 K ohm multi turn
trimmer
1
1
10 K ohm linear
potentiometer
Picture
Part name
LED
Quantity
3
Info
simple light emitting diodes,
2 x GREEN, 1 x RED,
size doesn't matter,
use standard or small
Reset switch
1000 uF / 16V
10 uF / 16V
100 nF / 63V
22 pF / 63V
1.2 nF / 63V
47 K ohm
39 K ohm
15 K ohm
10 K ohm
4.7 K ohm
1 K ohm
470 ohm
270 ohm
220 ohm
DB9 connector
Picture
Part name
Molex pcb 2.54 / 3 pin
Quantity
4
Info
Molex or Nylon connector with 3 pins for PCB
mount
12
~50
LCD 16x2
DEM16217SYH-PY
computer jumper
1
1
Picture
PCB LAYOUT
Print out the following picture and use it for toner transfer method!
IT IS WISE TO CHECK IF HOLES ON PRINTED PICTURE MATCH THE SPACING ON COMPONENT PINS!
Simply place the DIL40 socket to its place in picture and check if pins and holes match. There's been cases when durring the
printing process, image has been scaled down, so pay attention prior to toner transferring.
Layer marked with YELLOW colour is component layer. It shows the upper side of board. You can see finished board
on next pages, so use it as a reference. Be carefull with components orientation, check twice!
Real picture
Mark on PCB
Before you continue to programming section, you must find out how to connect your LCD. As mentioned in parts list, you should
chose an LCD that is compatibile with HD44780 LCD chip. Most LCDs found on the market are good choice, but you should
check the datasheet for the LCD you have. Following picture shows how to connect the LCD and AMC board:
Usage
Backlight + (anode)
Backlight - (chatode)
Vss ground terminal
Vdd supply terminal
Vo supply for LCD
RS
R/W
E
DB4
DB5
DB6
DB7
In order to sucsesfully program the AMC, you need to insert "five wire bridge board" that makes connection between MOSI, MISO,
SCK, Reset and GND pins on AMC board. This bridge board can be made on a peace of "perf board", or you can just conect five wires
between appropriate pins. This connection is used only durring "flashing" the micro-controller. Take a look at following pictures:
Connect the COM port of PC running PonyProg2000 with programming port of AMC board using straight serial cable, set all four dipswitches to OFF position, conect "short 3-pin cable" to Rx sockets on AMC board, and continue with the next chapter.
Connect the 9V DC power supply to AMC, and you should see two GREEN LEDs glowing.
LCD connected to AMC should show black squares in top row, which is OK since AMC is not programmed.
fig.2
If you need USB to SERIAL converter shown in fig. 2, it is recomended to use one that is based on "FTDI chip" (this chip is inside, so
you probably wont be able to see it, but check for it on the product package or in product specificaion found online.
It is highly recomended not to use "Prolific chip" type of adapters, or very cheap ones from unknown manufacturors!
These adapters are not working properly with PonyProg SW!
In some cases, a serial port connector can be found somewhere on the motherboard. It is a classic serial port, but you need to plug
extension cable with metal bracket and mount it on PCs rear panel (see fig.3). Check your motherboard manual before opening the
PC case.
fig.3
Before going further, we need to check the settings for serial port (COM port) on our PC.
Using "Hardvare or Device Manager" search for "Ports" and highlight the one you want to use (if more than one). Right click on it
and choose "Properties". Use the fig. 4 and match your settings as shown.
fig. 4
All MS Windows have similar COM port settings page.
You need to set only the basic parameters, there's no need to
go into advanced settings.
Just select the proper COM port number if you have more
than one.
If you have a PCI modem card installed you should see COM3
in your list - don't use this!
If you need to use USB to SERIAL adapter, it will probably be
shown as COM4, COM5, ...
Remeber this COM number! You'll need to set it in PonyProg
later!
The last hardware part you'll need to perform the programming is the serial cable. This cable is called STRAIGHT SERIAL CABLE or
SERIAL EXTENSION CABLE (see fig. 5 for detailes).
fig.5
PonyProg2000
Asuming you have managed to setup the
"Pony" application, start it and click OK in the
welcome screen.
In the popup window click YES. After a couple of seconds, you should
see Calibration OK notice window. Click OK and procede to next step.
Download the AMC firmware zip archive named PWM_AMC15_2DOF_v1 firmware.zip using following link:
http://www.x-simulator.de/forum/download/file.php?id=613
Extract the files from archive. We will be using the file for 18 MHz crystal.
In FILE menu item chose OPEN PROGRAMM (FLASH) FILE...
Browse for the firmware file PWM_AMC15_2DOF_V1_CRYSTAL18.HEX and select it, than click OPEN.
File will be loaded and you can see "raw" FW data. Click on
COMMAND than chose PROGRAMM.
You'll see a window with information related to erasing ,
writing and verifying the data. Durring this process, RED LED on
AMC board will be ON.
When the process is finished, you'll see "Program succesfull"
message box, and AMC LCD should show the info about the
firmware version. CLick OK to continue.
To be sure that flashing process is done properly, you can do
the "read" proceure again.
As soon as the "program" (WRITE) procedure finishes, the red LED will go OFF, and you should see the starting of AMC program
code, and finaly there should be FW version visible.
Now you should remove the bridge board, and turn ON dip switch 1, to be able to see tha status data.
You can press the "reset" switch to test the AMC starting
procedure.
If you can see status data, and other information on LCD, you
can proceed with connections for feedback potentiometers,
and calibration of potentiometers travel.
Since the setup of Kp parameters require that the AMC has 2-way
communication, you have to also use a second molex cable to connect the two
TX connectors:
HyperTerminal use:
For entering the Kp parameters of the motors you have to use the windows HyperTerminal to have access in
the simple user interface of AMC. This terminal user interface uses the same com port on the AMC, which is
used for receiving motion data. No more need to flash different firmware to change the Kp parameters!
HyperTerminal is hard to find (or get it going/running) if you're using MS Vista or W7, but you can use
Putty or TeraTerm to achieve the same results. Any working terminal client application will work OK, as
long as it has "serial port"communication feature available.
TIP: For SimForceGT motion its recommended to use the same Kp parameter values for both motors or else
the motion might not be synchronized! But you can repair a slow motor in SimForceGT motion simulator by
increasing a little its Kp until it matches the faster motor!
Enter new value for Y-axis KP (3-30):7
Enter new value for X-axis KP (3-30):5
Y-axis KP=7
X-axis KP=5
Save changes to internal epprom memory? (y/n):
It will then ask if you want to save the changes you made
in the internal epprom memory so they can be used
each time you power the AMC automatically You can
press y or n here, and press Enter.
Procedure is aborted!
Another message will also show that indicates you switch off the DIP2 to continue the normal operation of the
AMC. It will also suggest to remove the 5-wire programming clip cause the circuit of the ISP programmer pulls
up the DIP2 data line if left connected resulting in leading the AMC into setup mode each time it power up:
Switch off the DIP2 or remove the programming 5-wires clip...
ote: The first time that you run this firmware you will see that the Kp values for both Y,X axis are 255 (FF).
This is normal. If you cycle the power or reset the AMC board, an internal safety check I installed will save
automatically the default values of Kp=3 for both Y,X axis. This is the same internal safety check that prevent
you from entering values smaller than 3 of bigger than 30 as Kp parameters as they are the absolute limits inside
that the software can operate.
Calibrating the potentiometers travel
We came to the point of connecting the feedback potentiometers. As you probably know, pots have tree pins and it is of vital
importance to connect them properly to AMC. Next picture will help you do it the right way:
When you find a way to mount the potentiometers and connect the pot and motor
shafts together, you might have the need to change the wiring so the travel of pots and
motors are synchronized. If this is the case, you should only swap + and - pin on pots,
leave the middle "washer" pin as it is!
I'm using 270 degrees cheap potentiometers, because they give enough info for the
whole circuit to work properly. You could use multi-turn potentiometers that give you
much more precise information for moving the motors, but they are more expensive
and eventually you'll need to replace the pots as they get warned out. If you decide to
use multi-turn pots, you'll need to deal with gear ratio to achieve the proper pot/motor
travel and mounting the gears is more complicated than just mounting the pot.
As mentioned before, AMC LCD shows the status data. In top row of LCD there are four groups of numbers. For calibrating the
pot/motor travel we will use the third and fourth group.
DSMHB V 1.2B
PARTS LIST
Part name
74HC08
Quantity
1
Info
Quad 2-input AND gate
DIL14
IRFZ44N
IRFL44N
N-Channel MOSFET
IRF4905
P-Channel MOSFET
BC546
transistor
LE diodes
2 x RED,
2 x GREEN
1N5819
Schottky diode
1N5245
100 uF / 63V
Electrolytic capacitor
3.6 K ohm
2.2 K ohm
1.5 K ohm
680 ohm
160 ohm
Picture
Part name
2 pole terminal block
Quantity
4
Info
For connecting motors and motor power supply
16
Picture
PCB LAYOUT
Print out the following picture and use it for toner transfer method!
IT IS WISE TO CHECK IF HOLES ON PRINTED PICTURE MATCH THE SPACING ON COMPONENT PINS!
Simply place the 10 pin molex connector to its place in picture and check if pins and holes match. There's been cases when
durring the printing process, image has been scaled down, so pay attention prior to toner transferring.
MIRRORED PICTURE READY TO BE PRINTED ON GLOSSY COLOR PRINTER PAPER
Layer marked with YELLOW colour is component layer. It shows the upper side of board. You can see finished board
on next pages, so use it as a reference. Be carefull with components orientation, check twice!
When you finish etching the DSMhb board, it would be wise to thicken the leads for motor power (pcb lines going from mosfet
terminal block connector to motor terminal connectors). The best way of doing this is to place solid copper wire to follow the thick
pcb lines, and fill it with solder. It can be tricky to achieve this, but be patient and you'll make it. Another way is to melt down
enough solder wire on to thick PCB traces, so at the end it looks like youve used the copper wire Ive mentioned. The final result
should look similar to following picture:
Be sure to remove all the FLUX residue left after soldering! Easiest way to do this is by using various products found on the
market. These products are good but often pricy, so as an alternative, you can mix acetone and alcohol and achieve the
same results. Main thing is that you need to be sure that there are no flux residue left, because sometimes flux can cause
short circuits!
Next is placing the resistors. To avoid the trouble of holding them during soldering, bend a little their legs and cut them.
Next thing to place is the Schottky diodes. Pay attention when you place the ones that are crossing the wire bridges. Place them a
little bit further (higher) from the PCB, to be sure theyre not touching the wire bridges.
Next place the status LEDs, the SIP header for the jumpers, the IC base and the transistor bases as well. You dont need to use the
bases for BC546 transistors, but it is a good idea so you will be able to replace them easily if needed. Next are the Terminal
Connectors, the Molex header and last the big capacitors.
After you are ready, prepare the Mosfet legs by bending them to fit in the terminal connectors sockets and screw them as hard as
you can! During this procedure, be sure to discharge the static electricity off your body, by touching often a grounded device: i.e.
the computer case
Dont forget to also place the transistors in their base sockets too!
If you are not using loads that draw more than 5Amps, you can skip placing aluminum coolers on the mosfets, but if you are going
for large loads that draw up to 25Amp its more than important to use aluminum coolers bolted on the mosfets and if possible, using
some silicon paste between the contact to allow better heat transfer. You should use 8 aluminum coolers pieces bended in 90
degrees but must be careful to not let each other contact as the mosfets are sitting on different potential each other and any such
short circuit, will blow them off!!
As you can see in the photos, I used just one bolt with a plastic distance holder, which holds the pieces pretty strong against the
mosfets. Between the mosfets and the heat sink pieces I used polysynthetic silver thermal compound (particularly the Arctic Silver5)
that is usually used in computer CPU coolers!
When you mount your motors to simulator frame, try to isolate it by using non-conductive materials. This way you wont
have to open the motor housing and deal with internal wiring to separate ground leads from housing.
You should consider using safety circuit breakers (fuses) for motor supply lines. It is good to start with lower values for fuses
(10Amps), and increase it later if needed when all other things are tested. This depends of many things, including type of
motors used, frame construction, racer weight, ...
Version
Editor
Change
1.0
*Thanks to Martin Wiedenbauer for creating and sharing the X-Sim software with the world!
Date