Show Posts
Pages: [1]
1  Using Arduino / Sensors / Using 2 ultrasonic distance sensors together on: December 16, 2013, 05:59:36 pm
Hello,
I plan to position two ultrasonic distance sensors(4 pin type, like the HC-SR04) in front of each other at a known distance, send a pulse from both sensors at the exact same time and measure the time (Or distance and divide by the speed of sound) it took for the pulse to get to the other sensor.
Is it possible? Would the sensors be able to pick the pulse from the sensor in front of them?
(Sensor A picks sensor B's pulse, and sensor B picks sensor A's pulse)
If not, would it be possible to use one sensor as just a transmitter and another as just a receiver?

The idea behind this is to build an ultrasonic anemometer (Measure wind speed) using four sensors.
2  Topics / Robotics / Re: And another self balancing robot on: September 06, 2012, 03:12:51 pm
I did read his code, did you?
Here's the relevant parts,
Code:
DCMotor m1(5,3);
DCMotor m2(11,9);

m1.run(speed);
m2.run(speed);

Quote
He feeds this value into the motor controller, that simply linearly converts it to some PWM output to drive the motors.
It's not linear, there is a control loop on the current.
"The MC33926 works with 3 – 5 V logic levels, supports ultrasonic (up to 20 kHz) PWM, and features current feedback".

There is a physical model behind it, you're just choosing to ignore it by 'tweaking' the PID with trial and error instead of actually doing the calculations. It would take less than an hour to build a physical model, find the differential equations(Also available on wiki), find the PID gains with Root Locust or any other method. It's a very common homework assignment given to students(My self included).

Quote
With the exception of some remote control code, that is ALL his code does.
You're right about that.
Again, all I'm trying to say is that the motor controller handles the torque control for him. This is why most projects like it use an encoder or a motor controller, using just an H-brdige and PWM probably won't work well.
3  Topics / Robotics / Re: And another self balancing robot on: September 05, 2012, 10:56:58 pm
The controller(PID in this case) is based on a physical model(Inverted pendulum), the PID values are not 'tweaked' - they can be calculated based on the physical model and according to your requirements(Stability margins/damping/overshoot/optimizing a price function) .
The robot balance it self out by moving, the robot moves by applying torque on the wheels and that torque is generated by the motors.
The torque is proportional to the current, not voltage, you can't simply control the torque(Movement of the robot) with just PWM.
You can send a certain PWM(Voltage) pulse and it would create a torque of X, while using the same PWM pulse in a different scenario(Robot is already moving for example) would create a torque of 0.8*X.
He's using a dedicated IC(mc33926) to control the motors, that IC closes a control loop on the motor's current so he can control the torque from the Arduino.
(Same way the robot balance it self according to user input and IMU measurements the mc33926 does the same to the current based on the user input coming from the Arduino and a current sensor)
4  Topics / Robotics / Re: And another self balancing robot on: September 05, 2012, 06:21:42 pm
Looks really nice!
I've read the PDF in your github, it was very informative and easy to understand.
I'm thinking of building a self balancing robot my self and may I ask how are you controlling the motors?
You don't have encoders so I'm guessing its an open loop design(?), how do you control the torque they output?


He's using a PID controller to drive the motors based on feedback from the IMU.
That part I got, I was wondering how is he controlling the motor's torque. If for example the PID says a torque of 1 Nm is needed, how does he get the motors to output this exact amount of torque(That requires a certain current while we usually control the voltage).
Anyhow, I read the code and the mc33926 has a current sensor to close a loop on the motors and it handles the motor control.
5  Topics / Robotics / Re: And another self balancing robot on: September 04, 2012, 10:08:07 pm
Looks really nice!
I've read the PDF in your github, it was very informative and easy to understand.
I'm thinking of building a self balancing robot my self and may I ask how are you controlling the motors?
You don't have encoders so I'm guessing its an open loop design(?), how do you control the torque they output?
6  Using Arduino / Sensors / Re: Need an easy to use 9DOF IMU module on: June 13, 2012, 01:09:51 pm
Hello Fabio, thank you for your reply(You are quite the celebrity when it comes to IMUs smiley ).
I'm glad to hear the drifting isn't an issue.
I plan on using the IMU with an Arduino Uno, what frequency(Entire loop) can I expect using the FreeIMU v0.4?
I've seen a few Quadrotor projects using the FreeIMU, do you have an idea what loop frequency(IMU+contoll) they get?

*By loop frequency I mean how many times a second the Arduino can read the values from the IMU, calculate the Orientation(Euler angles, 3D acceleration data, compass orientation), calculate values for the PID controllers and output it.

Jase_MK, I'd be happy to hear about your progress.
7  Using Arduino / Sensors / Need an easy to use 9DOF IMU module on: June 12, 2012, 04:18:49 pm
Hello everyone,
I want to try and build a Quadrotor over the summer, I plan on designing my own controllers(PIDs) and implement them on an Arduino.
In order to do so I need to obtain the orientation, I'd prefer using a 9DOF IMU module(6DOF could also work).
I aim for a simple to use IMU module so I can get the orientation(XYZ Acceleration, Euler angles or pitch/roll/yaw, and magnetometer data) easily. I'd like to spend as little time as possible getting it to work(And I'm not very talented when it comes to electronics/programming).
If the calculations are made on the Arduino I'd need it to have enough power left to handle the PID controllers(Optimal solution would be the IMU it self doing all of it).
After those two requirements are met I wouldn't want an expensive module as I'm a broke student  smiley

To summarize, I'm looking for an easy to use 9DOF IMU module(Or 6DOF) that would allow me to use the Arduino as a PID controller without getting too expensive.

I was thinking about the:
  • MPU-6050, costs $40 on sparkfun, however seems to be difficult to work with and get the DMP to work.
  • FreeIMU 0.4, would cost around $100, seems to be pretty easy to use, uses the MPU-6050 and I believe it uses the DMP feature so it would save CPU time on the Arduino. The developer stated on one of his youtube videos that there are drifting problems.
  • ArduIMU, would cost around $80, uses the MPU-6000 but without DMP, has drift issues from what I've read.
  • MinIMU-9 , price is about $50, seems to be easy enough to use with an Arduino, the processing is made on the Arduino so might not have enough CPU for the PID controllers. Perhaps its possible to get one Arduino to process the data and send it to a second Arduino(The PID controllers)?

I'd be very happy to hear your thoughts/ideas on the modules above or anything else, I'm a fish out of the water here.



8  Using Arduino / LEDs and Multiplexing / Re: Controlling 12~ RGB LEDs with an Arduino on: June 09, 2012, 07:07:51 pm
Just an added bonus.
The TLC5940 has a supporting library for the arduino.
http://code.google.com/p/tlc5940arduino/
It makes them super easy to use.
I did note this library but never bothered to check it's website, they have a useful explanation about the power dissipation.

Quote
That means that if I use 2 LEDs(Each requires less than 2.5V of course) instead of 1 for each channel I can decrease the power dissipated
Well, it's true, the problem only red led's fall in this category, may be green produced via old technology (low brightness). Blue require about 3 V, on some occasions up to 4V. If you need more leds, you could increase a voltage and stack 3 leds in series (for 12V) the same way RGB led strip made.
You're right about that, if I do need more power I'll just use 12V(Will be using a computer PSU anyway).

Thanks again for your kind replies  smiley
9  Using Arduino / LEDs and Multiplexing / Re: Controlling 12~ RGB LEDs with an Arduino on: June 09, 2012, 10:43:55 am
That's even better. That means that if I use 2 LEDs(Each requires less than 2.5V of course) instead of 1 for each channel I can decrease the power dissipated on the TLC5940 substantially.
Thanks everyone!
10  Using Arduino / LEDs and Multiplexing / Re: Controlling 12~ RGB LEDs with an Arduino on: June 09, 2012, 07:50:21 am
Thank you for your reply.
I'll be using a 5V power source and use all 16 channels.
I'll add a ~2k ohm resistor on the IREF pin so I'd get 20mA output(According to Page 5, Table 1, Equation 3) on each channel.
Assuming all 16 channels would be operating there's going to be at least 320mA. 320mA*5V = 1600mW which is less than the power rating for the PDIP version (http://www.sparkfun.com/products/10136 this is PDIP right?) on the table you were referring to(At 25 deg C).
Is my calculation correct? does it mean I'm in the clear?
11  Using Arduino / LEDs and Multiplexing / Re: Controlling 12~ RGB LEDs with an Arduino on: June 08, 2012, 03:16:30 pm
Looks interesting but I can't figure out what current they can handle.
The 60mA(For Vcc<3.6V) or 120mA(For Vcc>3.6V) refers to the current for one channel or all 16 channels?
If the 120mA limit is for all channels it means I can only use 6(I need 20mA per channel) channels at the same time which won't be enough.
12  Using Arduino / LEDs and Multiplexing / Re: Controlling 12~ RGB LEDs with an Arduino on: June 08, 2012, 10:58:41 am
Thank you, it's very useful.
I am interested in brightness control, won't I be able to dim the LEDs by changing the PWM frequency somehow(Is it ven possible with the shift registers?)?
13  Using Arduino / LEDs and Multiplexing / Controlling 12~ RGB LEDs with an Arduino on: June 08, 2012, 08:08:13 am
Hello everyone,
I've seen this project: and I'd like to build something similar but be able to control each LED individually.
Basically I'd like to control approximately 12 RGB LEDs(20mA each color, 60mA for a LED) using an Arduino and avoid multiplexing of any kind.
What would be the cheapest/easiest way to get the job done? I'm planning on using a computer PSU to power it all.

Thank you.
14  Using Arduino / Motors, Mechanics, and Power / Which Brushless Motor/ESC to start with? on: January 21, 2012, 06:55:14 pm
Hello everyone, Arduino newbie here  smiley
I want to build a quad copter(Such as the ArduCopter project) sometime in the future but for now I want to learn how to work with an Arduino and a motor before I buy expensive equipment.
What Brushless Motor and ESC would you recommend to start with? I've read that controlling an ESC can be tricky(With the arming procedure and all) so I'd prefer something with good documentation.
Regarding the physical aspects, I'd like a reliable motor/ESC and to be able to reach ~1000g of thrust at full throttle.

I'm going to buy it online(Probably from hobbyking or ebay) should it matter.
Pages: [1]