FPGA-based Controller for Kinematic Systems

Robot Projects

Re: FPGA-based Controller for Kinematic Systems

Postby Matt Denton » Sun Aug 02, 2009 1:20 pm

Cool!

I will give it a go on my Ubuntu machine next week some time. :)
Matt Denton
AKA: Winchy_Matt

micromagic systems ltd
Matt Denton
Site Admin
 
Posts: 1556
Joined: Tue May 20, 2008 9:15 pm
Location: Winchester UK

Re: FPGA-based Controller for Kinematic Systems

Postby wuselfuzz » Sun Aug 02, 2009 2:40 pm

One note:

The current uploaded code has old leg numbering:

Code: Select all
0   3
1   4
2   5


This is going to change to

Code: Select all
0   5
1   4
2   3


soon.

Then there's a rotation of 180 degrees between the left side and the right side instead of mirroring.

The reason for this is having a closed polygon when traversing end effector positions 0-5 and back to 0.
wuselfuzz
 
Posts: 112
Joined: Thu Dec 11, 2008 3:32 pm

Re: FPGA-based Controller for Kinematic Systems

Postby wuselfuzz » Sun Aug 02, 2009 5:54 pm

Cleaned up the code and made changes regarding my last post.

All in a tgz: http://wuselfuzz.de/hexapod/files/f-cks-3e-current.tgz

If you want to run the code from the linux directory on a linux PC, change

Code: Select all
CC=arm-linux-uclibc-gcc
STRIP=arm-linux-uclibc-strip

OBJS=main.o ../libfcks/libfcks.a


in the Makefile to

Code: Select all
#CC=arm-linux-uclibc-gcc
STRIP=echo

OBJS=main.o ../libfcks/libfcks-fakespi.a



and there you go.
wuselfuzz
 
Posts: 112
Joined: Thu Dec 11, 2008 3:32 pm

Re: FPGA-based Controller for Kinematic Systems

Postby wuselfuzz » Tue Aug 04, 2009 10:38 am

Yay, got the bluez-bluetooth stack for linux running with the ericsson rok 101 107. :)
wuselfuzz
 
Posts: 112
Joined: Thu Dec 11, 2008 3:32 pm

Re: FPGA-based Controller for Kinematic Systems

Postby wuselfuzz » Tue Aug 04, 2009 6:41 pm

Overall project status, end of this thread (I'll make a new one soon :D ):

Hardware setup:

- MSR-H01 in black
- 12x HS645MG, 6x HS225MG for legs
- a laser mounted to a spare HS225, switchable by a GPIO via a simple NPN transistor. :twisted:
- Main CPU: Eddy 2.1 Module @ 200 MHz with 32 MB SDRAM and 8 MB Flash
- Ericsson rok 101 107 bluetooth module directly connected to Eddy via UART
- Zefant LC-3E FPGA board connected to Eddy via UART and SPI
- Homebrew servo signal distribution board featuring 18 servo outputs and two UART pin headers connected to FPGA board
- Test battery: 4x1.2V/1700mAh AA batteries
- Test PSU: ATX power supply with "POWER ON" bridged to "GND" on the ATX power connector (to force "ON")

VHDL Code:

- MIPS CPU working @ 33 MHz on new FPGA board, max 16k on-chip RAM/ROM available (RAM can be pre-initialized as ROM0
- PWM code working, but needs some optimizations
- SPI code working, but has some glitches

MIPS Code:

- SPI controller firmware working
- SPI commands for turning on/off an onboard LED and setting 24 servo PWM values
- pulsing "heartbeat" on other onboard LED when spi code is running

Linux Code:

- kernel based on Linux 2.6.27-at91-exp2 (stock 2.6.27 kernel + patches from linux4sam.org) with modifications made to the board configuration file to enable USART2 instead of USART1 and spidev
- root file system based on buildroot 2009.05 with the bluez bluetooth stack added
- the whole system loads the kernel and ramdisk from Eddy's 8MB dataflash and runs everything from RAM
- modified startup scripts automatically setup a console on a bluetooth rfcomm (serial emulation) channel and load the SPI firmware to the MIPS CPU
- buildroot configuration includes the lrzsz package that allows to transfer files to the ram disk via a terminal program with zmodem.

LiCKS Code:

- a simple calibration tool lets the user move each servo individually and save all current servo values as zero offsets in a file
- load_calibration() works
- update_servos() to send a uint16_t[NUM_SERVOS] array via SPI works
- ik_double() function seems to work somehow, but still has glitches
- ikcontrol tool allows to let the user move each leg's EE or the bot's body along x, y, z.
- ikcontrol uses a builtin calibration table, but uses a calibration file if it finds one
- some higher level movement functions are already implemented:

linear interpolation from one robot configuration (= body position + orientation and leg EE positions) to another configuration in a given amount of time (measured in 50 Hz frames) already works well

parabolic interpolation also works well. this is similar to the linear interpolation, but an additional vector a is given as an argument. A helper function t(frame) runs from -1 to 1. Also a binary leg mask is passed. For the legs marked in the leg mask, the function then is:

pos_leg_parabolic(frame)=pos_leg_linear(frame) + a * (1-t^2)

a balance(position,leg_mask) function tries to balance the bot's body center over the center of mass of the polygon created by the leg EE positions of the legs set in leg_mask.

this is currently tested in a balanced_walk() function. Regular tripod walk()ing already works quite well. :)

Project Name:

- It's getting a new name. f-cks will be LiCKS (Linux-based Controller for Kinematic Systems) :)

TODOs (short term):

- cleaning up the buildroot stuff
- documentation of the complete build process for the kernel + patches and buildroot itself
- improving the PWM module on the FPGA so all servos won't get their PWM pulse at the same time. I hope this will fix FPGA reset issues, turning on 18 servo motors at the same time seems to be a very bad idea. Depending on implementation, this will also improve the PWM resolution and increase the number of PWM channels
- fixing SPI glitches
- replacing femur and tibia servo horns with LM alu horns
- MORE POWER! A LiPo battery + switching regulator + charger is ordered

Ideas/TODOs (long term):

- feet sensors. I'm still uncertain about how to implement them
- different low-level drivers for my IK code. Writing PWM values to a file + OpenGL visualization already kinda work, but for example, it should be possible to write a replacement for the spi_update_servos function that controls an SSC-32 via serial. It should be possible to run the code on a PC running linux, connected to the SSC-32 via cable or bluetooth, and it should also be possible to run the same code compiled for ARM on the Eddy module, connected to the SSC-32 via UART. A pBrain driver would be possible, if the PIP protocol would support lower level access to servo functions (i.e. set PWM values directly, or set angles for joints).
- serious servo modding. There seems to be a well-known servo mod that "fixes the poti in the center position". Now what's inside a servo? The poti, a motor, some gears and a controller chip with an H-bridge. The idea would be removing the controller chip and the poti, adding an optical rotary encoder to the servo axis and generating the control signals for the H-bridge with a microcontroller or the FPGA. Goodbye 50 Hz jitter, forever!
- adding a camera. The microcontroller used has a CMOS image sensor interface (ISI). I already soldered about 20 cables to the neccessary connections to the Eddy module and dismantled an old USB camera. The linux kernel also has a video4linux driver that supports the atmel camera interface

/edit: Another very small Linux system: http://www.gumstix.com/
wuselfuzz
 
Posts: 112
Joined: Thu Dec 11, 2008 3:32 pm

Re: FPGA-based Controller for Kinematic Systems

Postby pem » Tue Aug 04, 2009 8:38 pm

That is an impressive amount of work you've put into this. Congratulations so far, and please keep us posted about further advancements.
pem
 
Posts: 42
Joined: Tue Aug 19, 2008 1:47 pm
Location: Copenhagen, Denmark

Re: FPGA-based Controller for Kinematic Systems

Postby wuselfuzz » Wed Aug 05, 2009 5:26 pm

Extra Stage:

I improved the PWM module today:

- 32 channels
- 62 Hz refresh rate
- 15 bit resolution for a PWM pulse with a maximum of 3855 usec duration (that's less than 1/8th microsecond :mrgreen: :mrgreen: :mrgreen: )
wuselfuzz
 
Posts: 112
Joined: Thu Dec 11, 2008 3:32 pm

Re: FPGA-based Controller for Kinematic Systems

Postby wuselfuzz » Sun Nov 15, 2009 7:39 pm

I was pretty busy for a while.

But look at this!

Image

I'm planning to use an atmega168 for A/D conversion.
wuselfuzz
 
Posts: 112
Joined: Thu Dec 11, 2008 3:32 pm

Previous

Return to Projects

Who is online

Users browsing this forum: Google [Bot] and 0 guests

cron