Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View kkmonster's full-sized avatar
🏠
Working from home

Wasin Wongkum kkmonster

🏠
Working from home
View GitHub Profile
uint8_t read_button()
{
static boolean hold;
static boolean button_a_state_prev;
static boolean button_b_state_prev;
static unsigned int button_a_time_prev;
static unsigned int button_b_time_prev;
boolean button_a_state = 1-digitalRead(button_a); //pull up
boolean button_b_state = 1-digitalRead(button_b); //pull up
@kkmonster
kkmonster / read_button()
Last active August 29, 2015 14:16
retrun 6 state by 2 button
uint8_t read_button()
{
static boolean hold; // reset timer
static boolean button_a_state_prev; // hold a
static boolean button_b_state_prev; // hold b
static unsigned long button_a_time_prev; // timer a
static unsigned long button_b_time_prev; // timer b
boolean button_a_state = 1-digitalRead(button_a); //pull up
/**
******************************************************************************
* File Name : main.c
* Date : 13/11/2014 14:11:59
* Description : Main program body
******************************************************************************
*
* COPYRIGHT(c) 2014 STMicroelectronics
*
* Redistribution and use in source and binary forms, with or without modification,
/**
******************************************************************************
* File Name : main.c
* Date : 06/03/2015 23:17:34
* Description : Main program body
******************************************************************************
*
* COPYRIGHT(c) 2015 STMicroelectronics
*
* Redistribution and use in source and binary forms, with or without modification,
บทคัดย่อ
หุ่นยนต์เดลตา (Delta Robot) เป็นหุ่นยนต์ที่มี 3 องศาอิสระ ที่มีสายโซ่จลนศาสตร์มากกว่าหนึ่งเส้นทำให้การวิเคราะห์ทางจลนศาสตร์ที่มีความซับซ้อนมากขึ้น จุดเด่นของหุ่นยนต์เดลตาคือเป็นหุ่นยนต์ที่มีความแม่นยำ มีความคล่องตัว และอัตราส่วนระหว่างแรงต่อน้ำหนักตัวสูง ซึ่งโดยทั่วไปหุ่นยนต์เดลตาจะมีโครงสร้างที่สมมาตรกัน คือมีลักษณะแขนคล้ายขาแมงมุม 3 ขา ที่มีขนาดเท่ากันปลายของแขนทั้ง 3 ต่อกันเป็นจุดเดียว (End-Effector) แขนทุกแขนถูกติดตั้งบนเส้นรอบวงกลมของฐานที่หยุดนิ่ง และแขนแต่ละแขนติดตั้งทำมุม 120 องศาต่อกัน ปัจจุบันมีงานวิจัยจำนวนมากศึกษาการสังเคราะห์ปริภูมิโครงสร้างของหุ่นยนต์เดลตาแบบมีโครงสร้างที่สมมาตร แต่ยังไม่พบงานวิจัยที่ศึกษาการสังเคราะห์ปริภูมิโครงสร้างของหุ่นยนต์เดลตาที่มีโครงสร้างที่ไม่สมมาตร
บทความนี้นำเสนอการสังเคราะห์ปริภูมิโครงสร้างที่เหมาะสมของหุ่นยนต์เดลตาแบบมีโครงสร้างไม่สมมาตรเมื่อกำหนดปริภูมิการทำงาน(Workspace) ที่ต้องการ โดยหาความสัมพันธ์ที่เหมาะสมระหว่างปริภูมิโครงสร้างต่างๆ ของหุ่นยนต์เดลตาที่มีโครงสร้างไม่สมมาตรกับปริภูมิการทำงานสูงสุดโดยใช้ maximum inscribed workspace ซึ่งกำหนดปริภูมิกา
/**
******************************************************************************
* File Name : main.c
* Date : 21/03/2015 17:50:15
* Description : Main program body
******************************************************************************
*
* COPYRIGHT(c) 2015 STMicroelectronics
*
* Redistribution and use in source and binary forms, with or without modification,
float Smooth_filter(float alfa, float new_data, float prev_data)
{
float output = prev_data + (alfa * (new_data - prev_data));
return output;
}
void PID_thread(void const * arg)
{
while (true)
{
osEvent evt = osSignalWait(SIGNAL_OUTPUT_1_TOGGLE, osWaitForever);
if (evt.status == osEventSignal)
{
nrf_gpio_pin_set(GPIO_OUTPUT_0);
osDelay(1);
/*
kkmonster cmmc : internal clock 1 Mhz
*/
#include <avr/interrupt.h>
#include <util/delay.h>
#define servo_pin 0
volatile int servo = 100;
void setup()
@kkmonster
kkmonster / IR_esp_v1
Created June 7, 2015 11:47
First test
#define daikin_freq 38
#define daikin_data 27
int count = 0;
byte delay_low = 0;
byte ir_byte_no = 0;
byte ir_header = 0;
byte ir_state = 0;
char IR_data[daikin_data] = {0x11,0xDA,0x27,0xF0,0x00,0x00,0x00,0x20,
//0 1 2 3 4 5 6 7
0x11,0xDA,0x27,0x00,0x00,0x41,0x1E,0x00,