Beispiel #1
0
def reference_point():
	global a, b, c
	
	motor((-1 * a), 100, 'a')
	motor((-1 * b), 100, 'b')
	motor((-1 * c), 100, 'c')
	
	read_save_position.save_position(0, 0, 0)
Beispiel #2
0
def correction_b(steps_a):
	alpha = steps_to_angle(steps_a)
	x = (((-1 * distance) - (radius_a * math.degrees(math.cos(alpha))) + target_distance) / (radius_b))
   	beta = math.asin(x)
   	beta = math.degrees(beta)
	new_position = angle_to_steps(beta)

	read_save_position.save_position(a, new_position, c)

	return new_position
Beispiel #3
0
def coordinate2(m_a, m_b, m_c, delay):
	global a, b, c
	print(old_a, old_b, old_c, a, b, c)
	steps_a = (int(m_a) - int(a))
	steps_b = (int(m_b) - int(b))
	steps_c = (int(m_c) - int(c))
	
	motor(int(steps_a), delay, 'a')
	motor(int(steps_b), delay, 'b')
	motor(int(steps_c), delay, 'c')

	read_save_position.save_position(m_a, m_b, m_c)
	print('steps: '+ str(steps_a) +' '+ str(steps_b) +' '+ str(steps_c))
Beispiel #4
0
def latest_position():
	global old_a, old_b, old_c, a, b, c
	print(old_a, old_b, old_c, a, b, c)
	steps_a = (int(old_a) - int(a))
	steps_b = (int(old_b) - int(b))
	steps_c = (int(old_c) - int(c))
	
	motor(int(steps_a), 1, 'a')
	motor(int(steps_b), 1, 'b')
	motor(int(steps_c), 1, 'c')

	read_save_position.save_position(old_a, old_b, old_c)
	print('steps: '+ str(steps_a) +' '+ str(steps_b) +' '+ str(steps_c))
Beispiel #5
0
def coordinate1(x, z, delay):
    global old_a, old_b, old_c, a, b, c
    
    steps_a = motor_a(int(x), 1)
    steps_c = motor_c(int(z), 1)
    
    new_a = int(old_a) + int(steps_a)
    new_b = int(old_b) - int(b)		# TODO
    new_c = int(old_c) + int(steps_c)
    read_save_position.save_position(new_a, new_b, new_c)
    
    motor(steps_a, 1, 'a')
    motor(1, 1, 'b')
    motor(steps_c, 1, 'c')
    
    print(steps_a, 1, steps_c)
Beispiel #6
0
def tracking(x_dist, z_dist):
	global old_a, old_b, old_c, a, b, c

	steps_a = motor_a(x_dist, 1)
	steps_c = motor_c(z_dist, 1)
	
	new_a = int(old_a) + int(steps_a)
	new_b = int(old_b) - int(b)		# TODO
	new_c = int(old_c) + int(steps_c)
	read_save_position.save_position(new_a, new_b, new_c)
	
	motor(steps_a, 1, 'a')
	motor(1, 1, 'b')
	motor(steps_c, 1, 'c')

	print(steps_a, 1, steps_c)
Beispiel #7
0
def automatic(x_dist, z_dist):
	global old_a, old_b, old_c, a, b, c

	steps_a = motor_a(x_dist, 1)
	steps_c = motor_c(z_dist, 1)
	
	new_a = int(old_a) + int(steps_a)
	new_b = int(old_b) - int(b)		# TODO
	# steps_b = int(correction_b(steps_a)
	# new_b = int(old_b) + )
	new_c = int(old_c) + int(steps_c)
	# steps_c = (int(steps_c) + int(correction_c(steps_b))
	# new_c = int(old_c) + int(steps_c)
	read_save_position.save_position(new_a, new_b, new_c)
	
	motor(steps_a, 1, 'a')
	motor(1, 1, 'b')
	motor(steps_c, 1, 'c')

	print(steps_a, 1, steps_c)
Beispiel #8
0
def update_position(new_a, new_b, new_c):
    global a, b, c
    read_save_position.save_position(new_a, new_b, new_c)
    a = int(new_a)
    b = int(new_b)
    c = int(new_c)