1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Tronic's AMC motor motion-controller with pwm/servo output

Discussion in 'SimTools compatible interfaces' started by tronicgr, Aug 30, 2007.

  1. EvanF

    EvanF Member

    Joined:
    Jun 10, 2007
    Messages:
    199
    Occupation:
    Multimedia Producer
    Location:
    New Zealand
    Balance:
    423Coins
    Ratings:
    +1 / 0 / -0
    Hi Thanos,

    pots viz encoder:
    Trying out a multiturn pot was going to be my next approach to solve my jitter problem. The problem with having most of the weight supported by the motors on my setup (the spring takes up some) is you feel every vibration from the motors. I feel this is a good thing but means it is very sensitive to change and needs to be taken into consideration when designing. If there is such thing as a 20 turn pot I could direct drive the pot off the motor shaft which spins 40x per 1 revolution of the output shaft. This shaft is way smoother and less prone to lateral movement as the output power is less and it does not have a crank to sway movement. I have destroyed 3 pots now due to excessive force and movement from the output shaft where the pots are driven from.

    The idea of an adjustable ramp factor sounds interesting. Would this be adjustable by only flashing the firmware or will you adjust it by incrementing with an external button? Wow I could step my acceleration factor manually? Would it mean the lower the ramp step value the less the PWM/motor/seat position holding power, as it climbs from 0~255PWM slower? In this way I guess you could tweak the jitter factor (if any) like tuning a cars idle?

    I would like to try both your analogue and digital solutions and will let you know the results of both, if the analogue is successful, for me, I see no reason to over complicate with additional digital encoders.

    PCB etching.
    I can work with PDF, I print to a transfer and if need be can scale to fit on paper first. PDF is a universal file format and I'd be very surprised if a decent professional etching company couldn't open it.

    cheers
    Evan
  2. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,307
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    49,505Coins
    Ratings:
    +5,109 / 18 / -0
    @tronicgr may I ask what program you use to print to PDF, I have a laser tag board drawn up in PCBexpress that id like to get into PDF format.

    Thanks!
    yobuddy
  3. egoexpress

    egoexpress Active Member

    Joined:
    Dec 13, 2006
    Messages:
    3,839
    Location:
    Germany - Frankfurt/M
    Balance:
    421Coins
    Ratings:
    +10 / 1 / -0
    PDF format is OK!

    Using a 500mm actuator with 10bit results in 0,5mm per encoderline. Thats is imho too much and will cause tremor in braking mode when driving the actuators directly (no ramp).

    I just would like to hear that you'll maintain the possibility of using 16bit encoders.

    I'd like an adjustable/detachable ramp too :)

    ego

    EDIT:
    I've tought 9bit are 512 :confused:

    1bit-2
    2bit-4
    3bit-8
    4bit-16
    5bit-32
    6bit-64
    7bit-128
    8bit-256
    9bit-512
    10bit-1024
    11bit-2048
    12bit-4096
    13bit-8192
    14bit-16384
    15bit-32768
    16bit-65536
  4. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    I guess, that in the final design I will have to add a series of small avrs (maybe DIP8 package) that will drive the pwm of the motors and communicate back with the amega16 that will coordinate their actions for various motion configuration setups (frex, rnr, 3DOF etc...). This will be a second PCB that will plug on top of the main one. I opt for this to have support for 4 motors.

    The same will be done probably for the encoders too as a third PCB board to be able to support 16bit encoding of the optical encoders.

    The way I see it most possible to go with: The main atmega16 PCB board will receive the serial data in 115200bps. It will transmit then the position data to the second board with the pwm drive avrs serially in 19200bps. In simular way the results of the encoding process will be sended from the third board (with the encoding AVRs) back to the main PCB serially again in 19200bps as feedback for the atmega16 to know how to proceed in coordinating the motors.

    As I go further on this I see that this kind of process sharing is nessasary to maintain the accuracy in motion and encoding... :eek:

    It so much simpler driving servo controllers like the hb-25, and this new controller looks to me like the holy grail of simers! :)

    Ego, don't worry, I will try to add as much features is possible, even if I eventually end up using a more simple setup for myself! :D
    You are right! I confused them a little, I'm using 10bit resolution for the potetiometers, and 9bit resolution for the PWM of the motors!! :oops:


    yobuddy, I use adobe professional7 that attaches to any program as simple printer!


    Regards, Thanos
  5. EvanF

    EvanF Member

    Joined:
    Jun 10, 2007
    Messages:
    199
    Occupation:
    Multimedia Producer
    Location:
    New Zealand
    Balance:
    423Coins
    Ratings:
    +1 / 0 / -0
    Hi Thanos,

    I am trying to find some suitable (and affordably cheap) multiturn pots here down under (Pacific region) that will also conform to your new X-sim/PWM controller design.

    As you may already know the pot mounting is becoming the achilles heel on my motion chair. I have already destroyed 3 with complete mechanical failure at the slider contacts. I am now relocating them to the rear drive shaft of the motors away from the mechanical action and will try multiturn pot for better resolution. I have tried 10k and 100k ohm (single turn) and the difference in impedance doesn't appear to make any improvements in the feedback ie. searching for exact value has the same slight jitter +/- when over correcting. (btw this is where the big support spring helps in supporting and dampening motion and isn't exactly only there to support weight of platform as motors are powerful enough to do this, the point of compression tension is tuned to body weight of average person and thus is the '0' point of washout, and in fact not only in max negative but also in max positive heave state the spring works against the motors!)

    My question is:
    Do you think using a 10 turn 200ohm 2W pot will work on your new board. Not sure if 200 ohm will be high enough resistance but it is still 10 turns and they are cheap at NZ $9 each for 3.
    http://www.trademe.co.nz/Browse/Listing ... =122152822
    Features:

    - 10 turn precision wirewound potentiometer with precious metal contact and high rotational life.
    - Stainless steel shaft and precise bearing guarantee a very smooth running action.
    - Very high resolution and extremely fine linearity.
    - Ideal and economical application for industrial and professional equipment.

    Specifications:

    Resistance: 200 ohms
    Shaft: 6mm diameter
    Terminals: gold plated solder lugs
    Linearity: small than 0.15%
    Mechanical life: greater than 1,000,000 turns
    Power rating: 2W 70C
    Slider current: max 50mA
    Temp. coefficient / Range: 40PPM/C nom.(wire) -55C to +125C
    Rotational noise (ENR): max 100 ohms 1mA
    Dielectric strength: 1200VAC
    Torque: 0.2-0.5Ncm
    Rotational angle: 3600 degrees

    Based on these specs I am assuming that the ADC doesn't require 50mA to respond to input, perhaps this input current is a lot less than 50mA?. Therefore I could put a 1k resistor inline with the pot to protect from overheating and yet still maintain sensitivity? Do you think this logic is sound?

    Your thoughts appreciated!

    Thanks in advance.
    Evan
  6. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Νο, 200 Ohm potetiometer will not work. It will have huge loss of resolution and lots of heat!

    And using a 1k resistor in series with a 220 Ohm pot is useless. It will just limit the resolution to a small area say 20% of the full 0, +5v swing. Its just not going to work.


    A good range of potetiometers that you can use is from 10K to 250K.

    To understand to benefits and losses of each type:

    Using a 10Kohm pot will have less resolution (best if its used in 8bit reading) but it will be also less sensitive to noise if you are using long unshielded lines.
    Using a 250Kohm potetiometer will give you the best resolution (perfect for 10bit resolution) but you will have to use shielded lines to protect the signal from noise.
    A middle solution can be using a 100Kohm potetiometer.

    Regards
    Thanos
  7. EvanF

    EvanF Member

    Joined:
    Jun 10, 2007
    Messages:
    199
    Occupation:
    Multimedia Producer
    Location:
    New Zealand
    Balance:
    423Coins
    Ratings:
    +1 / 0 / -0
    Hi Thanos

    Thank-you very much for that very useful piece of information. It has clarified what parameters I should seek and given me a rule of thumb to work to.

    Probably that's why those 200ohm multi-turn pots are cheap, although precision made they have limited or specific use only.

    Pity, I am finding good multi-turn pots expensive down here in NZ.

    In the meantime I have bought 50 quality linear pots ranging from 22k ~ 220k for $NZ20. That should keep me able to play happy until I can source some multi-turns!
    http://www.trademe.co.nz/Electronics-ph ... 180052.htm

    Evan
  8. EvanF

    EvanF Member

    Joined:
    Jun 10, 2007
    Messages:
    199
    Occupation:
    Multimedia Producer
    Location:
    New Zealand
    Balance:
    423Coins
    Ratings:
    +1 / 0 / -0
    Hi Thanos,
    How is your new hardware PWM interface coming along? :D
    I'm sure there are a few of us who are curious of your progress! :idea:
    EvanF
  9. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Hi EvanF

    I wanted to have something more meaningfull to show to you but since you keep asking for news I cant deny you.

    I took a short video of the PWM control tests I've made so far. I took some pics too to see the condition of my office with all these electronics taking all over and the mess is keep growing.

    http://rapidshare.com/files/64146451/PWMtest1.wmv

    PWMtest01.jpg

    PWMtest02.jpg

    In this video I controlled the position of the motor manually with a pot to show you the rapid changes of direction. The crappy dc motors (with gearbox) are from a toy and produce lots of whinning sounds with PWM. And their gearbox tended to keep rotating cause of the inertia even if I fully reversed the direction. I wonder If the same happens to the wiper motors...


    I now use these crappy dc motors fom a toy because I had a little drawback with the DC motor I used (the one with the encoder). I was trying to remove the ball bearing on the tip of its axle and after much try I was getting angry and started hitting it with a france wrench. But after I tryed to get it back on work I found out that I had also braked its commutator carbon contacts inside it!!! :-( I'll try to get another cause I really liked that it had its own encoder. But I may not get the chance to dissasemble such large printer that contained it soon so I will search the local market for such motors or just the encoders if I get lucky.


    Anyway I had not much free time to implement much more because I also had some hard work to be done on the joyrider. I changed the steel pulley cables with a BUS type engine belt. It turned out real pain in the ass because the belts I bought was 10cm longer (I could not find excactly 2meters long that I needed) and I had to add more pulleys to archive the proper tension. And I had to unbolt many, many, many bolts to pass the belt thru the pulleys! Now I have yet to buy some large clips to be able to hook the frames with the belts too. This conversion is nessasary to keep the joyrider in one piece when I hook on it the new controller for pwm tests on its motors cause I little fear of the new angry pwm motor controller!!

    new_belt_01.jpg

    new_belt_02.jpg

    new_belt_03.jpg

    After all, it looks good and its thousand times more durable than the simple coated wire that needed tensioning after some hours of using the simulator.


    Regards, Thanos
  10. EvanF

    EvanF Member

    Joined:
    Jun 10, 2007
    Messages:
    199
    Occupation:
    Multimedia Producer
    Location:
    New Zealand
    Balance:
    423Coins
    Ratings:
    +1 / 0 / -0
    Hi Thanos

    Thanks for your update. LOL :razz: You must forgive my enthusiasm in asking you for updates, I think your PWM controller will be very cool.

    Is that a pic of your lady friend on your comp...very niiiice :roll:

    Your office is a lot tidier than my den so I wouldn't be shy about it!

    In the video are you only demonstrating speed control and not the servo function? When the motor changes direction have you coded the H-Bridge to act as a brake as well, I am wondering why there is inertia?

    I have found some encoders in NZ, could you have a look at the specs and see if I can implement them? I'd appreciate it!
    http://www.trademe.co.nz/Electronics-ph ... 759160.htm
    I just bought some pneumatic Festo solenoid valves off the same guy and that's how I found the encoders. I want to try pneumatics for my striking actuators as I don't think I will find electrical solenoids with a long enough throw to hit users on the body with enough force. They only have a 4mm O/D hose so probably not suitable for any real force (moving body weight).
    http://www.trademe.co.nz/Toys-models/Ot ... 757305.htm

    Where did you get those pulleys? I am trying to find some too. They're not the sort of thing you can find in a handyman store.

    You must have a heck of a job making sure all those nuts don't unwind with vibration! locktite?

    You are right your sim looks a lot more meaty and staunch. Really cool.

    Regards
    Evan
  11. RaceRay

    RaceRay Administrator Staff Member SimAxe Beta Tester

    Joined:
    Nov 8, 2006
    Messages:
    4,656
    Occupation:
    Self-employed | Web and application development
    Location:
    Hamburg, Germany
    Balance:
    23,864Coins
    Ratings:
    +2,007 / 13 / -0
    My Motion Simulator:
    2DOF, DC motor, SimAxe, SimforceGT
    Hi Thanos.

    i look every day for some updates, and i am reall happy to see, that there is some progress :)

    Maybe that encoder would be worth a try:
    http://www.shop.robotikhardware.de/shop ... cts_id=135

    Only 120cpm, but the encoder can handle up to 20Khz and ist effordable.

    The new belts of your joyrider are great. I could imagine, that the movements are more smoother, now, due to the little bumping effect of the belts. I am sure they won´t brake even a 10 cylinder 400HP engine would be connected, :freude: but the metalconstruction could be the Achilles' heel at very high speeds.

    kind regards, René
  12. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0

    I don't mind asking me for updates. Sometimes I focus building things and forget to inform you guys how it goes.

    The pic on my desktop... I wish! I thought you could recognize Angelina Jolie!! :D

    In the videos I did demostrate servo control using the toy dc motor with the multiturn pot mounted on its axle. But since the pot needs many revolutions to reach each end, it seems like doing speed control, check closely...

    I didin't had the chance to do servo tests with the pot on the older dc motor (that included encoder) before I broke it. So only speed control is showed on this.

    The link you gave me is refering to a dc motor with encoder. Anyway any type of optical encoder is good as long as it has A & B channel output 90 degrees out of phase.

    You mean those small golden pulleys with ball bearing? Yes they are very common here, many hardware store has them, they cost 1 euro each!! Generally all the parts of my simulator are bought from more than 10 different hardware stores!

    And yes I used locktite on every sigle nut on the simulator (we are talking for more than 200 bolts and nuts!!!!)


    The belt I used is from a Mercedes BUS (2 meters long!) and is usually used inside an engine! I found it on a local shop that sells bus parts. (I was repairing their computers and gave me two such belts for 10 euro... :) )

    Thanos
  13. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    I've seen those encoders before, and now I'm thinking I should have bought two of them along with the RN-VN2 motor controller... But I am thinking if it's worth all this trouble to place another order from them...

    Regards, Thanos
  14. EvanF

    EvanF Member

    Joined:
    Jun 10, 2007
    Messages:
    199
    Occupation:
    Multimedia Producer
    Location:
    New Zealand
    Balance:
    423Coins
    Ratings:
    +1 / 0 / -0
    Hi Thanos

    The info from the link I gave you says:
    100ppr Encoder has A & B channel, 90 degrees out of phase. Vcc input is 5V DC, encoder outputs are TTL compatible. We've hooked the encoder up to a frequency counter & read 8900 Hz with no load at 12v. That works out at about 5340 rpm, motor without gearbox runs about 5600 rpm.

    From your answer I guess that means yes it will work. I've never played with encoders before, I wouldn't know where to start but at least I know I can get some fairly cheap (12 euro) that will work with your new board. I could use the included motor for a bbq rotisserie!

    Thanks
    Evan
  15. skratchbilder

    skratchbilder New Member

    Joined:
    Oct 22, 2007
    Messages:
    4
    Balance:
    - 60Coins
    Ratings:
    +0 / 0 / -0
    Hi Thanos,

    I have been following your work silently... and I have just one word for you... AWESOME!!!

    Please keep us updated about the progress.

    Regards,
    Madhu.
  16. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    AVR MOTION CONTROLLER BETA v001

    I finished debugging most of the avr motion controller’s issues and I'm ready to give the first, limited features, beta version for you to test its response on your motors. I also fixed the PWM frequency and now it runs on 23,47khz, very quiet, at last! I connected a simple pot on directly on the motor axis and had enough precision on positioning without much ringing. So using multiturn pots is not always necessary.

    On the video you can see accurate position with a simple 270dergrees rotation Potetiometer aligned directly with the motor. Almost not ringing is shown when it tries to position itself. I had tried the same thing with BasicStamp2, long before, but it wasn't working at all, it just oscilated back/forward.


    PWMbeta001.wmv


    You can connect two RN-VN2 controllers on it and control four motors but with a small restriction. The last two motor channels will run on 8bit PWM. This is a restriction of the Atmega8535, as it has only one 16bit timer that is shared on the channels for the two first motors. Anyway 8bit PWM isn’t that bad and can be used in heave or rotation that precision isn’t so critical.

    Unfortunately I could not find an Atmega644 chip that has six full featured PWM channels and a large number of free pins. Maybe in the next version for the 6DOF simulator! But I’ll try with an Atmega168 that also has six PWM channels even if it’s some sort of more difficult, since it has too little number of free pins to be able to control more than three motors. It needs a port expansion chip and more complicated programming but it can be done… later…

    Back to the stuff we have for now.

    AVRmotioncontroller1_3pcb.gif

    [​IMG]AVRmotionsimulatorcontroller1_3.pdf (424.13 KB)


    [​IMG]AVRmotioncontrollerpartlist1_3.txt (0.55 KB)


    Some technical details:

    Motor 1,2 run on 9bit PWM on 20Khz (9bit = 512)
    Motor 3,4 run on 8bit PWM on 20Khz (8bit =256)
    Has 8 ADC channels with 10bit resolution (10bit=1024)

    EDIT: Actually I drive the motor on 10-bit resolution! 0-511 for one direction of the motor and 512-1023 for the other direction!!! Same double resolution is used for motors 3,4 (9-bit)!

    Some description of the features of that beta v001 has:

    -It uses only the first two motors for now: The pin header on the bottom (named rn-vn2) that can be connected to the JP1 header of an rn-vn2.

    -It uses only two the first two pots. Pot1 is position feedback for the motor1 and Pot2 is position feedback for the motor2.

    -Don’t forget to align the position pots with the motor or the motion travel route to successfully have position feedback.

    -When powered both motors should move to center position. If not immediately disconnect the power and reverse the motor +,- connections to turn to the opposite.

    -Disabled the display of data on the LCD except from showing its firmware beta version on start up. Then its pins are used by the second RN-VN2 interface.

    -It runs on serial speed of 115200 and you have to enter the setting of the following photo in the profiler USO to get it connected right:

    USObeta001.gif

    The format of the output string is “AB~255~~y~~x~”
    The ~255~ is there for compatibility reasons to be able to also test with Ian’s BFF 3DOF driver!!

    -As you know I have overclocked the Atmega8535 from 16Mhz to 24Mhz. To be able to run on this speed you must change the fuses to allow external crystal clock source as seen on the next photo:

    Fuses24Mhz.gif

    Since the AVR controller has its own serial programmer included (ISP) you can use ponyprog to easily program the flash firmware on it and set the proper fuses for the crystal speed. I will show you in a next post how you can use ponyprog.

    Below you can see the new layout I made to be able to follow the RN-VN2 connection standards. PCB plans are included to built this board if you want. Over this layout I’ll add the rest software features to make it able to fit to every type of motion simulator. Other PWM motor controller can be used too since they use the same basic connections (PWM, Enable1, Enable2) just different layout of the connection stripe.



    The Beta001 firmware is here:

    [​IMG]beta001firmware.zip (17.97 KB)


    I included several versions with different response time for each to tell me what is working best so to set the range for the trim pot in the next version. For start try a small kp number like PWMBETA001kp3.HEX or PWMBETA001kp4.HEX and then load bigger kp number firmware until you reach to a point that your actuator goes unstable and starts ringing back and forth while searching for its position.

    Ego, I must say to you that this version is still for joyrider 2DOF motion style. I’ll implement Frex style cooperated motor drive motion for your sim next. Just try it to see the speed response of your motors and the accuracy of position for now. Then if your frex motion goes well I’ll make a 3DOF too for EvanF.


    NOTICE TO ALL: This is a BETA version and I’m not held responsible of any damage happens to your motors, simulator structure, you, etc. Use it on your own Risk!! You should know that motion simulators can be very dangerous if not handled with care!


    Well, that’s it for now. Have good times testing it.

    Regards, Thanos
  17. egoexpress

    egoexpress Active Member

    Joined:
    Dec 13, 2006
    Messages:
    3,839
    Location:
    Germany - Frankfurt/M
    Balance:
    421Coins
    Ratings:
    +10 / 1 / -0
    Great news! Thanks for the layout!

    I've ordererd it already. I'll try to report back soon. Its a little difficult right now, as I do not have that much time like the months before.

    BTW, you could place a pic of your joyrider in the profiler ;)

    regards
    ego
  18. Alle

    Alle Member

    Joined:
    Sep 16, 2007
    Messages:
    34
    Location:
    Italy
    Balance:
    283Coins
    Ratings:
    +2 / 0 / -0
    Great work Thanos. Congratulation.

    Thank you very much to share your work.

    Regards,
    Alle
  19. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,307
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    49,505Coins
    Ratings:
    +5,109 / 18 / -0
    Looks Great!
    Thanks bro!

    yobuddy
  20. EvanF

    EvanF Member

    Joined:
    Jun 10, 2007
    Messages:
    199
    Occupation:
    Multimedia Producer
    Location:
    New Zealand
    Balance:
    423Coins
    Ratings:
    +1 / 0 / -0
    Thanks Thanos,
    Will let you know how I get on.

    cheers :top:
    evanF