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

    egoexpress Active Member

    Joined:
    Dec 13, 2006
    Messages:
    3,839
    Location:
    Germany - Frankfurt/M
    Balance:
    421Coins
    Ratings:
    +10 / 1 / -0
    Fortunately wiper motors cost just 15Euros ;)
  2. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    I must congratulate the greek posting office... the parcel with RN-VN2 DualMotor arrived yesterday, but I can't pick it up until Monday morning!! :evil:

    Me and my luck... :(
  3. 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
    believe me, the german post isn´t better, i am happy if packages arrives at all ;-) Good to hear the new status!
  4. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Hi to all,

    I have good news!

    First of all, I picked up the RN-VN2 this morning. Intact! :D

    During weekend I had some progress on the controller. I programmed it to recieve on 38400 and move two simple servos...

    The resuls are good. Its very fast and picks up even the smallest changes on acceleration data! Next is programming the servo code for the HB-25 with feedback pots, and try some PWM driving now that I have the RN-VN2 motor controller...

    BTW, using the LCD helped me alot to debug the output!!

    I'll use simple potetiometers for feedback for now leaving the use of optical encoders for next week (I hope). Another thing I want to do also is to find a proper crystal to be able to archieve 115200bps baud without sync errors!


    Regards, Thanos
  5. 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
    I just wanted to say thx tronicgr!

    I’m pretty excited to build this interface and start collecting parts for the simulator. :D

    So I thought I’d ask if the following parts would be safe to buy before the interface is completed.

    HB-25 Motor Controller Two Pack
    http://www.parallax.com/detail.asp?product_id=29150

    AME 12v 212 in-lb gear motor
    http://www.robotmarketplace.com/marketp ... s_ame.html
    Maybe you know of better gearmotors / drivers?

    Anyway, thanks again tronicgr, hope progress goes well for you.

    yobuddy
  6. egoexpress

    egoexpress Active Member

    Joined:
    Dec 13, 2006
    Messages:
    3,839
    Location:
    Germany - Frankfurt/M
    Balance:
    421Coins
    Ratings:
    +10 / 1 / -0
    @yobuddy

    perhaps you'll get the motors cheaper on the junkyard.
  7. tronicgr

    tronicgr

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

    As Ego said it would much cheaper to get these wiper motors from a car junkyard!

    And HB-25 is a nice motor controller. But I think you should wait a little to see the results with the PWM RN-VN2 motor controller that will have more direct and faster responce to full reversing situations!

    Thanos
  8. egoexpress

    egoexpress Active Member

    Joined:
    Dec 13, 2006
    Messages:
    3,839
    Location:
    Germany - Frankfurt/M
    Balance:
    421Coins
    Ratings:
    +10 / 1 / -0
    Btw, it should pe possible to control some servo valves with your interface :happy:
  9. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    I had this in mind when started working on the old interface with the simple servos, but the prices of these servo valves were too high to go this way. Another one could attach a simple servo on a hand operated valve to have simular effect... :?
  10. egoexpress

    egoexpress Active Member

    Joined:
    Dec 13, 2006
    Messages:
    3,839
    Location:
    Germany - Frankfurt/M
    Balance:
    421Coins
    Ratings:
    +10 / 1 / -0
    RaceRay mentioned this method some month ago. This was the initial idea of my post. Yes you are right!

    But afaik RC servos only have a turn angle of 60 degrees!??
    I have some manual valves, but they need ~15 turn to fully open/close.
    Perhaps with some bigger sized valves than my 1/8 ones.

    But this is another topic...

    BTW, do you need some translation of the RNV2 driver module pdf-file?

    ego
  11. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Well a normal servo won't do, but a modified one can!

    You can use a normal DC motor with gear reduction box, and a multiturn potetiometer (I have seen some big metalic ones with up to 20 turns on a local electronics shop) that are driven by a HB-25 motor controller same way I do in the old interface. :D

    Or you can even use the standard electronics of a simple servo if you use the same size motor altering only the potetiometer with a multiturn.

    The real challenge would be the way of the mounting of the motor on the hand-controlled valve along with the pot. :roll:

    If anyone is still using pneumatics, and is willing to try this method I could start making such controller (in a new topic) that is easier to implement. I have all the nessasary code parts ready for this purpose... :D

    @ Ego,
    Thanks, I already translated all the parts I needed of its datasheet!

    Thanos
  12. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    AVR motion board development news

    Hi to all,

    I had some progress on the interface. I fixed various issues with inteferences during ADC and archieved 115200bps stable serial communication speed by overclocking the chip from the standard 16Mhz to a 24Mhz crystal!!! Its running very fast now! It responds instantly compared to the old BS2 interface! And its even faster if I ommit the display of the data on the LCD! I roughly measured the entire cycle of the code to a 2ms!!!! WOW! That was fast! And adding the rest of the code (PWM, encoders, etc) it won't go more than 5ms.

    In the video you can see how fast is the position control of the simple servos, that by the way are a little slow from their nature, to follow the position commands! I control the servos with 5ms refresh rate (via interrupt) and they consume 4 times more power than in the BS2 setup due to constant positioning that occurs many times in a x-sim cycle data packet... I wonder if the same happens on the wiper motors when using PWM!

    http://www.youtube.com/watch?v=S5RaAWBxb08


    I haven't much time to also try PWM driving since I had to resolve the astable ADC function to have some feedback about the position. Now the ADC has 9 bit resolution (0-1023). For these tests I'll have to construct a demo setup with the smaller motor (w/encoder mounted on its axis to also test encoder driving).

    Another thing I must do is to chance the ATmega8535 to a ATmega16 that have available 4 hardware PWM channels.

    See the test table I use to program and debug the controller! Ugly isn't?

    [​IMG]


    Until now the new controller seems promising even if many parts of its functions need to added and cooperate toggether without conficts.

    Thanos
  13. egoexpress

    egoexpress Active Member

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

    I hope it will be possible to use 16bit encoder reading.
  14. 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
    Simply spectacular! :D

    Can’t wait to build one!
  15. RoVoR

    RoVoR New Member

    Joined:
    Sep 12, 2007
    Messages:
    19
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hi Thanos,

    First of all i wan't to thank you for doing this great project..

    I folow your work for some time now and i'm impressed by your work.

    When i look at your test table it's starting to look rather complicated for me, I have no knowledge of electronics. I hope it will be possible to build one myself. Like yobuddy i can't wait to start building.

    I love the hardware accident..............
  16. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    No, I thank you, and all other for your patience waiting...

    The final controller won't look like this at all. It will be a small PCB board!

    And if you can't build it for yourself you can give it to an etching service to prepare the board for you. Then its only placing the compoments on it and programming the firmware with a serial cable...!

    This hardware accident wasn't the only one, just the funniest! :)

    Thanos
  17. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    I hope the same too! Or else I'll have to dedicate the encoding task to some ATtiny13...

    Thanos
  18. egoexpress

    egoexpress Active Member

    Joined:
    Dec 13, 2006
    Messages:
    3,839
    Location:
    Germany - Frankfurt/M
    Balance:
    421Coins
    Ratings:
    +10 / 1 / -0
    Let me explain why we need that much resolution.

    For example. You have an actuator with high pitches what causes that the screw does not brake itself when cutting the current off. So the positioning has to be holded by the motor and its PWM.

    If the controller has to hold the position, it has to fix the actuator between two encoder-steps. If these steps are too far away from each other, then the actuator will rumble much.

    I think it will be better to do it like you mentioned before. Using some Atinys for 16bit decoding and PWM.

    regards
    ego
  19. EvanF

    EvanF Member

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

    I agree with ego,

    Example from trials: With my motor planatery gearhead setup it freewheels if it is not held by PWM power. With the analogue pots, I have tried 10k and 100k, it still searches slightly for centre. (sirnoname mentions this is a common trait with ADC) So the result is it jitters while being held even if opposing forces are set at 255 pwm on a total motor brake. But then again I do not think I am using 9bit, my steps only go up to 255.

    So I am keen to trial digital encoding to see whether I can remove the jitter while centering, although I think analogue will still have its uses for people with different motor systems - and it is cheaper and less complicated!

    I also have a linear actuator (WIP) that is being modded by a mate. Target speed is aimed at 150mm/sec+. The base plate has been made and now I need to source a motor to drive the pulleys. The pitch of the screw is 10:1. I doubt this will freewheel as fast as the planatery gearhead system but there will still be a bit of 'sponginess' because instead of a wiper motor (like yours) rotating the screw it will be ..say a.. 2800rpm 200W motor and 3:1 pulley arrangement (300rpm=50mm/sec).
    I would like to test this with your controller board too, your board is going to be a very versatile board once it is perfected! :top:

    Evan
  20. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    I believe that 9bit ADC resolution (0-1023) and 10turns multiturn pot will perform the positioning very accurate! If you consider that I use only a half turn pot (90 degrees) in my simulator, it will be more than enouph for driving and holding accurate positions with PWM.

    After all some ramping will be used on the PWM driving to avoid overshouting and oscillations. Don't worry the ramping will be very small maybe 10 values of the 1023 of the ADC... and I can make this ramping adjuastable for various types of motors or even totaly disabled if the motor gearing can handle this.

    I bought a 10 turns multiturn pot to use with the test table setup and it will be connected to the DC motor that will be driven with PWM. These multiturn pots are kind expensive (I got mine for 13euro!!!) but will be ideal to use in the place of optical encoders for start.

    One other thing i'd like to ask you (evanf & ego), what is the best format for the PCB board? I design them in PCBexpress and printing the trace lines side on PDF. Is that enouph for you to be able to replicate it? And if you had to give the PCB board to an etching service, a PDF print would be enouph? Or they also need more info (for the holes position etc?).

    Regards, Thanos