Reaction Wheel Actuated Satellite Dynamics Test Platform

Dependencies:   mbed

Diploma Thesis in Aerospace Engineering, January 2014

University of Applied Sciences Munich, Faculty 03

Electronics:

  • 1x mbed NXP LPC 1768 Microcontroller
  • 2x XBee S1 Radios + Sparkfun USB Adapter
  • 1x CHR UM6-lt IMU
  • 4x Graupner BEC 8 Motor Controllers
  • 4x ROXXY 2826/09 Brushless Motors
  • 1x Hacker TopFuel LiPo 1300mAh Battery
  • 1x big Selfmade BreakOutBoard to connect all components
  • 1x small BreakOutBoard to connect IMU

Hardware developed with Catia V5R20

Manufactoring Technology: Rapid Prototyping - EOS Formiga P110

Controlled via text based menu with DockLight

__________________

Committer:
DimitriGruebel
Date:
Wed Jul 09 07:35:50 2014 +0000
Revision:
0:1447d2f773db
Dynamics Test Platform

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DimitriGruebel 0:1447d2f773db 1 /* ______________________________________________________________________________________
DimitriGruebel 0:1447d2f773db 2 File: UM6_usart.h
DimitriGruebel 0:1447d2f773db 3 Author: CH Robotics, adapted for mbed by lhiggs
DimitriGruebel 0:1447d2f773db 4 Version: 1.0
DimitriGruebel 0:1447d2f773db 5
DimitriGruebel 0:1447d2f773db 6 Description: Function declarations for USART communucation
DimitriGruebel 0:1447d2f773db 7 -------------------------------------------------------------------------------------- */
DimitriGruebel 0:1447d2f773db 8
DimitriGruebel 0:1447d2f773db 9 #ifndef _CHR_USART_H
DimitriGruebel 0:1447d2f773db 10 #define _CHR_USART_H
DimitriGruebel 0:1447d2f773db 11
DimitriGruebel 0:1447d2f773db 12 #define MAX_PACKET_DATA 40
DimitriGruebel 0:1447d2f773db 13
DimitriGruebel 0:1447d2f773db 14 // Definitions of states for USART receiver state machine (for receiving packets)
DimitriGruebel 0:1447d2f773db 15 #define USART_STATE_WAIT 1
DimitriGruebel 0:1447d2f773db 16 #define USART_STATE_TYPE 2
DimitriGruebel 0:1447d2f773db 17 #define USART_STATE_ADDRESS 3
DimitriGruebel 0:1447d2f773db 18 #define USART_STATE_DATA 4
DimitriGruebel 0:1447d2f773db 19 #define USART_STATE_CHECKSUM 5
DimitriGruebel 0:1447d2f773db 20
DimitriGruebel 0:1447d2f773db 21 // Flags for interpreting the packet type byte in communication packets
DimitriGruebel 0:1447d2f773db 22 #define PACKET_HAS_DATA (1 << 7)
DimitriGruebel 0:1447d2f773db 23 #define PACKET_IS_BATCH (1 << 6)
DimitriGruebel 0:1447d2f773db 24 #define PACKET_BATCH_LENGTH_MASK ( 0x0F )
DimitriGruebel 0:1447d2f773db 25
DimitriGruebel 0:1447d2f773db 26 #define PACKET_BATCH_LENGTH_OFFSET 2
DimitriGruebel 0:1447d2f773db 27
DimitriGruebel 0:1447d2f773db 28 #define BATCH_SIZE_2 2
DimitriGruebel 0:1447d2f773db 29 #define BATCH_SIZE_3 3
DimitriGruebel 0:1447d2f773db 30
DimitriGruebel 0:1447d2f773db 31 #define PACKET_NO_DATA 0
DimitriGruebel 0:1447d2f773db 32 #define PACKET_COMMAND_FAILED (1 << 0)
DimitriGruebel 0:1447d2f773db 33
DimitriGruebel 0:1447d2f773db 34
DimitriGruebel 0:1447d2f773db 35 // Define flags for identifying the type of packet address received
DimitriGruebel 0:1447d2f773db 36 #define ADDRESS_TYPE_CONFIG 0
DimitriGruebel 0:1447d2f773db 37 #define ADDRESS_TYPE_DATA 1
DimitriGruebel 0:1447d2f773db 38 #define ADDRESS_TYPE_COMMAND 2
DimitriGruebel 0:1447d2f773db 39
DimitriGruebel 0:1447d2f773db 40
DimitriGruebel 0:1447d2f773db 41 extern uint8_t gUSART_State;
DimitriGruebel 0:1447d2f773db 42
DimitriGruebel 0:1447d2f773db 43 // Structure for storing TX and RX packet data
DimitriGruebel 0:1447d2f773db 44 typedef struct _USARTPacket
DimitriGruebel 0:1447d2f773db 45 {
DimitriGruebel 0:1447d2f773db 46 uint8_t PT; // Packet type
DimitriGruebel 0:1447d2f773db 47 uint8_t address; // Packet address
DimitriGruebel 0:1447d2f773db 48 uint16_t checksum; // Checksum
DimitriGruebel 0:1447d2f773db 49
DimitriGruebel 0:1447d2f773db 50 // Data included for convenience, but that isn't stored in the packet itself
DimitriGruebel 0:1447d2f773db 51 uint8_t data_length; // Number of bytes in data section
DimitriGruebel 0:1447d2f773db 52 uint8_t address_type; // Specified the address type (DATA, CONFIG, OR COMMAND)
DimitriGruebel 0:1447d2f773db 53
DimitriGruebel 0:1447d2f773db 54 uint8_t packet_data[MAX_PACKET_DATA];
DimitriGruebel 0:1447d2f773db 55
DimitriGruebel 0:1447d2f773db 56 } USARTPacket;
DimitriGruebel 0:1447d2f773db 57
DimitriGruebel 0:1447d2f773db 58 uint16_t ComputeChecksum( USARTPacket* new_packet );
DimitriGruebel 0:1447d2f773db 59
DimitriGruebel 0:1447d2f773db 60 #endif