Roy Toren

Forum Replies Created

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • in reply to: controlling the engine #4844
    Author Image
    Roy Toren
    Participant

    I have tried using it like this:
    PositionPID PID = new PositionPID(motor, 360, true, 50, P, I, D, 50);
    PositionPID revPID = new PositionPID(motor, -180, true, 50, P, I, D, 50);

    but it didn’t seem to do the trick, the engine only does the 360 command.
    I am aiming for the arm that flips the cube to start on the cube and then do the flip(that’s the 360)
    but then I want the arm to leave the cube and go up a bit without flipping it again(that’s why I need to reverse the engine)

    in reply to: controlling the engine #4842
    Author Image
    Roy Toren
    Participant

    The PID works alot better with the testing I have done.
    I have configured it like this:
    PositionPID PID = new PositionPID(motor, 360, true, 50, P, I, D, 50);

    I left the P I and D the same as in the PID example since I don’t really know what they do, i guess 360 is a complete circle of the engine since it keeps coming back.
    I also need the engine to go in reverse(with the engine) in PID, is there anyway I can do that?

    As for the speed profile, I used it and it is probably the backlash, due to the fact that the engine is turning a cube so there is alot of friction and power involved.
    The speed profile does work, but the second it starts to make an error it does not fix it unlike what i have seen until now with the PID

    in reply to: controlling the engine #4834
    Author Image
    Roy Toren
    Participant

    I have read a little bit more about the PID.

    I Have some questions about it:

    the first one is what values should I enter in this function :
    Position PID (Motor motor, Int32 position, bool brake, sbyte max Power, float P, float I, float A, int seattle Times)
    (What is the position?, settle time?, P,I,D ?)

    The second question is how do i use it in my code, assuming my motor is connected to output A.

    And as for the color sensor, which one of them is the NXT and which one of them is the EV3? I have posted two pictures of different ones.
    can you please answer me in the topic?
    Thanks

    • This reply was modified 9 years, 7 months ago by Author ImageRoy Toren.
    in reply to: controlling the engine #4831
    Author Image
    Roy Toren
    Participant

    I forgot to mention and I can’t edit now.
    I have also tried the speed profile, it works for a while but after the 10th turn with the hand robot there is starting to be an error range, that gets bigger with time.
    I have to be as accurate as possibly can, the speed profile and power profile are not reliable since they rely on the engines power at that specific moment.
    I have also tried leaving the battery charging while running the program and the error range keeps on coming.

    in reply to: Can the color sensor detect orange? #4827
    Author Image
    Roy Toren
    Participant

    The other sensor is this one:
    (cant upload more then 512 KB :|)

    Attachments:
    You must be logged in to view attached files.
    in reply to: Can the color sensor detect orange? #4825
    Author Image
    Roy Toren
    Participant

    I have already tried th reflected light in the color sensor example, it didnt work.

    As for the RGB do I need a different sensor for that?
    I have these two:

    • This reply was modified 9 years, 7 months ago by Author ImageRoy Toren.
    Attachments:
    You must be logged in to view attached files.
    in reply to: controlling the engine #4821
    Author Image
    Roy Toren
    Participant

    I have tried using “GetTachoCount” but it didn’t do the job.
    I have searched through the documentation and found a few things that I think can work.
    the first one is the PID although it seems a little tricky.
    the second one is the vehicle in:http://www.monobrick.dk/MonoBrickFirmwareDocumentation/class_mono_brick_firmware_1_1_movement_1_1_vehicle.html

    I saw that there was a function that uses degrees and percentages as input, I think it would be best because then there wont be any error range, like when you try to control the engine speed or power(does not rely on battery power)
    I want to hear your opinion about the second one since I got an answer for the first option.
    Thanks.
    Ps.
    I added a picture of the robot so you guys could see.
    The design was adopted from this site:
    http://mindcuber.com/mindcub3r/mindcub3r.html

    • This reply was modified 9 years, 7 months ago by Author ImageRoy Toren.
    Attachments:
    You must be logged in to view attached files.
    in reply to: Trying to run a program(doesn't work) #4801
    Author Image
    Roy Toren
    Participant

    Hi,
    I have managed to successfully run the program, I used xamain instead of visual, thank you.

    I have another problem, I need to detect the color orange and with the color sensor program it detects orange as red. As I said before I’m building a rubiks cube solver and I need to distinguish between red and orange, is there a way I can do this?
    Thank you

    in reply to: Trying to run a program(doesn't work) #4798
    Author Image
    Roy Toren
    Participant

    I posted it already, I have tried both of them:

    first:

    using System;
    using MonoBrickFirmware;
    using MonoBrickFirmware.Display;
    using MonoBrickFirmware.UserInput;
    using MonoBrickFirmware.Sensors;

    using System.Threading;
    namespace ColorSensorExample
    {
    class MainClass
    {
    public static void Main (string[] args)
    {
    EventWaitHandle stopped = new ManualResetEvent(false);
    ColorMode[] modes = {ColorMode.Color, ColorMode.Reflection, ColorMode.Ambient, ColorMode.Blue};
    int modeIdx = 0;
    var sensor = new EV3ColorSensor(SensorPort.In1);
    ButtonEvents buts = new ButtonEvents ();
    LcdConsole.WriteLine(“Use color on port1″);
    LcdConsole.WriteLine(“Up read value”);
    LcdConsole.WriteLine(“Down raw value”);
    LcdConsole.WriteLine(“Enter change mode”);
    LcdConsole.WriteLine(“Esc. terminate”);
    buts.EscapePressed += () => {
    stopped.Set();
    };
    buts.UpPressed += () => {
    LcdConsole.WriteLine(“Sensor value: ” + sensor.ReadAsString());
    };
    buts.DownPressed += () => {
    LcdConsole.WriteLine(“Raw sensor value: ” + sensor.ReadRaw());
    };
    buts.EnterPressed += () => {
    modeIdx = (modeIdx+1)%modes.Length;
    sensor.Mode = modes[modeIdx];
    LcdConsole.WriteLine(“Sensor mode is set to: ” + modes[modeIdx]);
    };
    stopped.WaitOne();
    }
    }
    }

    secound:

    using System;
    using MonoBrickFirmware;
    using MonoBrickFirmware.Display;
    using MonoBrickFirmware.UserInput;
    using MonoBrickFirmware.Sensors;

    using System.Threading;
    namespace ev3test
    {
    class MainClass
    {
    public static void Main(string[] args)
    {
    LcdConsole.WriteLine(“Hello World!”);
    System.Threading.Thread.Sleep(10000);
    }
    }
    }

    What I dont get is, I copied the first source code from the sensor example and so it is supposed to work.
    but when i compile in the visual studio it throws an exeption and when i try to use the exe in the brick it runs it for 2 seconds and then quits

Viewing 9 posts - 1 through 9 (of 9 total)
Posted in

Make a donation