Jump to content




CotA 2013 Electronics


  • Please log in to reply
31 replies to this topic

#21 LaMbChOpZ

LaMbChOpZ

    Lead Particle Physicist and Musical Orchestrator

  • 2812 posts

Posted 21 August 2012 - 08:24 PM

Max, in response to your 'wibbly wobbly' input from Reeds, use a Non-inverting Op-Amp, easy to set up, and it'?d sort that entirely.

so happy to be the first guy using reeds ;)

The first of many!

I'd say go with the Mega, saves you a lot of time.

And indeed I shall (because you and Bart told me to :P )

Absolutely. And I recommend buying one on ebay. These cheap ones are fake, but because arduino ALLOWS copying the board and selling them and they have the blueprints online, they really are exact replicas. They work fine, I've had mine for 2 years now and it still works. Or you can go with an official one, I don't know what their advantage is, haha. What I do know is that they are 3 times as expensive.


Thanks! It's funny how people tell me that cable is "rare" and "hard to find", yet, NXT uses it to also connect to the computer. Now I can have 2! So when you also referred to "Pins", those were the little holes in the black rows (not being very technical now), correct?

That is about what I paid for mine from this seller.

T**trim**

Thanks!

I get mine at an official dealer. The guys offers me discounts on everything he sells. That and if you do manage to blow it up, my dealer gives 100% warranty. The Uno models come with stickers too :D


Yeah, great that you get discount. But Lamb doesn't, and he will probably not get any warranty on his arduino either if he buys a real one in america.


If he buys from a legitimate dealer he most likely will get warranty on his product. Electronics have a high chance of being dead on arrival.


Okay then. You will pay 40$ extra for the warranty on a 20$ product. Lamb, you must decide for yourself what you want. An official one might be a bit better (well, my fake one still works fine and I've never heard any complaints about the fake ones anyways), because it is made by a trusted company. For me it wasn't worth the money.


Eh, not sure I will go for the discount. The buttons and all are already setting me back about $75 already, and although I do have a few hundred saved up, I'd rather not break the bank. Right now, I think one off Ebay will be good for now. Besides, having an expensive board with a discount (and warranty....) may still cost much more than the one off Ebay. I'll look into this tomorrow. I'll try to order this soon so I can have a good chance of getting it before school starts in 2 weeks.

Member of a few physics experiments; Orchestrator and/or Copyist for a few musicals.


#22 ForgotToGrowUp

ForgotToGrowUp

    Lead Engineer

  • 1732 posts

Posted 22 August 2012 - 08:28 AM

It's open source board so nothing is "fake" just a different source. Many of the eBay sellers from China offer returns if it is DOA. Besides at 1/3 the price you could by 2 and still be ahead of the game. I bet all the chips on all the boards are made in the same factories... probably in Taiwan

Comet Recreation still underway.

Proof you never grow up if you keep playing with toys!


#23 TheSUCKCrew

TheSUCKCrew

    Way too old

  • 4095 posts

Posted 22 August 2012 - 05:20 PM

Finally someone that is on my side, haha.

ForgotToGrowUp, I will make a tutorial for the whole thing soon. First I want my own launch with custom motor to work nicely, so I have a proof of concept.
Meanwhile I'm helping Lambchopz figure out what motor and other parts he needs. It's going smoothly so far, we just have to figure out the controller and then we are done.



#24 ForgotToGrowUp

ForgotToGrowUp

    Lead Engineer

  • 1732 posts

Posted 23 August 2012 - 05:18 PM

Sorry if this seems like a hijack of the thread...

Got the Mega I ordered. FYI even though this eBay seller was listed as a seller from China they fulfilled the order through an Amazon drop ship. I got the item with free shipping and it arrived in 2 days. I don't know when I'll get to start playing with it but am excited.

edit: Downloaded the Software and Uploaded the Blink example and it seems to be working... anything more might actually take a little brain activity.

Mega
Posted Image

Motor Shield
Posted Image

All for $49
Posted Image

Comet Recreation still underway.

Proof you never grow up if you keep playing with toys!


#25 LaMbChOpZ

LaMbChOpZ

    Lead Particle Physicist and Musical Orchestrator

  • 2812 posts

Posted 05 September 2012 - 05:34 AM

So where I am now:

- Electronics needed are still being figured out.
- Reason? I'm still figuring out how many reed switches will need to be placed (most likely 5) and how many motors I'll need (at this point, 2 - Lift Hill and Brake Run transport)
- I've been able to line up the parts I need, but with school starting yesterday, it may be a few days until they're ordered



- Got a head start on the code. It's just variable set up.

//Blocks
boolean block_reduction_br;
boolean block_main_br;
boolean block_station;
boolean block_main_track;


//Sensors
boolean sensor_post_reduction_br;
boolean sensor_pre_main_br;
boolean sensor_post_main_br;
boolean sensor_pre_station;
boolean sensor_post_lift_hill;


//States
int Init_state = 0;
int reduction_br_state = 0;
int main_br_state = 0;
int station_state = 0;
int lift_state = 0;
int main_track_state = 0;

//Buttons and LED

boolean dispatch_button_State = LOW;
boolean dispatch_button_Light = LOW;
boolean light_button_State = LOW;
// 2 way switches needed
// E-Stop needed
// LED's needed







I have a bit more to do and a bit more in the works. As for the coaster/code in general will be doing:

Start of coaster

  • With use of reeds and the arduino, the train's location will be found by use of reed switches. The trains start off in the Station (and brake run if running 2 trains).
  • If the trains for some reason aren't on the block, then the option for dispatch will wait until a train is in the station (and brake run) before the option is allowed.
  • When everything is ready to be dispatched (reed switch in station is activated), the catch car will come down to the station, connect on to the train, then the dispatch button will light up and work.


  • When dispatched, the train will move in similar fashion to the real ride, reaching the lift's full speed by the time the first car has entered the straight section of the lift.
  • At the top of the lift, the catch car will deaccelerate as the train crests the top of the lift.
  • As it enters the main track (end of cable lift), it will set off the reed switch that signals the lift is clear on the main panel, but it will in no way affect the block system since the lift and main track are part of the same block.


  • As the train in the station is leaving the station, the 2nd train on the brake run is moving into the station (at about a 1-2 second delay).
  • As it pulls into the previous train's location, it sets off the reed switch in the station, thus starting the dispatch option again where the cable will come down and wait for the ride to dispatch. However, the cable lift won't be halfway up the lift by then, so a delay will be added so that there is enough time for train to crest, stop, then come back down to the station.

  • For the ride in the main track, as it enters the reduction brake, it will set off a reed switch that will signal that the main track is technically clear, but it will in no way affect the block system. This is because the reduction brake won't have the power to bring the train to a complete stop, only the main brake run. It may seem pointless, but it will allow for easier comprehension of the cars' location in the layout.

  • When a train enters the reduction brake and sets off the reed switch, the transport for the brake run is activated.
  • Since a train is always going to have to be in the station and brake run to dispatch, when the train on the brake run sets off the last reed switch before the station, this turns off the transport.
  • When the train in the station dispatches, then the transport is activated and moves the train in at a 1-2 second delay to the lift hill.




Now I am thinking, what about if I'm running just one train? It could happen. With the code I'll be writing, there will have to be 2 trains for one to dispatch, so now comes the problem of having a "# of trains" switch button option. If I were to do this, I think I would write a second bit of the same code, just edited to not have to worry about the second train, correct? It would be the arduino's way of saying "if this side is selected, run this code. If this other side is selected, run the other code." Does that sound right?

Member of a few physics experiments; Orchestrator and/or Copyist for a few musicals.


#26 Jogumpie

Jogumpie

    Living through the great Gump hiatus...

  • 13586 posts

Posted 05 September 2012 - 06:22 AM

When designing Balrog's program I figured that, when having a model running for several months, having a '# of trains' switch as a user input would provide a potential threat to the model. Every user input is unwanted.


SSCoasters Administrator
The SSCoasters Forum Rules
DD_signature.jpg
YoutubeButton.pngFacebookButton.png


#27 ForgotToGrowUp

ForgotToGrowUp

    Lead Engineer

  • 1732 posts

Posted 05 September 2012 - 06:48 AM

You initialization code should be able to figure out how many trains there are. It could also figure it out on the fly if it detects no train entered the station after a reasonable amount of time has passed since the first train has left.

Comet Recreation still underway.

Proof you never grow up if you keep playing with toys!


#28 Maxlaam

Maxlaam

    Tracing Tyrant's Steps

  • 8116 posts

Posted 05 September 2012 - 09:21 AM

Gump told me that he talked to you about a scheme to follow when coding.

http://www.sscoaster...708/#post302439

Read that. Draw yourself a diagram so you can use arrows and lines to give yourself a visual interpretation of your code and how pieces of the code relate and interact with other parts of your code.

It's great for debugging and makes it much easier for others to understand what your code is supposed to do if you can't figure out the problem yourself.


SSCoasters Administrator
Read The Forum Rules(smart)

Posted Image
Posted ImagePosted Image


#29 LaMbChOpZ

LaMbChOpZ

    Lead Particle Physicist and Musical Orchestrator

  • 2812 posts

Posted 18 November 2012 - 10:09 PM

I have a scheme made up. I only wrote it for 2 trains on automatic setting. I am still deciding what I will do with the possibility of having 1 train run only. I may write a whole new program for just 1 train (since this would be a major thing, opening up a new program and implementing it wouldn't take much of that time), but would you do that? It would make coding easier, but longer, and lessen the chance of coding error. Opinions about that?

And for the schematic, I truncated it and explained where the repetition would continue (not including delays of the repeat), for it would go on forever. For the manual control, I am working on that. I will post all of them tomorrow after school.

Member of a few physics experiments; Orchestrator and/or Copyist for a few musicals.


#30 LaMbChOpZ

LaMbChOpZ

    Lead Particle Physicist and Musical Orchestrator

  • 2812 posts

Posted 25 November 2012 - 06:44 PM

So I've been able to design and write up the code for the 2 train and 1 train options, however, I believe I have designed a simple way of eliminating the need for a "# of trains" button. Photos of the code are below (were in the original Microsoft Word file, but it's too small to read and fit in 1 line).


You can see that in the code, in the last step before entering the station, the train must wait in the brake run for the station sensor to be "clear" for 2 seconds before entering to the station. With the code, if there is two trains, this works out very well. For one train, this allows for a controlled stop of the train and a break in activity without the need to write a second program that would need to be initialized. Does this sound like an effective way to go about this? I will also update the control panel and electronics in an hour or so. These diagrams are only about the movement of the train, not functions and special features of the control panel.

1 Train Code:
Posted Image


2 Train Code:
Posted Image

Member of a few physics experiments; Orchestrator and/or Copyist for a few musicals.


#31 Jogumpie

Jogumpie

    Living through the great Gump hiatus...

  • 13586 posts

Posted 25 November 2012 - 07:09 PM

Liam and I just had a talk on this and I suggested that he should make such sequential orders for different blocks. In that way he looks from the blocks' perspective instead of from the trains'.


SSCoasters Administrator
The SSCoasters Forum Rules
DD_signature.jpg
YoutubeButton.pngFacebookButton.png


#32 Maxlaam

Maxlaam

    Tracing Tyrant's Steps

  • 8116 posts

Posted 26 November 2012 - 02:23 AM

A grafcet should note everything in your code. This is much more of a flowchart. "Search trains" is way too vague as it doesn't leave any clue on how to do so.


SSCoasters Administrator
Read The Forum Rules(smart)

Posted Image
Posted ImagePosted Image