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

Zaphod' motion controller

Discussion in 'SimTools compatible interfaces' started by zaphod42, Oct 26, 2008.

  1. zaphod42

    zaphod42 New Member

    Joined:
    Sep 21, 2007
    Messages:
    17
    Balance:
    3Coins
    Ratings:
    +0 / 0 / -0
    Thanos, I've been busy with this ATmega128 board and here are the updates.
    I Have modified serveral boards now both on the ADC's and the Timer 1 & 3 outputs.
    Circuit diagrams are now in a CAD format , gif exports are attached below.
    The code for the controller is comming along quite fine , howerver I first wrote the code for a simulator-simulator. I didn't want to have to set up a PC with the profiler running to test the controller or the hardware platform, instead I created a SPUOG (Simulator profiler universal output generator.) It uses the ATmega128 board.
    It generates the same data that the profiler does without requiring a PC running.
    It is used for testing interface hardware and platform motion testing. (without PC)
    Configurable from 1 to 6 DOF channels of data generated.
    Generates common 0x41 0x42 0xFF xx yy ect data string
    Configurable repetition rate from 10ms to 35ms
    Configuration is by RS232 terminal (HyperTerminal) @115.2kbs 8N1
    Configuration is automatically written to EEPROM for ease of reuse.
    6 x analogue inputs are used to generate the position data. (pots or joysticks)
    Number of DOF channels that are configured are displayed on lower LED row.
    Channel 1 & 2 position data is displayed on top LED rows as binary.
    Switch for operation or diagnostic & configuration modes.
    In the diag & config mode the data sent to the terminal is in a readable format. Hex byte value is converted to ASCII padded with spaces and CR/LF (ie 41 42 FF 7F 7F (CR LF)) :thbup:

    Having completed this it made it a lot easier to iron out the bugs in my controller code. This controller again uses the ATmega128 board and has the folowing features.
    3 modes of output from same controller board and firmware.
    1: RC servo pulse position modulation (PPM) 1-2ms @ 50hz.
    2: RC speed controller (1-2ms) with analogue potentiometer feedback using PID control algorithms.
    3: Hi speed PWM (0-100%) generation including direction/enable logic with analogue potentiometer feedback using PID control algorithms.

    Other Features.
    Takes profiler USO data at 115.2kbs 8N1 in the format 0x41 0x42 0xFF xx yy …..
    10 bit resolution in ADC and PWM
    Configurable settings below via RS232 Terminal (HyperTerminal):
    -Output modes: As described above.
    - PID control settings (modes 2 & 3 only)
    -1 to 6 channels: (LEDs display current settings and diagnostics)
    -Home position, max and min positions.
    -Soft limit settings. (for motor deceleration just before reaching max/min positions).
    -6 up to +12v inputs for use as Limit switches, Emergency stop, or Home position.
    -2 x NC relays for switching +5v and +12 or 24 v @ 5A (configurable for emergency stop/home or delayed start)
    Configuration settings are written to EEPROM .

    Features yet to be completed.
    Configuration menu.
    Second UART to display settings, and whilst running the incoming data, output data, position feedback and digital I/O status.

    I am hopeing to complete the firmware over the next couple of months but my day time work swings into peak load ( November - March). :thbd: I will send you one for testing when I'm happy with the firmware.
    I now have a larger number of these boards and hope to put them up for sale after the firmware is completed.

    Rock. :brows:

    Rocketbrd2v1.gif
    PortA1v2.gif
  2. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Re: Tronic's AMC motor motion-controller with pwm/servo output

    Hi zaphod42,

    Nice to hear again news from you. And I'm happy too that you found the capabilities of the Atmega128 board! It looks neat with all these features! :clap:

    Just a few things to ask:

    1. The PWM signals are just 0 - 100% output linear? Did you added two direction outputs per PWM channel (simple digital signals)? If yes, is the PWM signal inverted when you change direction for the motor? You will know why I'm asking these as soon you connect an h-bridge to it...

    2. Can you add 16-bit mode on receiving data from the USO? It will be especially useful on Profiler2.0 with the more available positions available. Also try to use Binary mode that is one less character than the HEX mode, which is faster!! On 16bit you send two bytes per axis.

    3. If possible reserve 2 inputs as I2C interface to be able to connect on these my new 16-bit Quadrature Encoder modules! These can be used on your PID servo code upgrading the position resolution from 1024 (10bit resolution of ADC) to 65535 (16bit resolution Optical encoders).


    Best Regards, Thanos :thbup:
  3. zaphod42

    zaphod42 New Member

    Joined:
    Sep 21, 2007
    Messages:
    17
    Balance:
    3Coins
    Ratings:
    +0 / 0 / -0
    Thanos, It looks like I'll have to get familiar with X-sim2 real quick , is there any serial number required to get it fully working?

    Also
    Yes , mode 3 does this, the two digital outputs (per channel) can be configured either complex H-bridge where the driver boards have a digital forward/reverse signal and/or a digital enable signal.
    Or it can also be configured to Simple (DIY) H-bridge mode where the 128 board controlls the FETs directly (smokeless with delay between switching from forward to reverse so both sets of fets are not turned on together).
    Also I should have put 100%-0%-100% PWM, is that better terminology?

    Note:
    Mode 2 uses standard radio controlled reversing speed controllers useing 1-2ms PPM. The position feedback is via pots (useing PID). (no extra digital outputs)
    Mode 1: is standard radio controlled servos' or 'super servos' with their own internal position feedback and control. (no ADC or extra digital outputs)

    Yes I could , but thats going to delay the release somewhat. I'm useing 9 registers to grab the input data now, R3 to R12, (R0 to R2 are for 16bit maths). To grab 16 bit data for 6 chanels will require 12 registers and the three preamble bytes (15 all up ),I don't want to use RAM as this will slow up the interupt. Its going to be tight but somehow I'll make it work.


    PDO/PD1 SDA & ACL are on the LCD headder that I am not useing as I am useing the second UART for display and configuration on either a terminal or serial LCD.

    I think the next thing will be to come up with interesting names for this controller, the ATmega128 board that I am useing and also this thread. Any suggestions?

    Rock (Zap) :hi:
  4. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Hi Zap,

    -Yes you need an activation serial key from Sirnoname to be able to use Profiler2.0 with external hardware.

    -I have used three signals per h-bridge (1=PWM, 2=Direction1, 3=Direction2) to save the available PWM channel signals, and used an 74HC08 multiplex chip to send the PWM to each of the two inputs of the h-bridge. This actually is less complex than using two PWM signals per h-bridge and controlling the FET's directly!! And you will be able to use all SIX available PWM channels for a 6DOF simulator!

    What I mean with the Bidirectional control of PWM is described in the next diagram:
    avr_bidirectional_mode_PWM.gif

    -I think that you already using 16-bit without knowing. The HEX numbers you send equals to 16bit characters in BIN mode!!!! Each HEX number is TWO bytes and you still have a number with 255 value max! One 16bit BIN mode number is TWO bytes long but you get 65535 values from it!!! In BIN mode you just receive the HIGH Byte first, then the LOW byte and add them together in a 16-bit variable! What you need is a little alterations of your code... BTW are you programming it in assembly??!!! WOW!!

    -Yes if it possible use the LCD port pins as I2C and let the rest of them free for future use. Using a terminal or Serial LCD on the second Serial port is making more sense!!!

    -Here are some possible names about your controller... :
    ...ZapMegaController
    ...6ZapMega128
    ...ZapConMotion :lol:


    Best Regards, Thanos :cheers:
  5. zaphod42

    zaphod42 New Member

    Joined:
    Sep 21, 2007
    Messages:
    17
    Balance:
    3Coins
    Ratings:
    +0 / 0 / -0
    Thanos, Yes I code in Assembler, not bad to learn.

    OK , 1 x PWM and 2 x digital out for each chanel now.
    Some comercial controllers use 1 x PWM, 1 x F/R and 1 x enable. Yours use 1 x PWM and 2 x F/R .
    I will write code to suit both (s/w configerable) and whatever else is used out there . ( everyone let me know please).
    I will drop the code for 2 x PWM per chanel , I'll let the external controllers do that work.

    I use mode 2: for my platform, (and just tested Mode 1 yesterday on some helicopter RC servos from ebay.)

    No problems on 16bit. Will get onto X-SIM2 soon.

    as for a name:
    ZUUM , pronounced ZOOM, stands for Zaps Universal USO Motion, nah thats got two universals in it .
    What about plain old ZMC,, 'Zaps Motion Controller' or 'Zaps Mega Controller'

    Back to codeing.

    Rock (zap).